From owner-svn-src-all@freebsd.org Sun May 5 00:15:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23C7F159CC62; Sun, 5 May 2019 00:15:31 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B90CE76AE3; Sun, 5 May 2019 00:15:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A75F9FDD2; Sun, 5 May 2019 00:15:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x450FUSa047602; Sun, 5 May 2019 00:15:30 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x450FURD047601; Sun, 5 May 2019 00:15:30 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905050015.x450FURD047601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 5 May 2019 00:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r347135 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: cy X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 347135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B90CE76AE3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 00:15:31 -0000 Author: cy Date: Sun May 5 00:15:30 2019 New Revision: 347135 URL: https://svnweb.freebsd.org/changeset/base/347135 Log: Sizelimit for sqlite3-3.28.0 (3280000). Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Sat May 4 20:34:26 2019 (r347134) +++ svnadmin/conf/sizelimit.conf Sun May 5 00:15:30 2019 (r347135) @@ -16,6 +16,7 @@ # First field is username, second field is the raised limit required. achim bapt +cy davidcs dim 20480000 imp From owner-svn-src-all@freebsd.org Sun May 5 00:16:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93B63159CCE9; Sun, 5 May 2019 00:16:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D1E176C15; Sun, 5 May 2019 00:16:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14301FDD3; Sun, 5 May 2019 00:16:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x450Gfwc047702; Sun, 5 May 2019 00:16:41 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x450GP9E047687; Sun, 5 May 2019 00:16:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905050016.x450GP9E047687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 5 May 2019 00:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347136 - in vendor/sqlite3/dist: . tea tea/generic X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in vendor/sqlite3/dist: . tea tea/generic X-SVN-Commit-Revision: 347136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D1E176C15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 00:16:42 -0000 Author: cy Date: Sun May 5 00:16:24 2019 New Revision: 347136 URL: https://svnweb.freebsd.org/changeset/base/347136 Log: Import sqlite3-3.28.0 (3280000) Security: CVE-2019-9937, CVE-2019-9936 Modified: vendor/sqlite3/dist/Makefile.msc vendor/sqlite3/dist/configure vendor/sqlite3/dist/configure.ac vendor/sqlite3/dist/shell.c vendor/sqlite3/dist/sqlite3.c vendor/sqlite3/dist/sqlite3.h vendor/sqlite3/dist/sqlite3ext.h vendor/sqlite3/dist/tea/configure vendor/sqlite3/dist/tea/configure.ac vendor/sqlite3/dist/tea/generic/tclsqlite3.c Modified: vendor/sqlite3/dist/Makefile.msc ============================================================================== --- vendor/sqlite3/dist/Makefile.msc Sun May 5 00:15:30 2019 (r347135) +++ vendor/sqlite3/dist/Makefile.msc Sun May 5 00:16:24 2019 (r347136) @@ -433,9 +433,9 @@ UCRTLIBPATH = $(UCRTLIBPATH:\\=\) # will run on the platform that is doing the build. # !IF $(USE_FULLWARN)!=0 -BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS) +BCC = $(NCC) -nologo -W4 -Fd$*.pdb $(CCOPTS) $(BCCOPTS) !ELSE -BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS) +BCC = $(NCC) -nologo -W3 -Fd$*.pdb $(CCOPTS) $(BCCOPTS) !ENDIF # Check if assembly code listings should be generated for the source @@ -808,7 +808,7 @@ BCC = $(BCC) -Zi # Command line prefixes for compiling code, compiling resources, # linking, etc. # -LTCOMPILE = $(TCC) -Fo$@ +LTCOMPILE = $(TCC) -Fo$@ -Fd$*.pdb LTRCOMPILE = $(RCC) -r LTLIB = lib.exe LTLINK = $(TCC) -Fe$@ @@ -826,6 +826,11 @@ LTLIBS = $(LTLIBS) rpcrt4.lib !IFDEF PLATFORM LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM) LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM) +!ELSEIF "$(VISUALSTUDIOVERSION)"=="12.0" || \ + "$(VISUALSTUDIOVERSION)"=="14.0" || \ + "$(VISUALSTUDIOVERSION)"=="15.0" +LTLINKOPTS = /NOLOGO /MACHINE:x86 +LTLIBOPTS = /NOLOGO /MACHINE:x86 !ELSE LTLINKOPTS = /NOLOGO LTLIBOPTS = /NOLOGO Modified: vendor/sqlite3/dist/configure ============================================================================== --- vendor/sqlite3/dist/configure Sun May 5 00:15:30 2019 (r347135) +++ vendor/sqlite3/dist/configure Sun May 5 00:16:24 2019 (r347136) @@ -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.2. +# Generated by GNU Autoconf 2.69 for sqlite 3.28.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.27.2' -PACKAGE_STRING='sqlite 3.27.2' +PACKAGE_VERSION='3.28.0' +PACKAGE_STRING='sqlite 3.28.0' 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.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.28.0 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.2:";; + short | recursive ) echo "Configuration of sqlite 3.28.0:";; 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.2 +sqlite configure 3.28.0 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.2, which was +It was created by sqlite $as_me 3.28.0, 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.2' + VERSION='3.28.0' 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.2, which was +This file was extended by sqlite $as_me 3.28.0, 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.2 +sqlite config.status 3.28.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/sqlite3/dist/configure.ac ============================================================================== --- vendor/sqlite3/dist/configure.ac Sun May 5 00:15:30 2019 (r347135) +++ vendor/sqlite3/dist/configure.ac Sun May 5 00:16:24 2019 (r347136) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.27.2, http://www.sqlite.org) +AC_INIT(sqlite, 3.28.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: vendor/sqlite3/dist/shell.c ============================================================================== --- vendor/sqlite3/dist/shell.c Sun May 5 00:15:30 2019 (r347135) +++ vendor/sqlite3/dist/shell.c Sun May 5 00:16:24 2019 (r347136) @@ -2177,13 +2177,13 @@ static void readFileContents(sqlite3_context *ctx, con fclose(in); return; } - pBuf = sqlite3_malloc64( nIn ); + pBuf = sqlite3_malloc64( nIn ? nIn : 1 ); if( pBuf==0 ){ sqlite3_result_error_nomem(ctx); fclose(in); return; } - if( 1==fread(pBuf, nIn, 1, in) ){ + if( nIn==(sqlite3_int64)fread(pBuf, 1, (size_t)nIn, in) ){ sqlite3_result_blob64(ctx, pBuf, nIn, sqlite3_free); }else{ sqlite3_result_error_code(ctx, SQLITE_IOERR); @@ -2318,15 +2318,15 @@ static int fileLinkStat( ** Argument zFile is the name of a file that will be created and/or written ** by SQL function writefile(). This function ensures that the directory ** zFile will be written to exists, creating it if required. The permissions -** for any path components created by this function are set to (mode&0777). +** for any path components created by this function are set in accordance +** with the current umask. ** ** If an OOM condition is encountered, SQLITE_NOMEM is returned. Otherwise, ** SQLITE_OK is returned if the directory is successfully created, or ** SQLITE_ERROR otherwise. */ static int makeDirectory( - const char *zFile, - mode_t mode + const char *zFile ){ char *zCopy = sqlite3_mprintf("%s", zFile); int rc = SQLITE_OK; @@ -2347,7 +2347,7 @@ static int makeDirectory( rc2 = fileStat(zCopy, &sStat); if( rc2!=0 ){ - if( mkdir(zCopy, mode & 0777) ) rc = SQLITE_ERROR; + if( mkdir(zCopy, 0777) ) rc = SQLITE_ERROR; }else{ if( !S_ISDIR(sStat.st_mode) ) rc = SQLITE_ERROR; } @@ -2505,7 +2505,7 @@ static void writefileFunc( res = writeFile(context, zFile, argv[1], mode, mtime); if( res==1 && errno==ENOENT ){ - if( makeDirectory(zFile, mode)==SQLITE_OK ){ + if( makeDirectory(zFile)==SQLITE_OK ){ res = writeFile(context, zFile, argv[1], mode, mtime); } } @@ -10430,7 +10430,67 @@ static void restore_debug_trace_modes(void){ #endif } +/* Create the TEMP table used to store parameter bindings */ +static void bind_table_init(ShellState *p){ + int wrSchema = 0; + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); + sqlite3_exec(p->db, + "CREATE TABLE IF NOT EXISTS temp.sqlite_parameters(\n" + " key TEXT PRIMARY KEY,\n" + " value ANY\n" + ") WITHOUT ROWID;", + 0, 0, 0); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); +} + /* +** Bind parameters on a prepared statement. +** +** Parameter bindings are taken from a TEMP table of the form: +** +** CREATE TEMP TABLE sqlite_parameters(key TEXT PRIMARY KEY, value) +** WITHOUT ROWID; +** +** No bindings occur if this table does not exist. The special character '$' +** is included in the table name to help prevent collisions with actual tables. +** The table must be in the TEMP schema. +*/ +static void bind_prepared_stmt(ShellState *pArg, sqlite3_stmt *pStmt){ + int nVar; + int i; + int rc; + sqlite3_stmt *pQ = 0; + + nVar = sqlite3_bind_parameter_count(pStmt); + if( nVar==0 ) return; /* Nothing to do */ + if( sqlite3_table_column_metadata(pArg->db, "TEMP", "sqlite_parameters", + "key", 0, 0, 0, 0, 0)!=SQLITE_OK ){ + return; /* Parameter table does not exist */ + } + rc = sqlite3_prepare_v2(pArg->db, + "SELECT value FROM temp.sqlite_parameters" + " WHERE key=?1", -1, &pQ, 0); + if( rc || pQ==0 ) return; + for(i=1; i<=nVar; i++){ + char zNum[30]; + const char *zVar = sqlite3_bind_parameter_name(pStmt, i); + if( zVar==0 ){ + sqlite3_snprintf(sizeof(zNum),zNum,"?%d",i); + zVar = zNum; + } + sqlite3_bind_text(pQ, 1, zVar, -1, SQLITE_STATIC); + if( sqlite3_step(pQ)==SQLITE_ROW ){ + sqlite3_bind_value(pStmt, i, sqlite3_column_value(pQ, 0)); + }else{ + sqlite3_bind_null(pStmt, i); + } + sqlite3_reset(pQ); + } + sqlite3_finalize(pQ); +} + +/* ** Run a prepared statement */ static void exec_prepared_stmt( @@ -10682,7 +10742,7 @@ static int shell_exec( } /* Show the EXPLAIN QUERY PLAN if .eqp is on */ - if( pArg && pArg->autoEQP && sqlite3_strlike("EXPLAIN%",zStmtSql,0)!=0 ){ + if( pArg && pArg->autoEQP && sqlite3_stmt_isexplain(pStmt)==0 ){ sqlite3_stmt *pExplain; char *zEQP; int triggerEQP = 0; @@ -10731,13 +10791,10 @@ static int shell_exec( if( pArg ){ pArg->cMode = pArg->mode; if( pArg->autoExplain ){ - if( sqlite3_column_count(pStmt)==8 - && sqlite3_strlike("EXPLAIN%", zStmtSql,0)==0 - ){ + if( sqlite3_stmt_isexplain(pStmt)==1 ){ pArg->cMode = MODE_Explain; } - if( sqlite3_column_count(pStmt)==4 - && sqlite3_strlike("EXPLAIN QUERY PLAN%", zStmtSql,0)==0 ){ + if( sqlite3_stmt_isexplain(pStmt)==2 ){ pArg->cMode = MODE_EQP; } } @@ -10749,6 +10806,7 @@ static int shell_exec( } } + bind_prepared_stmt(pArg, pStmt); exec_prepared_stmt(pArg, pStmt); explain_data_delete(pArg); eqp_render(pArg); @@ -11078,7 +11136,8 @@ static const char *(azHelp[]) = { ".archive ... Manage SQL archives", " Each command must have exactly one of the following options:", " -c, --create Create a new archive", - " -u, --update Update or add files to an existing archive", + " -u, --update Add files or update files with changed mtime", + " -i, --insert Like -u but always add even if mtime unchanged", " -t, --list List contents of archive", " -x, --extract Extract files from archive", " Optional arguments:", @@ -11180,6 +11239,13 @@ static const char *(azHelp[]) = { " --zip FILE is a ZIP archive", ".output ?FILE? Send output to FILE or stdout if FILE is omitted", " If FILE begins with '|' then open it as a pipe.", + ".parameter CMD ... Manage SQL parameter bindings", + " clear Erase all bindings", + " init Initialize the TEMP table that holds bindings", + " list List the current parameter bindings", + " set PARAMETER VALUE Given SQL parameter PARAMETER a value of VALUE", + " PARAMETER should start with '$', ':', '@', or '?'", + " unset PARAMETER Remove PARAMETER from the binding table", ".print STRING... Print literal STRING", #ifndef SQLITE_OMIT_PROGRESS_CALLBACK ".progress N Invoke progress handler after every N opcodes", @@ -12392,7 +12458,7 @@ static int shell_dbinfo_command(ShellState *p, int nAr { "schema size:", "SELECT total(length(sql)) FROM %s" }, }; - int i; + int i, rc; unsigned iDataVersion; char *zSchemaTab; char *zDb = nArg>=2 ? azArg[1] : "main"; @@ -12400,8 +12466,19 @@ static int shell_dbinfo_command(ShellState *p, int nAr unsigned char aHdr[100]; open_db(p, 0); if( p->db==0 ) return 1; - sqlite3_prepare_v2(p->db,"SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1", - -1, &pStmt, 0); + rc = sqlite3_prepare_v2(p->db, + "SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1", + -1, &pStmt, 0); + if( rc ){ + if( !sqlite3_compileoption_used("ENABLE_DBPAGE_VTAB") ){ + utf8_printf(stderr, "the \".dbinfo\" command requires the " + "-DSQLITE_ENABLE_DBPAGE_VTAB compile-time options\n"); + }else{ + utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db)); + } + sqlite3_finalize(pStmt); + return 1; + } sqlite3_bind_text(pStmt, 1, zDb, -1, SQLITE_STATIC); if( sqlite3_step(pStmt)==SQLITE_ROW && sqlite3_column_bytes(pStmt,0)>100 @@ -12995,19 +13072,20 @@ static int arErrorMsg(ArCommand *pAr, const char *zFmt ** Values for ArCommand.eCmd. */ #define AR_CMD_CREATE 1 -#define AR_CMD_EXTRACT 2 -#define AR_CMD_LIST 3 -#define AR_CMD_UPDATE 4 -#define AR_CMD_HELP 5 +#define AR_CMD_UPDATE 2 +#define AR_CMD_INSERT 3 +#define AR_CMD_EXTRACT 4 +#define AR_CMD_LIST 5 +#define AR_CMD_HELP 6 /* ** Other (non-command) switches. */ -#define AR_SWITCH_VERBOSE 6 -#define AR_SWITCH_FILE 7 -#define AR_SWITCH_DIRECTORY 8 -#define AR_SWITCH_APPEND 9 -#define AR_SWITCH_DRYRUN 10 +#define AR_SWITCH_VERBOSE 7 +#define AR_SWITCH_FILE 8 +#define AR_SWITCH_DIRECTORY 9 +#define AR_SWITCH_APPEND 10 +#define AR_SWITCH_DRYRUN 11 static int arProcessSwitch(ArCommand *pAr, int eSwitch, const char *zArg){ switch( eSwitch ){ @@ -13015,6 +13093,7 @@ static int arProcessSwitch(ArCommand *pAr, int eSwitch case AR_CMD_EXTRACT: case AR_CMD_LIST: case AR_CMD_UPDATE: + case AR_CMD_INSERT: case AR_CMD_HELP: if( pAr->eCmd ){ return arErrorMsg(pAr, "multiple command options"); @@ -13061,6 +13140,7 @@ static int arParseCommand( } aSwitch[] = { { "create", 'c', AR_CMD_CREATE, 0 }, { "extract", 'x', AR_CMD_EXTRACT, 0 }, + { "insert", 'i', AR_CMD_INSERT, 0 }, { "list", 't', AR_CMD_LIST, 0 }, { "update", 'u', AR_CMD_UPDATE, 0 }, { "help", 'h', AR_CMD_HELP, 0 }, @@ -13396,19 +13476,27 @@ static int arExecSql(ArCommand *pAr, const char *zSql) /* -** Implementation of .ar "create" and "update" commands. +** Implementation of .ar "create", "insert", and "update" commands. ** +** create -> Create a new SQL archive +** insert -> Insert or reinsert all files listed +** update -> Insert files that have changed or that were not +** previously in the archive +** ** Create the "sqlar" table in the database if it does not already exist. ** Then add each file in the azFile[] array to the archive. Directories ** are added recursively. If argument bVerbose is non-zero, a message is ** printed on stdout for each file archived. ** ** The create command is the same as update, except that it drops -** any existing "sqlar" table before beginning. +** any existing "sqlar" table before beginning. The "insert" command +** always overwrites every file named on the command-line, where as +** "update" only overwrites if the size or mtime or mode has changed. */ static int arCreateOrUpdateCommand( ArCommand *pAr, /* Command arguments and options */ - int bUpdate /* true for a --create. false for --update */ + int bUpdate, /* true for a --create. */ + int bOnlyIfChanged /* Only update if file has changed */ ){ const char *zCreate = "CREATE TABLE IF NOT EXISTS sqlar(\n" @@ -13430,22 +13518,24 @@ static int arCreateOrUpdateCommand( " WHEN 'd' THEN 0\n" " ELSE -1 END,\n" " sqlar_compress(data)\n" - " FROM fsdir(%Q,%Q)\n" - " WHERE lsmode(mode) NOT LIKE '?%%';", + " FROM fsdir(%Q,%Q) AS disk\n" + " WHERE lsmode(mode) NOT LIKE '?%%'%s;" + , "REPLACE INTO %s(name,mode,mtime,data)\n" " SELECT\n" " %s,\n" " mode,\n" " mtime,\n" " data\n" - " FROM fsdir(%Q,%Q)\n" - " WHERE lsmode(mode) NOT LIKE '?%%';" + " FROM fsdir(%Q,%Q) AS disk\n" + " WHERE lsmode(mode) NOT LIKE '?%%'%s;" }; int i; /* For iterating through azFile[] */ int rc; /* Return code */ const char *zTab = 0; /* SQL table into which to insert */ char *zSql; char zTemp[50]; + char *zExists = 0; arExecSql(pAr, "PRAGMA page_size=512"); rc = arExecSql(pAr, "SAVEPOINT ar;"); @@ -13476,10 +13566,21 @@ static int arCreateOrUpdateCommand( } rc = arExecSql(pAr, zCreate); } + if( bOnlyIfChanged ){ + zExists = sqlite3_mprintf( + " AND NOT EXISTS(" + "SELECT 1 FROM %s AS mem" + " WHERE mem.name=disk.name" + " AND mem.mtime=disk.mtime" + " AND mem.mode=disk.mode)", zTab); + }else{ + zExists = sqlite3_mprintf(""); + } + if( zExists==0 ) rc = SQLITE_NOMEM; for(i=0; inArg && rc==SQLITE_OK; i++){ char *zSql2 = sqlite3_mprintf(zInsertFmt[pAr->bZip], zTab, pAr->bVerbose ? "shell_putsnl(name)" : "name", - pAr->azArg[i], pAr->zDir); + pAr->azArg[i], pAr->zDir, zExists); rc = arExecSql(pAr, zSql2); sqlite3_free(zSql2); } @@ -13494,6 +13595,7 @@ end_ar_transaction: sqlite3_free(zSql); } } + sqlite3_free(zExists); return rc; } @@ -13532,7 +13634,8 @@ static int arDotCommand( }else if( cmd.zFile ){ int flags; if( cmd.bAppend ) eDbType = SHELL_OPEN_APPENDVFS; - if( cmd.eCmd==AR_CMD_CREATE || cmd.eCmd==AR_CMD_UPDATE ){ + if( cmd.eCmd==AR_CMD_CREATE || cmd.eCmd==AR_CMD_INSERT + || cmd.eCmd==AR_CMD_UPDATE ){ flags = SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE; }else{ flags = SQLITE_OPEN_READONLY; @@ -13569,7 +13672,7 @@ static int arDotCommand( switch( cmd.eCmd ){ case AR_CMD_CREATE: - rc = arCreateOrUpdateCommand(&cmd, 0); + rc = arCreateOrUpdateCommand(&cmd, 0, 0); break; case AR_CMD_EXTRACT: @@ -13584,9 +13687,13 @@ static int arDotCommand( arUsage(pState->out); break; + case AR_CMD_INSERT: + rc = arCreateOrUpdateCommand(&cmd, 1, 0); + break; + default: assert( cmd.eCmd==AR_CMD_UPDATE ); - rc = arCreateOrUpdateCommand(&cmd, 1); + rc = arCreateOrUpdateCommand(&cmd, 1, 1); break; } } @@ -14709,6 +14816,114 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", zFile); } } + }else + + if( c=='p' && n>=3 && strncmp(azArg[0], "parameter", n)==0 ){ + open_db(p,0); + if( nArg<=1 ) goto parameter_syntax_error; + + /* .parameter clear + ** Clear all bind parameters by dropping the TEMP table that holds them. + */ + if( nArg==2 && strcmp(azArg[1],"clear")==0 ){ + int wrSchema = 0; + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); + sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp.sqlite_parameters;", + 0, 0, 0); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); + }else + + /* .parameter list + ** List all bind parameters. + */ + if( nArg==2 && strcmp(azArg[1],"list")==0 ){ + sqlite3_stmt *pStmt = 0; + int rx; + int len = 0; + rx = sqlite3_prepare_v2(p->db, + "SELECT max(length(key)) " + "FROM temp.sqlite_parameters;", -1, &pStmt, 0); + if( rx==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ + len = sqlite3_column_int(pStmt, 0); + if( len>40 ) len = 40; + } + sqlite3_finalize(pStmt); + pStmt = 0; + if( len ){ + rx = sqlite3_prepare_v2(p->db, + "SELECT key, quote(value) " + "FROM temp.sqlite_parameters;", -1, &pStmt, 0); + while( sqlite3_step(pStmt)==SQLITE_ROW ){ + utf8_printf(p->out, "%-*s %s\n", len, sqlite3_column_text(pStmt,0), + sqlite3_column_text(pStmt,1)); + } + sqlite3_finalize(pStmt); + } + }else + + /* .parameter init + ** Make sure the TEMP table used to hold bind parameters exists. + ** Create it if necessary. + */ + if( nArg==2 && strcmp(azArg[1],"init")==0 ){ + bind_table_init(p); + }else + + /* .parameter set NAME VALUE + ** Set or reset a bind parameter. NAME should be the full parameter + ** name exactly as it appears in the query. (ex: $abc, @def). The + ** VALUE can be in either SQL literal notation, or if not it will be + ** understood to be a text string. + */ + if( nArg==4 && strcmp(azArg[1],"set")==0 ){ + int rx; + char *zSql; + sqlite3_stmt *pStmt; + const char *zKey = azArg[2]; + const char *zValue = azArg[3]; + bind_table_init(p); + zSql = sqlite3_mprintf( + "REPLACE INTO temp.sqlite_parameters(key,value)" + "VALUES(%Q,%s);", zKey, zValue); + if( zSql==0 ) shell_out_of_memory(); + pStmt = 0; + rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); + sqlite3_free(zSql); + if( rx!=SQLITE_OK ){ + sqlite3_finalize(pStmt); + pStmt = 0; + zSql = sqlite3_mprintf( + "REPLACE INTO temp.sqlite_parameters(key,value)" + "VALUES(%Q,%Q);", zKey, zValue); + if( zSql==0 ) shell_out_of_memory(); + rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); + sqlite3_free(zSql); + if( rx!=SQLITE_OK ){ + utf8_printf(p->out, "Error: %s\n", sqlite3_errmsg(p->db)); + sqlite3_finalize(pStmt); + pStmt = 0; + rc = 1; + } + } + sqlite3_step(pStmt); + sqlite3_finalize(pStmt); + }else + + /* .parameter unset NAME + ** Remove the NAME binding from the parameter binding table, if it + ** exists. + */ + if( nArg==3 && strcmp(azArg[1],"unset")==0 ){ + char *zSql = sqlite3_mprintf( + "DELETE FROM temp.sqlite_parameters WHERE key=%Q", azArg[2]); + if( zSql==0 ) shell_out_of_memory(); + sqlite3_exec(p->db, zSql, 0, 0, 0); + sqlite3_free(zSql); + }else + /* If no command name matches, show a syntax error */ + parameter_syntax_error: + showHelp(p->out, "parameter"); }else if( c=='p' && n>=3 && strncmp(azArg[0], "print", n)==0 ){ Modified: vendor/sqlite3/dist/sqlite3.c ============================================================================== --- vendor/sqlite3/dist/sqlite3.c Sun May 5 00:15:30 2019 (r347135) +++ vendor/sqlite3/dist/sqlite3.c Sun May 5 00:16:24 2019 (r347136) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.27.2. By combining all the individual C code files into this +** version 3.28.0. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1162,9 +1162,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.27.2" -#define SQLITE_VERSION_NUMBER 3027002 -#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7" +#define SQLITE_VERSION "3.28.0" +#define SQLITE_VERSION_NUMBER 3028000 +#define SQLITE_SOURCE_ID "2019-04-16 19:49:53 884b4b7e502b4e991677b53971277adfaf0a04a284f8e483e2553d0f83156b50" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1228,6 +1228,9 @@ SQLITE_API int sqlite3_libversion_number(void); #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS SQLITE_API int sqlite3_compileoption_used(const char *zOptName); SQLITE_API const char *sqlite3_compileoption_get(int N); +#else +# define sqlite3_compileoption_used(X) 0 +# define sqlite3_compileoption_get(X) ((void*)0) #endif /* @@ -3125,8 +3128,8 @@ struct sqlite3_mem_methods { ** ** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]] **
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
-**
^This option is used to enable or disable the two-argument -** version of the [fts3_tokenizer()] function which is part of the +**
^This option is used to enable or disable the +** [fts3_tokenizer()] function which is part of the ** [FTS3] full-text search engine extension. ** There should be two additional arguments. ** The first argument is an integer which is 0 to disable fts3_tokenizer() or @@ -3238,6 +3241,17 @@ struct sqlite3_mem_methods { **
  • Direct writes to [shadow tables]. ** **
  • +** +** [[SQLITE_DBCONFIG_WRITABLE_SCHEMA]]
    SQLITE_DBCONFIG_WRITABLE_SCHEMA
    +**
    The SQLITE_DBCONFIG_WRITABLE_SCHEMA option activates or deactivates the +** "writable_schema" flag. This has the same effect and is logically equivalent +** to setting [PRAGMA writable_schema=ON] or [PRAGMA writable_schema=OFF]. +** The first argument to this setting is an integer which is 0 to disable +** the writable_schema, positive to enable writable_schema, or negative to +** leave the setting unchanged. The second parameter is a pointer to an +** integer into which is written 0 or 1 to indicate whether the writable_schema +** is enabled or disabled following this call. +**
    ** */ #define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ @@ -3251,7 +3265,8 @@ struct sqlite3_mem_methods { #define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */ #define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */ #define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */ -#define SQLITE_DBCONFIG_MAX 1010 /* Largest DBCONFIG */ +#define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */ +#define SQLITE_DBCONFIG_MAX 1011 /* Largest DBCONFIG */ /* ** CAPI3REF: Enable Or Disable Extended Result Codes @@ -4934,6 +4949,18 @@ SQLITE_API const char *sqlite3_normalized_sql(sqlite3_ SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); /* +** CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement +** METHOD: sqlite3_stmt +** +** ^The sqlite3_stmt_isexplain(S) interface returns 1 if the +** prepared statement S is an EXPLAIN statement, or 2 if the +** statement S is an EXPLAIN QUERY PLAN. +** ^The sqlite3_stmt_isexplain(S) interface returns 0 if S is +** an ordinary statement or a NULL pointer. +*/ +SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt); + +/* ** CAPI3REF: Determine If A Prepared Statement Has Been Reset ** METHOD: sqlite3_stmt ** @@ -5072,7 +5099,9 @@ typedef struct sqlite3_context sqlite3_context; ** ^The fifth argument to the BLOB and string binding interfaces ** is a destructor used to dispose of the BLOB or ** string after SQLite has finished with it. ^The destructor is called -** to dispose of the BLOB or string even if the call to bind API fails. +** to dispose of the BLOB or string even if the call to the bind API fails, +** except the destructor is not called if the third parameter is a NULL +** pointer or the fourth parameter is negative. ** ^If the fifth argument is ** the special value [SQLITE_STATIC], then SQLite assumes that the ** information is in static, unmanaged space and does not need to be freed. @@ -5989,6 +6018,8 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm( ** sqlite3_value_nochange   ** →  True if the column is unchanged in an UPDATE ** against a virtual table. +** sqlite3_value_frombind   +** →  True if value originated from a [bound parameter] ** ** ** Details: @@ -6050,6 +6081,11 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm( ** than within an [xUpdate] method call for an UPDATE statement, then ** the return value is arbitrary and meaningless. ** +** ^The sqlite3_value_frombind(X) interface returns non-zero if the +** value X originated from one of the [sqlite3_bind_int|sqlite3_bind()] +** interfaces. ^If X comes from an SQL literal value, or a table column, +** and expression, then sqlite3_value_frombind(X) returns zero. +** ** Please pay particular attention to the fact that the pointer returned ** from [sqlite3_value_blob()], [sqlite3_value_text()], or ** [sqlite3_value_text16()] can be invalidated by a subsequent call to @@ -6095,6 +6131,7 @@ SQLITE_API int sqlite3_value_bytes16(sqlite3_value*); SQLITE_API int sqlite3_value_type(sqlite3_value*); SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*); SQLITE_API int sqlite3_value_nochange(sqlite3_value*); +SQLITE_API int sqlite3_value_frombind(sqlite3_value*); /* ** CAPI3REF: Finding The Subtype Of SQL Values @@ -6830,7 +6867,7 @@ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); ** associated with database N of connection D. ^The main database file ** has the name "main". If there is no attached database N on the database ** connection D, or if database N is a temporary or in-memory database, then -** a NULL pointer is returned. +** this function will return either a NULL pointer or an empty string. ** ** ^The filename returned by this function is the output of the ** xFullPathname method of the [VFS]. ^In other words, the filename @@ -11931,7 +11968,7 @@ SQLITE_API int sqlite3rebaser_configure( ** in size. This function allocates and populates a buffer with a copy ** of the changeset rebased rebased according to the configuration of the ** rebaser object passed as the first argument. If successful, (*ppOut) -** is set to point to the new buffer containing the rebased changset and +** is set to point to the new buffer containing the rebased changeset and ** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the ** responsibility of the caller to eventually free the new buffer using ** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut) @@ -12340,7 +12377,7 @@ struct Fts5PhraseIter { ** Save the pointer passed as the second argument as the extension functions ** "auxiliary data". The pointer may then be retrieved by the current or any ** future invocation of the same fts5 extension function made as part of -** of the same MATCH query using the xGetAuxdata() API. +** the same MATCH query using the xGetAuxdata() API. ** ** Each extension function is allocated a single auxiliary data slot for ** each FTS query (MATCH expression). If the extension function is invoked @@ -12355,7 +12392,7 @@ struct Fts5PhraseIter { ** The xDelete callback, if one is specified, is also invoked on the ** auxiliary data pointer after the FTS5 query has finished. ** -** If an error (e.g. an OOM condition) occurs within this function, an +** If an error (e.g. an OOM condition) occurs within this function, ** the auxiliary data is set to NULL and an error code returned. If the ** xDelete parameter was not NULL, it is invoked on the auxiliary data ** pointer before returning. @@ -13381,7 +13418,7 @@ struct Hash { unsigned int count; /* Number of entries in this table */ HashElem *first; /* The first element of the array */ struct _ht { /* the hash table */ - int count; /* Number of entries with this hash */ + unsigned int count; /* Number of entries with this hash */ HashElem *chain; /* Pointer to first entry with this hash */ } *ht; }; @@ -13522,100 +13559,95 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*); #define TK_PRECEDING 85 #define TK_RANGE 86 #define TK_UNBOUNDED 87 -#define TK_REINDEX 88 -#define TK_RENAME 89 -#define TK_CTIME_KW 90 -#define TK_ANY 91 -#define TK_BITAND 92 -#define TK_BITOR 93 -#define TK_LSHIFT 94 -#define TK_RSHIFT 95 -#define TK_PLUS 96 -#define TK_MINUS 97 -#define TK_STAR 98 -#define TK_SLASH 99 -#define TK_REM 100 -#define TK_CONCAT 101 -#define TK_COLLATE 102 -#define TK_BITNOT 103 -#define TK_ON 104 -#define TK_INDEXED 105 -#define TK_STRING 106 -#define TK_JOIN_KW 107 -#define TK_CONSTRAINT 108 -#define TK_DEFAULT 109 -#define TK_NULL 110 -#define TK_PRIMARY 111 -#define TK_UNIQUE 112 -#define TK_CHECK 113 -#define TK_REFERENCES 114 -#define TK_AUTOINCR 115 -#define TK_INSERT 116 -#define TK_DELETE 117 -#define TK_UPDATE 118 -#define TK_SET 119 -#define TK_DEFERRABLE 120 -#define TK_FOREIGN 121 -#define TK_DROP 122 -#define TK_UNION 123 -#define TK_ALL 124 -#define TK_EXCEPT 125 -#define TK_INTERSECT 126 -#define TK_SELECT 127 -#define TK_VALUES 128 -#define TK_DISTINCT 129 -#define TK_DOT 130 -#define TK_FROM 131 -#define TK_JOIN 132 -#define TK_USING 133 -#define TK_ORDER 134 -#define TK_GROUP 135 -#define TK_HAVING 136 -#define TK_LIMIT 137 -#define TK_WHERE 138 -#define TK_INTO 139 -#define TK_NOTHING 140 -#define TK_FLOAT 141 -#define TK_BLOB 142 -#define TK_INTEGER 143 -#define TK_VARIABLE 144 -#define TK_CASE 145 -#define TK_WHEN 146 -#define TK_THEN 147 -#define TK_ELSE 148 -#define TK_INDEX 149 -#define TK_ALTER 150 -#define TK_ADD 151 -#define TK_WINDOW 152 -#define TK_OVER 153 -#define TK_FILTER 154 -#define TK_TRUEFALSE 155 -#define TK_ISNOT 156 -#define TK_FUNCTION 157 -#define TK_COLUMN 158 -#define TK_AGG_FUNCTION 159 -#define TK_AGG_COLUMN 160 -#define TK_UMINUS 161 -#define TK_UPLUS 162 -#define TK_TRUTH 163 -#define TK_REGISTER 164 -#define TK_VECTOR 165 -#define TK_SELECT_COLUMN 166 -#define TK_IF_NULL_ROW 167 -#define TK_ASTERISK 168 -#define TK_SPAN 169 -#define TK_END_OF_FILE 170 -#define TK_UNCLOSED_STRING 171 -#define TK_SPACE 172 -#define TK_ILLEGAL 173 +#define TK_EXCLUDE 88 +#define TK_GROUPS 89 +#define TK_OTHERS 90 +#define TK_TIES 91 +#define TK_REINDEX 92 +#define TK_RENAME 93 +#define TK_CTIME_KW 94 +#define TK_ANY 95 +#define TK_BITAND 96 +#define TK_BITOR 97 +#define TK_LSHIFT 98 +#define TK_RSHIFT 99 +#define TK_PLUS 100 +#define TK_MINUS 101 +#define TK_STAR 102 +#define TK_SLASH 103 +#define TK_REM 104 +#define TK_CONCAT 105 +#define TK_COLLATE 106 +#define TK_BITNOT 107 +#define TK_ON 108 +#define TK_INDEXED 109 +#define TK_STRING 110 +#define TK_JOIN_KW 111 +#define TK_CONSTRAINT 112 +#define TK_DEFAULT 113 +#define TK_NULL 114 +#define TK_PRIMARY 115 +#define TK_UNIQUE 116 +#define TK_CHECK 117 +#define TK_REFERENCES 118 +#define TK_AUTOINCR 119 +#define TK_INSERT 120 +#define TK_DELETE 121 +#define TK_UPDATE 122 +#define TK_SET 123 +#define TK_DEFERRABLE 124 +#define TK_FOREIGN 125 +#define TK_DROP 126 +#define TK_UNION 127 +#define TK_ALL 128 +#define TK_EXCEPT 129 +#define TK_INTERSECT 130 +#define TK_SELECT 131 +#define TK_VALUES 132 +#define TK_DISTINCT 133 +#define TK_DOT 134 +#define TK_FROM 135 +#define TK_JOIN 136 +#define TK_USING 137 +#define TK_ORDER 138 +#define TK_GROUP 139 +#define TK_HAVING 140 +#define TK_LIMIT 141 +#define TK_WHERE 142 +#define TK_INTO 143 +#define TK_NOTHING 144 +#define TK_FLOAT 145 +#define TK_BLOB 146 +#define TK_INTEGER 147 +#define TK_VARIABLE 148 +#define TK_CASE 149 +#define TK_WHEN 150 +#define TK_THEN 151 +#define TK_ELSE 152 +#define TK_INDEX 153 +#define TK_ALTER 154 +#define TK_ADD 155 +#define TK_WINDOW 156 +#define TK_OVER 157 +#define TK_FILTER 158 +#define TK_TRUEFALSE 159 +#define TK_ISNOT 160 +#define TK_FUNCTION 161 +#define TK_COLUMN 162 +#define TK_AGG_FUNCTION 163 +#define TK_AGG_COLUMN 164 +#define TK_UMINUS 165 +#define TK_UPLUS 166 +#define TK_TRUTH 167 +#define TK_REGISTER 168 +#define TK_VECTOR 169 +#define TK_SELECT_COLUMN 170 +#define TK_IF_NULL_ROW 171 +#define TK_ASTERISK 172 +#define TK_SPAN 173 +#define TK_SPACE 174 +#define TK_ILLEGAL 175 -/* The token codes above must all fit in 8 bits */ -#define TKFLG_MASK 0xff - -/* Flags that can be added to a token code when it is not -** being stored in a u8: */ -#define TKFLG_DONTFOLD 0x100 /* Omit constant folding optimizations */ - /************** End of parse.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ #include @@ -14546,9 +14578,6 @@ struct BtreePayload { SQLITE_PRIVATE int sqlite3BtreeInsert(BtCursor*, const BtreePayload *pPayload, int flags, int seekResult); SQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor*, int *pRes); -#ifndef SQLITE_OMIT_WINDOWFUNC -SQLITE_PRIVATE void sqlite3BtreeSkipNext(BtCursor*); -#endif SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor*, int *pRes); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun May 5 00:20:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E9E2159CDD2; Sun, 5 May 2019 00:20:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3296D76D85; Sun, 5 May 2019 00:20:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD0BBFDEC; Sun, 5 May 2019 00:20:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x450KjLr048653; Sun, 5 May 2019 00:20:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x450Kj1O048652; Sun, 5 May 2019 00:20:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905050020.x450Kj1O048652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 5 May 2019 00:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347137 - vendor/sqlite3/sqlite-3280000 X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: vendor/sqlite3/sqlite-3280000 X-SVN-Commit-Revision: 347137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3296D76D85 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 00:20:46 -0000 Author: cy Date: Sun May 5 00:20:45 2019 New Revision: 347137 URL: https://svnweb.freebsd.org/changeset/base/347137 Log: Tag import of sqlite3-3.28.0 (3280000) Added: vendor/sqlite3/sqlite-3280000/ - copied from r347136, vendor/sqlite3/dist/ From owner-svn-src-all@freebsd.org Sun May 5 00:21:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7675159CF75; Sun, 5 May 2019 00:21:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F28476F86; Sun, 5 May 2019 00:21:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29E78FE4E; Sun, 5 May 2019 00:21:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x450LvFL052525; Sun, 5 May 2019 00:21:57 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x450Lvkg052524; Sun, 5 May 2019 00:21:57 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905050021.x450Lvkg052524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 5 May 2019 00:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r347138 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: cy X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 347138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F28476F86 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 00:21:57 -0000 Author: cy Date: Sun May 5 00:21:56 2019 New Revision: 347138 URL: https://svnweb.freebsd.org/changeset/base/347138 Log: sqlite3 3.28.0 import into the vendor branch is now complete. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Sun May 5 00:20:45 2019 (r347137) +++ svnadmin/conf/sizelimit.conf Sun May 5 00:21:56 2019 (r347138) @@ -16,7 +16,6 @@ # First field is username, second field is the raised limit required. achim bapt -cy davidcs dim 20480000 imp From owner-svn-src-all@freebsd.org Sun May 5 04:14:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C92715A226D; Sun, 5 May 2019 04:14:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C34F18529F; Sun, 5 May 2019 04:14:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EE2F1A6DF; Sun, 5 May 2019 04:14:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x454EXSZ073357; Sun, 5 May 2019 04:14:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x454EI7a073346; Sun, 5 May 2019 04:14:18 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905050414.x454EI7a073346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 5 May 2019 04:14:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347139 - in head/contrib/sqlite3: . tea tea/generic X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/contrib/sqlite3: . tea tea/generic X-SVN-Commit-Revision: 347139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C34F18529F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 04:14:34 -0000 Author: cy Date: Sun May 5 04:14:17 2019 New Revision: 347139 URL: https://svnweb.freebsd.org/changeset/base/347139 Log: MFV r347136: Update sqlite3-3.27.2 (3270200) --> sqlite3-3.28.0 (3280000) MFC after: 3 days Security: CVE-2019-9937, CVE-2019-9936 Modified: head/contrib/sqlite3/Makefile.msc head/contrib/sqlite3/configure head/contrib/sqlite3/configure.ac head/contrib/sqlite3/shell.c head/contrib/sqlite3/sqlite3.c head/contrib/sqlite3/sqlite3.h head/contrib/sqlite3/sqlite3ext.h head/contrib/sqlite3/tea/configure head/contrib/sqlite3/tea/configure.ac head/contrib/sqlite3/tea/generic/tclsqlite3.c Directory Properties: head/contrib/sqlite3/ (props changed) Modified: head/contrib/sqlite3/Makefile.msc ============================================================================== --- head/contrib/sqlite3/Makefile.msc Sun May 5 00:21:56 2019 (r347138) +++ head/contrib/sqlite3/Makefile.msc Sun May 5 04:14:17 2019 (r347139) @@ -433,9 +433,9 @@ UCRTLIBPATH = $(UCRTLIBPATH:\\=\) # will run on the platform that is doing the build. # !IF $(USE_FULLWARN)!=0 -BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS) +BCC = $(NCC) -nologo -W4 -Fd$*.pdb $(CCOPTS) $(BCCOPTS) !ELSE -BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS) +BCC = $(NCC) -nologo -W3 -Fd$*.pdb $(CCOPTS) $(BCCOPTS) !ENDIF # Check if assembly code listings should be generated for the source @@ -808,7 +808,7 @@ BCC = $(BCC) -Zi # Command line prefixes for compiling code, compiling resources, # linking, etc. # -LTCOMPILE = $(TCC) -Fo$@ +LTCOMPILE = $(TCC) -Fo$@ -Fd$*.pdb LTRCOMPILE = $(RCC) -r LTLIB = lib.exe LTLINK = $(TCC) -Fe$@ @@ -826,6 +826,11 @@ LTLIBS = $(LTLIBS) rpcrt4.lib !IFDEF PLATFORM LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM) LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM) +!ELSEIF "$(VISUALSTUDIOVERSION)"=="12.0" || \ + "$(VISUALSTUDIOVERSION)"=="14.0" || \ + "$(VISUALSTUDIOVERSION)"=="15.0" +LTLINKOPTS = /NOLOGO /MACHINE:x86 +LTLIBOPTS = /NOLOGO /MACHINE:x86 !ELSE LTLINKOPTS = /NOLOGO LTLIBOPTS = /NOLOGO Modified: head/contrib/sqlite3/configure ============================================================================== --- head/contrib/sqlite3/configure Sun May 5 00:21:56 2019 (r347138) +++ head/contrib/sqlite3/configure Sun May 5 04:14:17 2019 (r347139) @@ -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.2. +# Generated by GNU Autoconf 2.69 for sqlite 3.28.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.27.2' -PACKAGE_STRING='sqlite 3.27.2' +PACKAGE_VERSION='3.28.0' +PACKAGE_STRING='sqlite 3.28.0' 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.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.28.0 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.2:";; + short | recursive ) echo "Configuration of sqlite 3.28.0:";; 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.2 +sqlite configure 3.28.0 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.2, which was +It was created by sqlite $as_me 3.28.0, 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.2' + VERSION='3.28.0' 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.2, which was +This file was extended by sqlite $as_me 3.28.0, 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.2 +sqlite config.status 3.28.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/sqlite3/configure.ac ============================================================================== --- head/contrib/sqlite3/configure.ac Sun May 5 00:21:56 2019 (r347138) +++ head/contrib/sqlite3/configure.ac Sun May 5 04:14:17 2019 (r347139) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.27.2, http://www.sqlite.org) +AC_INIT(sqlite, 3.28.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: head/contrib/sqlite3/shell.c ============================================================================== --- head/contrib/sqlite3/shell.c Sun May 5 00:21:56 2019 (r347138) +++ head/contrib/sqlite3/shell.c Sun May 5 04:14:17 2019 (r347139) @@ -2177,13 +2177,13 @@ static void readFileContents(sqlite3_context *ctx, con fclose(in); return; } - pBuf = sqlite3_malloc64( nIn ); + pBuf = sqlite3_malloc64( nIn ? nIn : 1 ); if( pBuf==0 ){ sqlite3_result_error_nomem(ctx); fclose(in); return; } - if( 1==fread(pBuf, nIn, 1, in) ){ + if( nIn==(sqlite3_int64)fread(pBuf, 1, (size_t)nIn, in) ){ sqlite3_result_blob64(ctx, pBuf, nIn, sqlite3_free); }else{ sqlite3_result_error_code(ctx, SQLITE_IOERR); @@ -2318,15 +2318,15 @@ static int fileLinkStat( ** Argument zFile is the name of a file that will be created and/or written ** by SQL function writefile(). This function ensures that the directory ** zFile will be written to exists, creating it if required. The permissions -** for any path components created by this function are set to (mode&0777). +** for any path components created by this function are set in accordance +** with the current umask. ** ** If an OOM condition is encountered, SQLITE_NOMEM is returned. Otherwise, ** SQLITE_OK is returned if the directory is successfully created, or ** SQLITE_ERROR otherwise. */ static int makeDirectory( - const char *zFile, - mode_t mode + const char *zFile ){ char *zCopy = sqlite3_mprintf("%s", zFile); int rc = SQLITE_OK; @@ -2347,7 +2347,7 @@ static int makeDirectory( rc2 = fileStat(zCopy, &sStat); if( rc2!=0 ){ - if( mkdir(zCopy, mode & 0777) ) rc = SQLITE_ERROR; + if( mkdir(zCopy, 0777) ) rc = SQLITE_ERROR; }else{ if( !S_ISDIR(sStat.st_mode) ) rc = SQLITE_ERROR; } @@ -2505,7 +2505,7 @@ static void writefileFunc( res = writeFile(context, zFile, argv[1], mode, mtime); if( res==1 && errno==ENOENT ){ - if( makeDirectory(zFile, mode)==SQLITE_OK ){ + if( makeDirectory(zFile)==SQLITE_OK ){ res = writeFile(context, zFile, argv[1], mode, mtime); } } @@ -10430,7 +10430,67 @@ static void restore_debug_trace_modes(void){ #endif } +/* Create the TEMP table used to store parameter bindings */ +static void bind_table_init(ShellState *p){ + int wrSchema = 0; + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); + sqlite3_exec(p->db, + "CREATE TABLE IF NOT EXISTS temp.sqlite_parameters(\n" + " key TEXT PRIMARY KEY,\n" + " value ANY\n" + ") WITHOUT ROWID;", + 0, 0, 0); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); +} + /* +** Bind parameters on a prepared statement. +** +** Parameter bindings are taken from a TEMP table of the form: +** +** CREATE TEMP TABLE sqlite_parameters(key TEXT PRIMARY KEY, value) +** WITHOUT ROWID; +** +** No bindings occur if this table does not exist. The special character '$' +** is included in the table name to help prevent collisions with actual tables. +** The table must be in the TEMP schema. +*/ +static void bind_prepared_stmt(ShellState *pArg, sqlite3_stmt *pStmt){ + int nVar; + int i; + int rc; + sqlite3_stmt *pQ = 0; + + nVar = sqlite3_bind_parameter_count(pStmt); + if( nVar==0 ) return; /* Nothing to do */ + if( sqlite3_table_column_metadata(pArg->db, "TEMP", "sqlite_parameters", + "key", 0, 0, 0, 0, 0)!=SQLITE_OK ){ + return; /* Parameter table does not exist */ + } + rc = sqlite3_prepare_v2(pArg->db, + "SELECT value FROM temp.sqlite_parameters" + " WHERE key=?1", -1, &pQ, 0); + if( rc || pQ==0 ) return; + for(i=1; i<=nVar; i++){ + char zNum[30]; + const char *zVar = sqlite3_bind_parameter_name(pStmt, i); + if( zVar==0 ){ + sqlite3_snprintf(sizeof(zNum),zNum,"?%d",i); + zVar = zNum; + } + sqlite3_bind_text(pQ, 1, zVar, -1, SQLITE_STATIC); + if( sqlite3_step(pQ)==SQLITE_ROW ){ + sqlite3_bind_value(pStmt, i, sqlite3_column_value(pQ, 0)); + }else{ + sqlite3_bind_null(pStmt, i); + } + sqlite3_reset(pQ); + } + sqlite3_finalize(pQ); +} + +/* ** Run a prepared statement */ static void exec_prepared_stmt( @@ -10682,7 +10742,7 @@ static int shell_exec( } /* Show the EXPLAIN QUERY PLAN if .eqp is on */ - if( pArg && pArg->autoEQP && sqlite3_strlike("EXPLAIN%",zStmtSql,0)!=0 ){ + if( pArg && pArg->autoEQP && sqlite3_stmt_isexplain(pStmt)==0 ){ sqlite3_stmt *pExplain; char *zEQP; int triggerEQP = 0; @@ -10731,13 +10791,10 @@ static int shell_exec( if( pArg ){ pArg->cMode = pArg->mode; if( pArg->autoExplain ){ - if( sqlite3_column_count(pStmt)==8 - && sqlite3_strlike("EXPLAIN%", zStmtSql,0)==0 - ){ + if( sqlite3_stmt_isexplain(pStmt)==1 ){ pArg->cMode = MODE_Explain; } - if( sqlite3_column_count(pStmt)==4 - && sqlite3_strlike("EXPLAIN QUERY PLAN%", zStmtSql,0)==0 ){ + if( sqlite3_stmt_isexplain(pStmt)==2 ){ pArg->cMode = MODE_EQP; } } @@ -10749,6 +10806,7 @@ static int shell_exec( } } + bind_prepared_stmt(pArg, pStmt); exec_prepared_stmt(pArg, pStmt); explain_data_delete(pArg); eqp_render(pArg); @@ -11078,7 +11136,8 @@ static const char *(azHelp[]) = { ".archive ... Manage SQL archives", " Each command must have exactly one of the following options:", " -c, --create Create a new archive", - " -u, --update Update or add files to an existing archive", + " -u, --update Add files or update files with changed mtime", + " -i, --insert Like -u but always add even if mtime unchanged", " -t, --list List contents of archive", " -x, --extract Extract files from archive", " Optional arguments:", @@ -11180,6 +11239,13 @@ static const char *(azHelp[]) = { " --zip FILE is a ZIP archive", ".output ?FILE? Send output to FILE or stdout if FILE is omitted", " If FILE begins with '|' then open it as a pipe.", + ".parameter CMD ... Manage SQL parameter bindings", + " clear Erase all bindings", + " init Initialize the TEMP table that holds bindings", + " list List the current parameter bindings", + " set PARAMETER VALUE Given SQL parameter PARAMETER a value of VALUE", + " PARAMETER should start with '$', ':', '@', or '?'", + " unset PARAMETER Remove PARAMETER from the binding table", ".print STRING... Print literal STRING", #ifndef SQLITE_OMIT_PROGRESS_CALLBACK ".progress N Invoke progress handler after every N opcodes", @@ -12392,7 +12458,7 @@ static int shell_dbinfo_command(ShellState *p, int nAr { "schema size:", "SELECT total(length(sql)) FROM %s" }, }; - int i; + int i, rc; unsigned iDataVersion; char *zSchemaTab; char *zDb = nArg>=2 ? azArg[1] : "main"; @@ -12400,8 +12466,19 @@ static int shell_dbinfo_command(ShellState *p, int nAr unsigned char aHdr[100]; open_db(p, 0); if( p->db==0 ) return 1; - sqlite3_prepare_v2(p->db,"SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1", - -1, &pStmt, 0); + rc = sqlite3_prepare_v2(p->db, + "SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1", + -1, &pStmt, 0); + if( rc ){ + if( !sqlite3_compileoption_used("ENABLE_DBPAGE_VTAB") ){ + utf8_printf(stderr, "the \".dbinfo\" command requires the " + "-DSQLITE_ENABLE_DBPAGE_VTAB compile-time options\n"); + }else{ + utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db)); + } + sqlite3_finalize(pStmt); + return 1; + } sqlite3_bind_text(pStmt, 1, zDb, -1, SQLITE_STATIC); if( sqlite3_step(pStmt)==SQLITE_ROW && sqlite3_column_bytes(pStmt,0)>100 @@ -12995,19 +13072,20 @@ static int arErrorMsg(ArCommand *pAr, const char *zFmt ** Values for ArCommand.eCmd. */ #define AR_CMD_CREATE 1 -#define AR_CMD_EXTRACT 2 -#define AR_CMD_LIST 3 -#define AR_CMD_UPDATE 4 -#define AR_CMD_HELP 5 +#define AR_CMD_UPDATE 2 +#define AR_CMD_INSERT 3 +#define AR_CMD_EXTRACT 4 +#define AR_CMD_LIST 5 +#define AR_CMD_HELP 6 /* ** Other (non-command) switches. */ -#define AR_SWITCH_VERBOSE 6 -#define AR_SWITCH_FILE 7 -#define AR_SWITCH_DIRECTORY 8 -#define AR_SWITCH_APPEND 9 -#define AR_SWITCH_DRYRUN 10 +#define AR_SWITCH_VERBOSE 7 +#define AR_SWITCH_FILE 8 +#define AR_SWITCH_DIRECTORY 9 +#define AR_SWITCH_APPEND 10 +#define AR_SWITCH_DRYRUN 11 static int arProcessSwitch(ArCommand *pAr, int eSwitch, const char *zArg){ switch( eSwitch ){ @@ -13015,6 +13093,7 @@ static int arProcessSwitch(ArCommand *pAr, int eSwitch case AR_CMD_EXTRACT: case AR_CMD_LIST: case AR_CMD_UPDATE: + case AR_CMD_INSERT: case AR_CMD_HELP: if( pAr->eCmd ){ return arErrorMsg(pAr, "multiple command options"); @@ -13061,6 +13140,7 @@ static int arParseCommand( } aSwitch[] = { { "create", 'c', AR_CMD_CREATE, 0 }, { "extract", 'x', AR_CMD_EXTRACT, 0 }, + { "insert", 'i', AR_CMD_INSERT, 0 }, { "list", 't', AR_CMD_LIST, 0 }, { "update", 'u', AR_CMD_UPDATE, 0 }, { "help", 'h', AR_CMD_HELP, 0 }, @@ -13396,19 +13476,27 @@ static int arExecSql(ArCommand *pAr, const char *zSql) /* -** Implementation of .ar "create" and "update" commands. +** Implementation of .ar "create", "insert", and "update" commands. ** +** create -> Create a new SQL archive +** insert -> Insert or reinsert all files listed +** update -> Insert files that have changed or that were not +** previously in the archive +** ** Create the "sqlar" table in the database if it does not already exist. ** Then add each file in the azFile[] array to the archive. Directories ** are added recursively. If argument bVerbose is non-zero, a message is ** printed on stdout for each file archived. ** ** The create command is the same as update, except that it drops -** any existing "sqlar" table before beginning. +** any existing "sqlar" table before beginning. The "insert" command +** always overwrites every file named on the command-line, where as +** "update" only overwrites if the size or mtime or mode has changed. */ static int arCreateOrUpdateCommand( ArCommand *pAr, /* Command arguments and options */ - int bUpdate /* true for a --create. false for --update */ + int bUpdate, /* true for a --create. */ + int bOnlyIfChanged /* Only update if file has changed */ ){ const char *zCreate = "CREATE TABLE IF NOT EXISTS sqlar(\n" @@ -13430,22 +13518,24 @@ static int arCreateOrUpdateCommand( " WHEN 'd' THEN 0\n" " ELSE -1 END,\n" " sqlar_compress(data)\n" - " FROM fsdir(%Q,%Q)\n" - " WHERE lsmode(mode) NOT LIKE '?%%';", + " FROM fsdir(%Q,%Q) AS disk\n" + " WHERE lsmode(mode) NOT LIKE '?%%'%s;" + , "REPLACE INTO %s(name,mode,mtime,data)\n" " SELECT\n" " %s,\n" " mode,\n" " mtime,\n" " data\n" - " FROM fsdir(%Q,%Q)\n" - " WHERE lsmode(mode) NOT LIKE '?%%';" + " FROM fsdir(%Q,%Q) AS disk\n" + " WHERE lsmode(mode) NOT LIKE '?%%'%s;" }; int i; /* For iterating through azFile[] */ int rc; /* Return code */ const char *zTab = 0; /* SQL table into which to insert */ char *zSql; char zTemp[50]; + char *zExists = 0; arExecSql(pAr, "PRAGMA page_size=512"); rc = arExecSql(pAr, "SAVEPOINT ar;"); @@ -13476,10 +13566,21 @@ static int arCreateOrUpdateCommand( } rc = arExecSql(pAr, zCreate); } + if( bOnlyIfChanged ){ + zExists = sqlite3_mprintf( + " AND NOT EXISTS(" + "SELECT 1 FROM %s AS mem" + " WHERE mem.name=disk.name" + " AND mem.mtime=disk.mtime" + " AND mem.mode=disk.mode)", zTab); + }else{ + zExists = sqlite3_mprintf(""); + } + if( zExists==0 ) rc = SQLITE_NOMEM; for(i=0; inArg && rc==SQLITE_OK; i++){ char *zSql2 = sqlite3_mprintf(zInsertFmt[pAr->bZip], zTab, pAr->bVerbose ? "shell_putsnl(name)" : "name", - pAr->azArg[i], pAr->zDir); + pAr->azArg[i], pAr->zDir, zExists); rc = arExecSql(pAr, zSql2); sqlite3_free(zSql2); } @@ -13494,6 +13595,7 @@ end_ar_transaction: sqlite3_free(zSql); } } + sqlite3_free(zExists); return rc; } @@ -13532,7 +13634,8 @@ static int arDotCommand( }else if( cmd.zFile ){ int flags; if( cmd.bAppend ) eDbType = SHELL_OPEN_APPENDVFS; - if( cmd.eCmd==AR_CMD_CREATE || cmd.eCmd==AR_CMD_UPDATE ){ + if( cmd.eCmd==AR_CMD_CREATE || cmd.eCmd==AR_CMD_INSERT + || cmd.eCmd==AR_CMD_UPDATE ){ flags = SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE; }else{ flags = SQLITE_OPEN_READONLY; @@ -13569,7 +13672,7 @@ static int arDotCommand( switch( cmd.eCmd ){ case AR_CMD_CREATE: - rc = arCreateOrUpdateCommand(&cmd, 0); + rc = arCreateOrUpdateCommand(&cmd, 0, 0); break; case AR_CMD_EXTRACT: @@ -13584,9 +13687,13 @@ static int arDotCommand( arUsage(pState->out); break; + case AR_CMD_INSERT: + rc = arCreateOrUpdateCommand(&cmd, 1, 0); + break; + default: assert( cmd.eCmd==AR_CMD_UPDATE ); - rc = arCreateOrUpdateCommand(&cmd, 1); + rc = arCreateOrUpdateCommand(&cmd, 1, 1); break; } } @@ -14709,6 +14816,114 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", zFile); } } + }else + + if( c=='p' && n>=3 && strncmp(azArg[0], "parameter", n)==0 ){ + open_db(p,0); + if( nArg<=1 ) goto parameter_syntax_error; + + /* .parameter clear + ** Clear all bind parameters by dropping the TEMP table that holds them. + */ + if( nArg==2 && strcmp(azArg[1],"clear")==0 ){ + int wrSchema = 0; + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); + sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp.sqlite_parameters;", + 0, 0, 0); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); + }else + + /* .parameter list + ** List all bind parameters. + */ + if( nArg==2 && strcmp(azArg[1],"list")==0 ){ + sqlite3_stmt *pStmt = 0; + int rx; + int len = 0; + rx = sqlite3_prepare_v2(p->db, + "SELECT max(length(key)) " + "FROM temp.sqlite_parameters;", -1, &pStmt, 0); + if( rx==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ + len = sqlite3_column_int(pStmt, 0); + if( len>40 ) len = 40; + } + sqlite3_finalize(pStmt); + pStmt = 0; + if( len ){ + rx = sqlite3_prepare_v2(p->db, + "SELECT key, quote(value) " + "FROM temp.sqlite_parameters;", -1, &pStmt, 0); + while( sqlite3_step(pStmt)==SQLITE_ROW ){ + utf8_printf(p->out, "%-*s %s\n", len, sqlite3_column_text(pStmt,0), + sqlite3_column_text(pStmt,1)); + } + sqlite3_finalize(pStmt); + } + }else + + /* .parameter init + ** Make sure the TEMP table used to hold bind parameters exists. + ** Create it if necessary. + */ + if( nArg==2 && strcmp(azArg[1],"init")==0 ){ + bind_table_init(p); + }else + + /* .parameter set NAME VALUE + ** Set or reset a bind parameter. NAME should be the full parameter + ** name exactly as it appears in the query. (ex: $abc, @def). The + ** VALUE can be in either SQL literal notation, or if not it will be + ** understood to be a text string. + */ + if( nArg==4 && strcmp(azArg[1],"set")==0 ){ + int rx; + char *zSql; + sqlite3_stmt *pStmt; + const char *zKey = azArg[2]; + const char *zValue = azArg[3]; + bind_table_init(p); + zSql = sqlite3_mprintf( + "REPLACE INTO temp.sqlite_parameters(key,value)" + "VALUES(%Q,%s);", zKey, zValue); + if( zSql==0 ) shell_out_of_memory(); + pStmt = 0; + rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); + sqlite3_free(zSql); + if( rx!=SQLITE_OK ){ + sqlite3_finalize(pStmt); + pStmt = 0; + zSql = sqlite3_mprintf( + "REPLACE INTO temp.sqlite_parameters(key,value)" + "VALUES(%Q,%Q);", zKey, zValue); + if( zSql==0 ) shell_out_of_memory(); + rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); + sqlite3_free(zSql); + if( rx!=SQLITE_OK ){ + utf8_printf(p->out, "Error: %s\n", sqlite3_errmsg(p->db)); + sqlite3_finalize(pStmt); + pStmt = 0; + rc = 1; + } + } + sqlite3_step(pStmt); + sqlite3_finalize(pStmt); + }else + + /* .parameter unset NAME + ** Remove the NAME binding from the parameter binding table, if it + ** exists. + */ + if( nArg==3 && strcmp(azArg[1],"unset")==0 ){ + char *zSql = sqlite3_mprintf( + "DELETE FROM temp.sqlite_parameters WHERE key=%Q", azArg[2]); + if( zSql==0 ) shell_out_of_memory(); + sqlite3_exec(p->db, zSql, 0, 0, 0); + sqlite3_free(zSql); + }else + /* If no command name matches, show a syntax error */ + parameter_syntax_error: + showHelp(p->out, "parameter"); }else if( c=='p' && n>=3 && strncmp(azArg[0], "print", n)==0 ){ Modified: head/contrib/sqlite3/sqlite3.c ============================================================================== --- head/contrib/sqlite3/sqlite3.c Sun May 5 00:21:56 2019 (r347138) +++ head/contrib/sqlite3/sqlite3.c Sun May 5 04:14:17 2019 (r347139) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.27.2. By combining all the individual C code files into this +** version 3.28.0. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1162,9 +1162,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.27.2" -#define SQLITE_VERSION_NUMBER 3027002 -#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7" +#define SQLITE_VERSION "3.28.0" +#define SQLITE_VERSION_NUMBER 3028000 +#define SQLITE_SOURCE_ID "2019-04-16 19:49:53 884b4b7e502b4e991677b53971277adfaf0a04a284f8e483e2553d0f83156b50" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1228,6 +1228,9 @@ SQLITE_API int sqlite3_libversion_number(void); #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS SQLITE_API int sqlite3_compileoption_used(const char *zOptName); SQLITE_API const char *sqlite3_compileoption_get(int N); +#else +# define sqlite3_compileoption_used(X) 0 +# define sqlite3_compileoption_get(X) ((void*)0) #endif /* @@ -3125,8 +3128,8 @@ struct sqlite3_mem_methods { ** ** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]] **
    SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
    -**
    ^This option is used to enable or disable the two-argument -** version of the [fts3_tokenizer()] function which is part of the +**
    ^This option is used to enable or disable the +** [fts3_tokenizer()] function which is part of the ** [FTS3] full-text search engine extension. ** There should be two additional arguments. ** The first argument is an integer which is 0 to disable fts3_tokenizer() or @@ -3238,6 +3241,17 @@ struct sqlite3_mem_methods { **
  • Direct writes to [shadow tables]. ** **
  • +** +** [[SQLITE_DBCONFIG_WRITABLE_SCHEMA]]
    SQLITE_DBCONFIG_WRITABLE_SCHEMA
    +**
    The SQLITE_DBCONFIG_WRITABLE_SCHEMA option activates or deactivates the +** "writable_schema" flag. This has the same effect and is logically equivalent +** to setting [PRAGMA writable_schema=ON] or [PRAGMA writable_schema=OFF]. +** The first argument to this setting is an integer which is 0 to disable +** the writable_schema, positive to enable writable_schema, or negative to +** leave the setting unchanged. The second parameter is a pointer to an +** integer into which is written 0 or 1 to indicate whether the writable_schema +** is enabled or disabled following this call. +**
    ** */ #define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ @@ -3251,7 +3265,8 @@ struct sqlite3_mem_methods { #define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */ #define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */ #define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */ -#define SQLITE_DBCONFIG_MAX 1010 /* Largest DBCONFIG */ +#define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */ +#define SQLITE_DBCONFIG_MAX 1011 /* Largest DBCONFIG */ /* ** CAPI3REF: Enable Or Disable Extended Result Codes @@ -4934,6 +4949,18 @@ SQLITE_API const char *sqlite3_normalized_sql(sqlite3_ SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); /* +** CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement +** METHOD: sqlite3_stmt +** +** ^The sqlite3_stmt_isexplain(S) interface returns 1 if the +** prepared statement S is an EXPLAIN statement, or 2 if the +** statement S is an EXPLAIN QUERY PLAN. +** ^The sqlite3_stmt_isexplain(S) interface returns 0 if S is +** an ordinary statement or a NULL pointer. +*/ +SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt); + +/* ** CAPI3REF: Determine If A Prepared Statement Has Been Reset ** METHOD: sqlite3_stmt ** @@ -5072,7 +5099,9 @@ typedef struct sqlite3_context sqlite3_context; ** ^The fifth argument to the BLOB and string binding interfaces ** is a destructor used to dispose of the BLOB or ** string after SQLite has finished with it. ^The destructor is called -** to dispose of the BLOB or string even if the call to bind API fails. +** to dispose of the BLOB or string even if the call to the bind API fails, +** except the destructor is not called if the third parameter is a NULL +** pointer or the fourth parameter is negative. ** ^If the fifth argument is ** the special value [SQLITE_STATIC], then SQLite assumes that the ** information is in static, unmanaged space and does not need to be freed. @@ -5989,6 +6018,8 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm( ** sqlite3_value_nochange   ** →  True if the column is unchanged in an UPDATE ** against a virtual table. +** sqlite3_value_frombind   +** →  True if value originated from a [bound parameter] ** ** ** Details: @@ -6050,6 +6081,11 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm( ** than within an [xUpdate] method call for an UPDATE statement, then ** the return value is arbitrary and meaningless. ** +** ^The sqlite3_value_frombind(X) interface returns non-zero if the +** value X originated from one of the [sqlite3_bind_int|sqlite3_bind()] +** interfaces. ^If X comes from an SQL literal value, or a table column, +** and expression, then sqlite3_value_frombind(X) returns zero. +** ** Please pay particular attention to the fact that the pointer returned ** from [sqlite3_value_blob()], [sqlite3_value_text()], or ** [sqlite3_value_text16()] can be invalidated by a subsequent call to @@ -6095,6 +6131,7 @@ SQLITE_API int sqlite3_value_bytes16(sqlite3_value*); SQLITE_API int sqlite3_value_type(sqlite3_value*); SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*); SQLITE_API int sqlite3_value_nochange(sqlite3_value*); +SQLITE_API int sqlite3_value_frombind(sqlite3_value*); /* ** CAPI3REF: Finding The Subtype Of SQL Values @@ -6830,7 +6867,7 @@ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); ** associated with database N of connection D. ^The main database file ** has the name "main". If there is no attached database N on the database ** connection D, or if database N is a temporary or in-memory database, then -** a NULL pointer is returned. +** this function will return either a NULL pointer or an empty string. ** ** ^The filename returned by this function is the output of the ** xFullPathname method of the [VFS]. ^In other words, the filename @@ -11931,7 +11968,7 @@ SQLITE_API int sqlite3rebaser_configure( ** in size. This function allocates and populates a buffer with a copy ** of the changeset rebased rebased according to the configuration of the ** rebaser object passed as the first argument. If successful, (*ppOut) -** is set to point to the new buffer containing the rebased changset and +** is set to point to the new buffer containing the rebased changeset and ** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the ** responsibility of the caller to eventually free the new buffer using ** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut) @@ -12340,7 +12377,7 @@ struct Fts5PhraseIter { ** Save the pointer passed as the second argument as the extension functions ** "auxiliary data". The pointer may then be retrieved by the current or any ** future invocation of the same fts5 extension function made as part of -** of the same MATCH query using the xGetAuxdata() API. +** the same MATCH query using the xGetAuxdata() API. ** ** Each extension function is allocated a single auxiliary data slot for ** each FTS query (MATCH expression). If the extension function is invoked @@ -12355,7 +12392,7 @@ struct Fts5PhraseIter { ** The xDelete callback, if one is specified, is also invoked on the ** auxiliary data pointer after the FTS5 query has finished. ** -** If an error (e.g. an OOM condition) occurs within this function, an +** If an error (e.g. an OOM condition) occurs within this function, ** the auxiliary data is set to NULL and an error code returned. If the ** xDelete parameter was not NULL, it is invoked on the auxiliary data ** pointer before returning. @@ -13381,7 +13418,7 @@ struct Hash { unsigned int count; /* Number of entries in this table */ HashElem *first; /* The first element of the array */ struct _ht { /* the hash table */ - int count; /* Number of entries with this hash */ + unsigned int count; /* Number of entries with this hash */ HashElem *chain; /* Pointer to first entry with this hash */ } *ht; }; @@ -13522,100 +13559,95 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*); #define TK_PRECEDING 85 #define TK_RANGE 86 #define TK_UNBOUNDED 87 -#define TK_REINDEX 88 -#define TK_RENAME 89 -#define TK_CTIME_KW 90 -#define TK_ANY 91 -#define TK_BITAND 92 -#define TK_BITOR 93 -#define TK_LSHIFT 94 -#define TK_RSHIFT 95 -#define TK_PLUS 96 -#define TK_MINUS 97 -#define TK_STAR 98 -#define TK_SLASH 99 -#define TK_REM 100 -#define TK_CONCAT 101 -#define TK_COLLATE 102 -#define TK_BITNOT 103 -#define TK_ON 104 -#define TK_INDEXED 105 -#define TK_STRING 106 -#define TK_JOIN_KW 107 -#define TK_CONSTRAINT 108 -#define TK_DEFAULT 109 -#define TK_NULL 110 -#define TK_PRIMARY 111 -#define TK_UNIQUE 112 -#define TK_CHECK 113 -#define TK_REFERENCES 114 -#define TK_AUTOINCR 115 -#define TK_INSERT 116 -#define TK_DELETE 117 -#define TK_UPDATE 118 -#define TK_SET 119 -#define TK_DEFERRABLE 120 -#define TK_FOREIGN 121 -#define TK_DROP 122 -#define TK_UNION 123 -#define TK_ALL 124 -#define TK_EXCEPT 125 -#define TK_INTERSECT 126 -#define TK_SELECT 127 -#define TK_VALUES 128 -#define TK_DISTINCT 129 -#define TK_DOT 130 -#define TK_FROM 131 -#define TK_JOIN 132 -#define TK_USING 133 -#define TK_ORDER 134 -#define TK_GROUP 135 -#define TK_HAVING 136 -#define TK_LIMIT 137 -#define TK_WHERE 138 -#define TK_INTO 139 -#define TK_NOTHING 140 -#define TK_FLOAT 141 -#define TK_BLOB 142 -#define TK_INTEGER 143 -#define TK_VARIABLE 144 -#define TK_CASE 145 -#define TK_WHEN 146 -#define TK_THEN 147 -#define TK_ELSE 148 -#define TK_INDEX 149 -#define TK_ALTER 150 -#define TK_ADD 151 -#define TK_WINDOW 152 -#define TK_OVER 153 -#define TK_FILTER 154 -#define TK_TRUEFALSE 155 -#define TK_ISNOT 156 -#define TK_FUNCTION 157 -#define TK_COLUMN 158 -#define TK_AGG_FUNCTION 159 -#define TK_AGG_COLUMN 160 -#define TK_UMINUS 161 -#define TK_UPLUS 162 -#define TK_TRUTH 163 -#define TK_REGISTER 164 -#define TK_VECTOR 165 -#define TK_SELECT_COLUMN 166 -#define TK_IF_NULL_ROW 167 -#define TK_ASTERISK 168 -#define TK_SPAN 169 -#define TK_END_OF_FILE 170 -#define TK_UNCLOSED_STRING 171 -#define TK_SPACE 172 -#define TK_ILLEGAL 173 +#define TK_EXCLUDE 88 +#define TK_GROUPS 89 +#define TK_OTHERS 90 +#define TK_TIES 91 +#define TK_REINDEX 92 +#define TK_RENAME 93 +#define TK_CTIME_KW 94 +#define TK_ANY 95 +#define TK_BITAND 96 +#define TK_BITOR 97 +#define TK_LSHIFT 98 +#define TK_RSHIFT 99 +#define TK_PLUS 100 +#define TK_MINUS 101 +#define TK_STAR 102 +#define TK_SLASH 103 +#define TK_REM 104 +#define TK_CONCAT 105 +#define TK_COLLATE 106 +#define TK_BITNOT 107 +#define TK_ON 108 +#define TK_INDEXED 109 +#define TK_STRING 110 +#define TK_JOIN_KW 111 +#define TK_CONSTRAINT 112 +#define TK_DEFAULT 113 +#define TK_NULL 114 +#define TK_PRIMARY 115 +#define TK_UNIQUE 116 +#define TK_CHECK 117 +#define TK_REFERENCES 118 +#define TK_AUTOINCR 119 +#define TK_INSERT 120 +#define TK_DELETE 121 +#define TK_UPDATE 122 +#define TK_SET 123 +#define TK_DEFERRABLE 124 +#define TK_FOREIGN 125 +#define TK_DROP 126 +#define TK_UNION 127 +#define TK_ALL 128 +#define TK_EXCEPT 129 +#define TK_INTERSECT 130 +#define TK_SELECT 131 +#define TK_VALUES 132 +#define TK_DISTINCT 133 +#define TK_DOT 134 +#define TK_FROM 135 +#define TK_JOIN 136 +#define TK_USING 137 +#define TK_ORDER 138 +#define TK_GROUP 139 +#define TK_HAVING 140 +#define TK_LIMIT 141 +#define TK_WHERE 142 +#define TK_INTO 143 +#define TK_NOTHING 144 +#define TK_FLOAT 145 +#define TK_BLOB 146 +#define TK_INTEGER 147 +#define TK_VARIABLE 148 +#define TK_CASE 149 +#define TK_WHEN 150 +#define TK_THEN 151 +#define TK_ELSE 152 +#define TK_INDEX 153 +#define TK_ALTER 154 +#define TK_ADD 155 +#define TK_WINDOW 156 +#define TK_OVER 157 +#define TK_FILTER 158 +#define TK_TRUEFALSE 159 +#define TK_ISNOT 160 +#define TK_FUNCTION 161 +#define TK_COLUMN 162 +#define TK_AGG_FUNCTION 163 +#define TK_AGG_COLUMN 164 +#define TK_UMINUS 165 +#define TK_UPLUS 166 +#define TK_TRUTH 167 +#define TK_REGISTER 168 +#define TK_VECTOR 169 +#define TK_SELECT_COLUMN 170 +#define TK_IF_NULL_ROW 171 +#define TK_ASTERISK 172 +#define TK_SPAN 173 +#define TK_SPACE 174 +#define TK_ILLEGAL 175 -/* The token codes above must all fit in 8 bits */ -#define TKFLG_MASK 0xff - -/* Flags that can be added to a token code when it is not -** being stored in a u8: */ -#define TKFLG_DONTFOLD 0x100 /* Omit constant folding optimizations */ - /************** End of parse.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ #include @@ -14546,9 +14578,6 @@ struct BtreePayload { SQLITE_PRIVATE int sqlite3BtreeInsert(BtCursor*, const BtreePayload *pPayload, int flags, int seekResult); SQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor*, int *pRes); -#ifndef SQLITE_OMIT_WINDOWFUNC -SQLITE_PRIVATE void sqlite3BtreeSkipNext(BtCursor*); -#endif SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor*, int *pRes); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun May 5 04:56:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D3A015A30EF; Sun, 5 May 2019 04:56:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02D558622B; Sun, 5 May 2019 04:56:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C71821AD7C; Sun, 5 May 2019 04:56:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x454udIc094266; Sun, 5 May 2019 04:56:39 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x454ucnT094258; Sun, 5 May 2019 04:56:38 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201905050456.x454ucnT094258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 5 May 2019 04:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347140 - in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Commit-Revision: 347140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 02D558622B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 04:56:40 -0000 Author: adrian Date: Sun May 5 04:56:37 2019 New Revision: 347140 URL: https://svnweb.freebsd.org/changeset/base/347140 Log: [ath] [ath_rate] Fix ANI calibration during non-ACTIVE states; start poking at rate control These are some fun issues I've found with my upstairs wifi link at such a ridiculous low signal level (like, < 5dB.) * Add per-station tx/rx rssi statistics, in potential preparation to use that in the RX rate control. * Call the rate control on each received frame to let it potentially use it as a hint for what rates to potentially use. It's a no-op right now. * Do ANI calibration during scan as well. The ath_newstate() call was disabling the ANI timer and only re-enabling it during transitions to _RUN. This has the unfortunate side-effect that if ANI deafened the NIC because of interference and it disassociated, it wouldn't be reset and the scan would never hear beacons. The ANI configuration is stored at least globally on some HALs and per-channel on others. Because of this a NIC reset wouldn't help; the ANI parameters would simply be programmed back in. Now, I have a feeling I also need to do this during AUTH/ASSOC too and maybe, if I'm feeling clever, I need to reset the ANI parameters on a given channel during a transition through INIT or if the VAP is destroyed/re-created. However for now this gets me out of the immediate weeds with connectivity upstairs (and thus I /can/ commit); I'll keep chipping away at tidying this stuff up in subsequent commits. Tested: * AR9344 (Wasp), 2G STA mode Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c head/sys/dev/ath/ath_rate/onoe/onoe.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_tx_edma.c head/sys/dev/ath/if_athrate.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c ============================================================================== --- head/sys/dev/ath/ath_rate/amrr/amrr.c Sun May 5 04:14:17 2019 (r347139) +++ head/sys/dev/ath/ath_rate/amrr/amrr.c Sun May 5 04:56:37 2019 (r347140) @@ -196,6 +196,11 @@ ath_rate_newassoc(struct ath_softc *sc, struct ath_nod ath_rate_ctl_start(sc, &an->an_node); } +void +ath_rate_update_rx_rssi(struct ath_softc *sc, struct ath_node *an, int rssi) +{ +} + static void node_reset(struct amrr_node *amn) { Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c ============================================================================== --- head/sys/dev/ath/ath_rate/onoe/onoe.c Sun May 5 04:14:17 2019 (r347139) +++ head/sys/dev/ath/ath_rate/onoe/onoe.c Sun May 5 04:56:37 2019 (r347140) @@ -189,6 +189,12 @@ ath_rate_newassoc(struct ath_softc *sc, struct ath_nod ath_rate_ctl_start(sc, &an->an_node); } +void +ath_rate_update_rx_rssi(struct ath_softc *sc, struct ath_node *an, int rssi) +{ +} + + static void ath_rate_update(struct ath_softc *sc, struct ieee80211_node *ni, int rate) { Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sun May 5 04:14:17 2019 (r347139) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sun May 5 04:56:37 2019 (r347140) @@ -1019,6 +1019,12 @@ ath_rate_newassoc(struct ath_softc *sc, struct ath_nod ath_rate_ctl_reset(sc, &an->an_node); } +void +ath_rate_update_rx_rssi(struct ath_softc *sc, struct ath_node *an, int rssi) +{ +} + + static const struct txschedule *mrr_schedules[IEEE80211_MODE_MAX+2] = { NULL, /* IEEE80211_MODE_AUTO */ series_11a, /* IEEE80211_MODE_11A */ Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun May 5 04:14:17 2019 (r347139) +++ head/sys/dev/ath/if_ath.c Sun May 5 04:56:37 2019 (r347140) @@ -3882,6 +3882,10 @@ ath_node_alloc(struct ieee80211vap *vap, const uint8_t /* XXX setup ath_tid */ ath_tx_tid_init(sc, an); + an->an_node_stats.ns_avgbrssi = ATH_RSSI_DUMMY_MARKER; + an->an_node_stats.ns_avgrssi = ATH_RSSI_DUMMY_MARKER; + an->an_node_stats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER; + DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__, mac, ":", an); return &an->an_node; } @@ -4493,6 +4497,8 @@ ath_tx_processq(struct ath_softc *sc, struct ath_txq * sc->sc_stats.ast_tx_rssi = ts->ts_rssi; ATH_RSSI_LPF(sc->sc_halstats.ns_avgtxrssi, ts->ts_rssi); + ATH_RSSI_LPF(ATH_NODE(ni)->an_node_stats.ns_avgtxrssi, + ts->ts_rssi); } ATH_TXQ_UNLOCK(txq); @@ -5435,6 +5441,16 @@ ath_calibrate(void *arg) __func__, sc->sc_curchan->ic_freq); sc->sc_stats.ast_per_calfail++; } + /* + * XXX TODO: get the NF calibration results from the HAL. + * If we failed NF cal then schedule a hard reset to potentially + * un-freeze the PHY. + * + * Note we have to be careful here to not get stuck in an + * infinite NIC restart. Ideally we'd not restart if we + * failed the first NF cal - that /can/ fail sometimes in + * a noisy environment. + */ if (shortCal) sc->sc_lastshortcal = ticks; } @@ -6090,6 +6106,17 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_ taskqueue_block(sc->sc_tq); sc->sc_beacons = 0; } + + /* + * For at least STA mode we likely should clear the ANI + * and NF calibration state and allow the NIC/HAL to figure + * out optimal parameters at runtime. Otherwise if we + * disassociate due to interference / deafness it may persist + * when we reconnect. + * + * Note: may need to do this for other states too, not just + * _S_INIT. + */ #ifdef IEEE80211_SUPPORT_TDMA ath_hal_setcca(ah, AH_TRUE); #endif @@ -6119,9 +6146,39 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_ } ATH_UNLOCK(sc); } + + /* + * Note - the ANI/calibration timer isn't re-enabled during + * network sleep for now. One unfortunate side-effect is that + * the PHY/airtime statistics aren't gathered on the channel + * but I haven't yet tested to see if reading those registers + * CAN occur during network sleep. + * + * This should be revisited in a future commit, even if it's + * just to split out the airtime polling from ANI/calibration. + */ } else if (nstate == IEEE80211_S_SCAN) { /* Quiet time handling - ensure we resync */ memset(&avp->quiet_ie, 0, sizeof(avp->quiet_ie)); + + /* + * If we're in scan mode then startpcureceive() is + * hopefully being called with "reset ANI" for this channel; + * but once we attempt to reassociate we program in the previous + * ANI values and.. not do any calibration until we're running. + * This may mean we stay deaf unless we can associate successfully. + * + * So do kick off the cal timer to get NF/ANI going. + */ + ATH_LOCK(sc); + if (ath_longcalinterval != 0) { + /* start periodic recalibration timer */ + callout_reset(&sc->sc_cal_ch, 1, ath_calibrate, sc); + } else { + DPRINTF(sc, ATH_DEBUG_CALIBRATE, + "%s: calibration disabled\n", __func__); + } + ATH_UNLOCK(sc); } bad: ieee80211_free_node(ni); Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun May 5 04:14:17 2019 (r347139) +++ head/sys/dev/ath/if_ath_rx.c Sun May 5 04:56:37 2019 (r347140) @@ -363,6 +363,11 @@ ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf * ATH_VAP(vap)->av_recv_mgmt(ni, m, subtype, rxs, rssi, nf); switch (subtype) { case IEEE80211_FC0_SUBTYPE_BEACON: + /* + * Always update the per-node beacon RSSI if we're hearing + * beacons from that node. + */ + ATH_RSSI_LPF(ATH_NODE(ni)->an_node_stats.ns_avgbrssi, rssi); /* * Only do the following processing if it's for @@ -946,6 +951,21 @@ rx_accept: m->m_flags |= M_AMPDU; /* + * Inform rate control about the received RSSI. + * It can then use this information to potentially drastically + * alter the available rate based on the RSSI estimate. + * + * This is super important when associating to a far away station; + * you don't want to waste time trying higher rates at some low + * packet exchange rate (like during DHCP) just to establish + * that higher MCS rates aren't available. + */ + ATH_RSSI_LPF(ATH_NODE(ni)->an_node_stats.ns_avgrssi, + rs->rs_rssi); + ath_rate_update_rx_rssi(sc, ATH_NODE(ni), + ATH_RSSI(ATH_NODE(ni)->an_node_stats.ns_avgrssi)); + + /* * Sending station is known, dispatch directly. */ (void) ieee80211_add_rx_params(m, &rxs); @@ -973,7 +993,7 @@ rx_accept: */ /* - * Track rx rssi and do any rx antenna management. + * Track legacy station RX rssi and do any rx antenna management. */ ATH_RSSI_LPF(sc->sc_halstats.ns_avgrssi, rs->rs_rssi); if (sc->sc_diversity) { Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Sun May 5 04:14:17 2019 (r347139) +++ head/sys/dev/ath/if_ath_tx_edma.c Sun May 5 04:56:37 2019 (r347140) @@ -1012,6 +1012,8 @@ ath_edma_tx_processq(struct ath_softc *sc, int dosched sc->sc_stats.ast_tx_rssi = ts.ts_rssi; ATH_RSSI_LPF(sc->sc_halstats.ns_avgtxrssi, ts.ts_rssi); + ATH_RSSI_LPF(ATH_NODE(ni)->an_node_stats.ns_avgtxrssi, + ts.ts_rssi); } /* Handle frame completion and rate control update */ Modified: head/sys/dev/ath/if_athrate.h ============================================================================== --- head/sys/dev/ath/if_athrate.h Sun May 5 04:14:17 2019 (r347139) +++ head/sys/dev/ath/if_athrate.h Sun May 5 04:56:37 2019 (r347140) @@ -157,6 +157,12 @@ void ath_rate_tx_complete(struct ath_softc *, struct a int pktlen, int nframes, int nbad); /* + * Update rate control with a per-packet receive RSSI value. + */ +void ath_rate_update_rx_rssi(struct ath_softc *, struct ath_node *, + int rssi); + +/* * Fetch the global rate control statistics. */ int ath_rate_fetch_stats(struct ath_softc *sc, struct ath_rateioctl *rs); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun May 5 04:14:17 2019 (r347139) +++ head/sys/dev/ath/if_athvar.h Sun May 5 04:56:37 2019 (r347140) @@ -204,6 +204,7 @@ struct ath_node { node */ int clrdmask; /* has clrdmask been set */ uint32_t an_leak_count; /* How many frames to leak during pause */ + HAL_NODE_STATS an_node_stats; /* HAL node stats for this node */ /* variable-length rate control state follows */ }; #define ATH_NODE(ni) ((struct ath_node *)(ni)) From owner-svn-src-all@freebsd.org Sun May 5 06:32:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6D2A15A4C7B; Sun, 5 May 2019 06:32:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 512FA8869D; Sun, 5 May 2019 06:32:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BF4F1BE1A; Sun, 5 May 2019 06:32:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x456Wftb046805; Sun, 5 May 2019 06:32:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x456WfEX046804; Sun, 5 May 2019 06:32:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201905050632.x456WfEX046804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 5 May 2019 06:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347141 - head/sys/dev/ath/ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath/ath_rate/sample X-SVN-Commit-Revision: 347141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 512FA8869D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 06:32:42 -0000 Author: adrian Date: Sun May 5 06:32:40 2019 New Revision: 347141 URL: https://svnweb.freebsd.org/changeset/base/347141 Log: [ath_rate_sample] Have the final attempted rate in 11n modes to be the lowest one. Right now ath_rate_sample has a fixed rate schedule, rather than the minstrel_ht style "best, good, most reliable" triplet. So, if higher rates are tried then it'll not fail back to a lower MCS rate in that transmission schedule. This means that in low SNR situations it'll not easily drop to MCS0 unless enough transmissions occur to allow rate control to eventually decide to drop; and if it's TCP traffic it'll get slowed down because of packet loss. It's worse for 2-stream and 3-stream rates; it doesn't ever fall back to lower stream rates, and these higher stream rates required higher SNR to work. So instead let's (for now?) have each of the 11n transmit rates use MCS0 as the last attempt. ath_rate_sample will quickly see that rate succeeds more and will move to it much quicker. Testing: * AR9344 (Wasp) - 2G STA mode Modified: head/sys/dev/ath/ath_rate/sample/tx_schedules.h Modified: head/sys/dev/ath/ath_rate/sample/tx_schedules.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/tx_schedules.h Sun May 5 04:56:37 2019 (r347140) +++ head/sys/dev/ath/ath_rate/sample/tx_schedules.h Sun May 5 06:32:40 2019 (r347141) @@ -172,30 +172,30 @@ static const struct txschedule series_11ng[] = { { 4,NG1( 26), 3,NG1(19.5), 4,NG1( 6.5), 2,NG1(6.5) }, /* 26Mb/s */ { 4,NG1( 39), 3,NG1( 26), 4,NG1(19.5), 2,NG1(6.5) }, /* 39Mb/s */ { 4,NG1( 52), 3,NG1( 39), 4,NG1( 26), 2,NG1(6.5) }, /* 52Mb/s */ - { 4,NG1(58.5), 3,NG1( 52), 4,NG1( 39), 2,NG1( 13) }, /*58.5Mb/s */ - { 4,NG1( 65), 3,NG1(58.5), 4,NG1( 52), 2,NG1( 13) }, /* 65Mb/s */ + { 4,NG1(58.5), 3,NG1( 52), 4,NG1( 39), 2,NG1(6.5) }, /*58.5Mb/s */ + { 4,NG1( 65), 3,NG1(58.5), 4,NG1( 52), 2,NG1(6.5) }, /* 65Mb/s */ /* 2 stream rates */ - { 3,NG2( 13), 3,NG2( 13), 0,NG2( 13), 0,NG2( 13) }, /* 13Mb/s */ - { 4,NG2( 26), 3,NG2( 13), 4,NG2( 13), 0,NG2( 13) }, /* 26Mb/s */ - { 4,NG2( 39), 3,NG2( 26), 4,NG2( 13), 2,NG2( 13) }, /* 39Mb/s */ - { 4,NG2( 52), 3,NG2( 39), 4,NG2( 26), 2,NG2( 13) }, /* 52Mb/s */ - { 4,NG2( 78), 3,NG2( 52), 4,NG2( 39), 2,NG2( 13) }, /* 78Mb/s */ - { 4,NG2( 104), 3,NG2( 78), 4,NG2( 52), 2,NG2( 13) }, /* 104Mb/s */ - { 4,NG2( 117), 3,NG2( 104), 4,NG2( 78), 2,NG2( 26) }, /* 117Mb/s */ - { 4,NG2( 130), 3,NG2( 117), 4,NG2( 104), 2,NG2( 26) }, /* 130Mb/s */ + { 3,NG2( 13), 3,NG1(6.5), 0,NG2( 13), 0,NG2( 13) }, /* 13Mb/s */ + { 4,NG2( 26), 3,NG2( 13), 4,NG1(6.5), 0,NG2( 13) }, /* 26Mb/s */ + { 4,NG2( 39), 3,NG2( 26), 4,NG2( 13), 2,NG1(6.5) }, /* 39Mb/s */ + { 4,NG2( 52), 3,NG2( 39), 4,NG2( 26), 2,NG1(6.5) }, /* 52Mb/s */ + { 4,NG2( 78), 3,NG2( 52), 4,NG2( 39), 2,NG1(6.5) }, /* 78Mb/s */ + { 4,NG2( 104), 3,NG2( 78), 4,NG2( 52), 2,NG1(6.5) }, /* 104Mb/s */ + { 4,NG2( 117), 3,NG2( 104), 4,NG2( 78), 2,NG1(6.5) }, /* 117Mb/s */ + { 4,NG2( 130), 3,NG2( 117), 4,NG2( 104), 2,NG1(6.5) }, /* 130Mb/s */ /* 3 stream rates */ - { 3,NG3(19.5), 3,NG3(19.5), 0,NG3(19.5), 0,NG3(19.5) }, /* 19Mb/s */ - { 3,NG3( 39), 3,NG3(19.5), 0,NG3(19.5), 0,NG3(19.5) }, /* 39Mb/s */ - { 3,NG3(58.5), 3,NG3( 39), 0,NG3(19.5), 0,NG3(19.5) }, /* 58Mb/s */ - { 3,NG3( 78), 3,NG3(58.5), 0,NG3( 39), 0,NG3(19.5) }, /* 78Mb/s */ - { 3,NG3( 117), 3,NG3( 78), 0,NG3(58.5), 0,NG3(19.5) }, /* 117Mb/s */ - { 3,NG3( 156), 3,NG3( 117), 0,NG3( 78), 0,NG3(19.5) }, /* 156Mb/s */ - { 3,NG3(175.5), 3,NG3( 156), 0,NG3( 117), 0,NG3( 39) }, /* 175Mb/s */ - { 3,NG3( 195), 3,NG3( 195), 0,NG3( 156), 0,NG3(58.5) }, /* 195Mb/s */ + { 3,NG3(19.5), 3,NG1(6.5), 0,NG3(19.5), 0,NG3(19.5) }, /* 19Mb/s */ + { 3,NG3( 39), 3,NG3(19.5), 4,NG1(6.5), 0,NG3(19.5) }, /* 39Mb/s */ + { 3,NG3(58.5), 3,NG3( 39), 4,NG1(6.5), 0,NG3(19.5) }, /* 58Mb/s */ + { 3,NG3( 78), 3,NG3(58.5), 4,NG1(6.5), 0,NG3(19.5) }, /* 78Mb/s */ + { 3,NG3( 117), 3,NG3( 78), 4,NG1(6.5), 0,NG3(19.5) }, /* 117Mb/s */ + { 3,NG3( 156), 3,NG3( 117), 4,NG1(6.5), 0,NG3(19.5) }, /* 156Mb/s */ + { 3,NG3(175.5), 3,NG3( 156), 4,NG1(6.5), 0,NG3( 39) }, /* 175Mb/s */ + { 3,NG3( 195), 3,NG3( 195), 4,NG1(6.5), 0,NG3(58.5) }, /* 195Mb/s */ }; #undef G From owner-svn-src-all@freebsd.org Sun May 5 06:38:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B439015A4EE2; Sun, 5 May 2019 06:38:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B915888F3; Sun, 5 May 2019 06:38:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34A3A1BE20; Sun, 5 May 2019 06:38:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x456clw6047112; Sun, 5 May 2019 06:38:47 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x456clk7047111; Sun, 5 May 2019 06:38:47 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905050638.x456clk7047111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 5 May 2019 06:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347142 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 347142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B915888F3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 06:38:48 -0000 Author: tsoome Date: Sun May 5 06:38:47 2019 New Revision: 347142 URL: https://svnweb.freebsd.org/changeset/base/347142 Log: loader: validate sectorsize argument in disk_open() The bug and patch is reported against 11.2, but it is good idea to have the check in place for all versions. PR: 236585 Submitted by: john@feith.com Reported by: john@feith.com MFC after: 1 day Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Sun May 5 06:32:40 2019 (r347141) +++ head/stand/common/disk.c Sun May 5 06:38:47 2019 (r347142) @@ -221,6 +221,10 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize struct ptable_entry part; int rc, slice, partition; + if (sectorsize == 0) { + DPRINTF("unknown sector size"); + return (ENXIO); + } rc = 0; od = (struct open_disk *)malloc(sizeof(struct open_disk)); if (od == NULL) { From owner-svn-src-all@freebsd.org Sun May 5 08:06:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DFF31581B92; Sun, 5 May 2019 08:06:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A60A88AA16; Sun, 5 May 2019 08:06:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66A7A1CD01; Sun, 5 May 2019 08:06:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4586XeD093525; Sun, 5 May 2019 08:06:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4586X6S093524; Sun, 5 May 2019 08:06:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905050806.x4586X6S093524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 08:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347143 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A60A88AA16 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 08:06:34 -0000 Author: tuexen Date: Sun May 5 08:06:32 2019 New Revision: 347143 URL: https://svnweb.freebsd.org/changeset/base/347143 Log: MFC r335176: Whitespace changes. Modified: stable/11/sys/netinet/sctp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sun May 5 06:38:47 2019 (r347142) +++ stable/11/sys/netinet/sctp_output.c Sun May 5 08:06:32 2019 (r347143) @@ -2543,6 +2543,7 @@ once_again: inp->next_addr_touse = NULL; goto once_again; } + inp->next_addr_touse = starting_point; resettotop = 0; once_again_too: @@ -2550,6 +2551,7 @@ once_again_too: inp->next_addr_touse = LIST_FIRST(&inp->sctp_addr_list); resettotop = 1; } + /* ok, what about an acceptable address in the inp */ for (laddr = inp->next_addr_touse; laddr; laddr = LIST_NEXT(laddr, sctp_nxt_addr)) { @@ -2572,6 +2574,7 @@ once_again_too: inp->next_addr_touse = NULL; goto once_again_too; } + /* * no address bound can be a source for the destination we are in * trouble @@ -3986,8 +3989,8 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, int so_locked #endif ) -/* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ { +/* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ /** * Given a mbuf chain (via SCTP_BUF_NEXT()) that holds a packet header * WITH an SCTPHDR but no IP header, endpoint inp and sa structure: @@ -4034,6 +4037,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, if ((auth != NULL) && (stcb != NULL)) { sctp_fill_hmac_digest_m(m, auth_offset, auth, stcb, auth_keyid); } + if (net) { tos_value = net->dscp; } else if (stcb) { @@ -4548,6 +4552,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, prev_scope = sin6->sin6_scope_id; prev_port = sin6->sin6_port; } + if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { /* failed to prepend data, give up */ sctp_m_freem(m); @@ -4736,6 +4741,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp ali->indication = htonl(inp->sctp_ep.adaptation_layer_indicator); chunk_len += parameter_len; } + /* ECN parameter */ if (stcb->asoc.ecn_supported == 1) { parameter_len = (uint16_t)sizeof(struct sctp_paramhdr); @@ -4744,6 +4750,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* PR-SCTP supported parameter */ if (stcb->asoc.prsctp_supported == 1) { parameter_len = (uint16_t)sizeof(struct sctp_paramhdr); @@ -4752,6 +4759,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* Add NAT friendly parameter. */ if (SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly)) { parameter_len = (uint16_t)sizeof(struct sctp_paramhdr); @@ -4760,6 +4768,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* And now tell the peer which extensions we support */ num_ext = 0; pr_supported = (struct sctp_supported_chunk_types_param *)(mtod(m, caddr_t)+chunk_len); @@ -4850,6 +4859,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp chunk_len += parameter_len; } } + /* now any cookie time extensions */ if (stcb->asoc.cookie_preserve_req) { struct sctp_cookie_perserve_param *cookie_preserve; @@ -4867,6 +4877,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp stcb->asoc.cookie_preserve_req = 0; chunk_len += parameter_len; } + if (stcb->asoc.scope.ipv4_addr_legal || stcb->asoc.scope.ipv6_addr_legal) { uint8_t i; @@ -4895,6 +4906,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp padding_len = 4 - 2 * i; chunk_len += parameter_len; } + SCTP_BUF_LEN(m) = chunk_len; /* now the addresses */ /* @@ -5900,6 +5912,7 @@ do_a_abort: ali->indication = htonl(inp->sctp_ep.adaptation_layer_indicator); chunk_len += parameter_len; } + /* ECN parameter */ if (((asoc != NULL) && (asoc->ecn_supported == 1)) || ((asoc == NULL) && (inp->ecn_supported == 1))) { @@ -5909,6 +5922,7 @@ do_a_abort: ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* PR-SCTP supported parameter */ if (((asoc != NULL) && (asoc->prsctp_supported == 1)) || ((asoc == NULL) && (inp->prsctp_supported == 1))) { @@ -5918,6 +5932,7 @@ do_a_abort: ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* Add NAT friendly parameter */ if (nat_friendly) { parameter_len = (uint16_t)sizeof(struct sctp_paramhdr); @@ -5926,6 +5941,7 @@ do_a_abort: ph->param_length = htons(parameter_len); chunk_len += parameter_len; } + /* And now tell the peer which extensions we support */ num_ext = 0; pr_supported = (struct sctp_supported_chunk_types_param *)(mtod(m, caddr_t)+chunk_len); @@ -5969,6 +5985,7 @@ do_a_abort: padding_len = SCTP_SIZE32(parameter_len) - parameter_len; chunk_len += parameter_len; } + /* add authentication parameters */ if (((asoc != NULL) && (asoc->auth_supported == 1)) || ((asoc == NULL) && (inp->auth_supported == 1))) { @@ -6046,6 +6063,7 @@ do_a_abort: SCTP_BUF_LEN(m) += padding_len; padding_len = 0; } + /* tack on the operational error if present */ if (op_err) { parameter_len = 0; @@ -7429,6 +7447,7 @@ dont_do_it: chk->last_mbuf = SCTP_BUF_NEXT(chk->last_mbuf); } } + if (to_move > length) { /*- This should not happen either * since we always lower to_move to the size @@ -7966,6 +7985,7 @@ nothing_to_send: *reason_code = 8; return (0); } + if (asoc->sctp_cmt_on_off > 0) { /* get the last start point */ start_at = asoc->last_net_cmt_send_started; @@ -8612,6 +8632,7 @@ again_one_more_time: /* Don't send the chunk on this net */ continue; } + if (asoc->sctp_cmt_on_off == 0) { if ((asoc->alternate) && (asoc->alternate != net) && @@ -8875,6 +8896,7 @@ no_data_fill: if (old_start_at) goto again_one_more_time; } + /* * At the end there should be no NON timed chunks hanging on this * queue. @@ -9268,17 +9290,20 @@ sctp_send_asconf(struct sctp_tcb *stcb, struct sctp_ne /* can't send a new one if there is one in flight already */ return; } + /* compose an ASCONF chunk, maximum length is PMTU */ m_asconf = sctp_compose_asconf(stcb, &len, addr_locked); if (m_asconf == NULL) { return; } + sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { /* no memory */ sctp_m_freem(m_asconf); return; } + chk->copy_by_ref = 0; chk->rec.chunk_id.id = SCTP_ASCONF; chk->rec.chunk_id.can_take_data = 0; @@ -9349,6 +9374,7 @@ sctp_send_asconf_ack(struct sctp_tcb *stcb) if (ack->data == NULL) { continue; } + /* copy the asconf_ack */ m_ack = SCTP_M_COPYM(ack->data, 0, M_COPYALL, M_NOWAIT); if (m_ack == NULL) { @@ -10237,6 +10263,7 @@ sctp_output( SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } + if (inp->sctp_socket == NULL) { SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); @@ -11307,6 +11334,7 @@ sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets * SCTPDBG(SCTP_DEBUG_OUTPUT4, "Gak, can't get a chunk for hb\n"); return; } + chk->copy_by_ref = 0; chk->rec.chunk_id.id = SCTP_HEARTBEAT_REQUEST; chk->rec.chunk_id.can_take_data = 1; @@ -12325,6 +12353,7 @@ sctp_copy_one(struct sctp_stream_queue_pending *sp, SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOBUFS); return (ENOBUFS); } + sp->tail_mbuf = m_last(sp->data); return (0); } @@ -12341,6 +12370,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb, int user_marks_eor, int *error) { + /*- * This routine must be very careful in its work. Protocol * processing is up and running so care must be taken to spl...() @@ -13005,6 +13035,7 @@ sctp_lower_sosend(struct socket *so, error = EFAULT; goto out_unlocked; } + /* Unless E_EOR mode is on, we must make a send FIT in one call. */ if ((user_marks_eor == 0) && (sndlen > SCTP_SB_LIMIT_SND(stcb->sctp_socket))) { @@ -13022,6 +13053,7 @@ sctp_lower_sosend(struct socket *so, error = EINVAL; goto out_unlocked; } + if (user_marks_eor) { local_add_more = min(SCTP_SB_LIMIT_SND(so), SCTP_BASE_SYSCTL(sctp_add_more_threshold)); } else { @@ -13086,6 +13118,7 @@ sctp_lower_sosend(struct socket *so, } SOCKBUF_UNLOCK(&so->so_snd); } + skip_preblock: if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { goto out_unlocked; @@ -13222,6 +13255,7 @@ skip_preblock: if (srcv->sinfo_flags & SCTP_SACK_IMMEDIATELY) { sp->sinfo_flags |= SCTP_SACK_IMMEDIATELY; } + /* Did we reach EOR? */ if ((uio->uio_resid == 0) && ((user_marks_eor == 0) || @@ -13387,6 +13421,7 @@ skip_preblock: SOCKBUF_UNLOCK(&so->so_snd); goto out_unlocked; } + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_BLK_LOGGING_ENABLE) { sctp_log_block(SCTP_BLOCK_LOG_OUTOF_BLK, asoc, stcb->asoc.total_output_queue_size); @@ -13752,6 +13787,7 @@ sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sc SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, (struct sockaddr *)src6); return (0); } + SCTPDBG(SCTP_DEBUG_OUTPUT2, "v6src_match_nexthop(), Prefix entry is "); SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT2, (struct sockaddr *)src6); From owner-svn-src-all@freebsd.org Sun May 5 08:08:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99A691581C70; Sun, 5 May 2019 08:08:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 392928AB53; Sun, 5 May 2019 08:08:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 075B91CD03; Sun, 5 May 2019 08:08:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4588Fus093646; Sun, 5 May 2019 08:08:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4588F37093645; Sun, 5 May 2019 08:08:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905050808.x4588F37093645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 08:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347144 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 392928AB53 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 08:08:16 -0000 Author: tuexen Date: Sun May 5 08:08:15 2019 New Revision: 347144 URL: https://svnweb.freebsd.org/changeset/base/347144 Log: MFC r335179: Provide the ip6_plen in network byte order when calling ip6_output(). This is not strictly required by ip6_output(), since it overrides it, but it is needed for upcoming dtrace support. Modified: stable/11/sys/netinet/sctp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sun May 5 08:06:32 2019 (r347143) +++ stable/11/sys/netinet/sctp_output.c Sun May 5 08:08:15 2019 (r347144) @@ -4394,7 +4394,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, } else { ip6h->ip6_nxt = IPPROTO_SCTP; } - ip6h->ip6_plen = (uint16_t)(packet_length - sizeof(struct ip6_hdr)); + ip6h->ip6_plen = htons(packet_length - sizeof(struct ip6_hdr)); ip6h->ip6_dst = sin6->sin6_addr; /* @@ -11257,7 +11257,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad #endif #ifdef INET6 case AF_INET6: - ip6->ip6_plen = (uint16_t)(len - sizeof(struct ip6_hdr)); + ip6->ip6_plen = htons(len - sizeof(struct ip6_hdr)); if (port) { shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); From owner-svn-src-all@freebsd.org Sun May 5 09:02:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1FAF158380D; Sun, 5 May 2019 09:02:34 +0000 (UTC) (envelope-from cs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7254B8C3BC; Sun, 5 May 2019 09:02:34 +0000 (UTC) (envelope-from cs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3246A1D6FB; Sun, 5 May 2019 09:02:34 +0000 (UTC) (envelope-from cs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4592YFT024968; Sun, 5 May 2019 09:02:34 GMT (envelope-from cs@FreeBSD.org) Received: (from cs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4592XO9024963; Sun, 5 May 2019 09:02:33 GMT (envelope-from cs@FreeBSD.org) Message-Id: <201905050902.x4592XO9024963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cs set sender to cs@FreeBSD.org using -f From: Carlo Strub Date: Sun, 5 May 2019 09:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347145 - in head/share: syscons/keymaps vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: cs X-SVN-Commit-Paths: in head/share: syscons/keymaps vt/keymaps X-SVN-Commit-Revision: 347145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7254B8C3BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 09:02:35 -0000 Author: cs (ports committer) Date: Sun May 5 09:02:32 2019 New Revision: 347145 URL: https://svnweb.freebsd.org/changeset/base/347145 Log: Colemak Mod DH keyboard layout This is a minor modification of the Colemak keyboard layout. See: http://colemakmods.github.io/mod-dh/ Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D20133 Added: head/share/syscons/keymaps/colemak-dh.iso15.acc.kbd (contents, props changed) head/share/vt/keymaps/colemak-dh.acc.kbd (contents, props changed) Modified: head/share/syscons/keymaps/INDEX.keymaps head/share/syscons/keymaps/Makefile head/share/vt/keymaps/INDEX.keymaps head/share/vt/keymaps/Makefile Modified: head/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- head/share/syscons/keymaps/INDEX.keymaps Sun May 5 08:08:15 2019 (r347144) +++ head/share/syscons/keymaps/INDEX.keymaps Sun May 5 09:02:32 2019 (r347145) @@ -90,6 +90,7 @@ ce.iso2.kbd:de:Zentral Europisch ISO-8859-2 ce.iso2.kbd:fr:Centre europen ISO-8859-2 ce.iso2.kbd:es:Centroeuropeo ISO-8859-2 +colemak-dh.iso15.acc.kbd:en:Colemak Mod-DH ergonomic alternative colemak.iso15.acc.kbd:en:Colemak ergonomic alternative cs.latin2.qwertz.kbd:en:Czech ISO-8859-2 (QWERTZ, accent keys) Modified: head/share/syscons/keymaps/Makefile ============================================================================== --- head/share/syscons/keymaps/Makefile Sun May 5 08:08:15 2019 (r347144) +++ head/share/syscons/keymaps/Makefile Sun May 5 09:02:32 2019 (r347145) @@ -6,6 +6,7 @@ FILES= INDEX.keymaps \ br275.iso.kbd br275.iso.acc.kbd br275.cp850.kbd \ by.cp1131.kbd by.cp1251.kbd by.iso5.kbd \ ce.iso2.kbd \ + colemak-dh.iso15.acc.kbd \ colemak.iso15.acc.kbd \ cs.latin2.qwertz.kbd \ cz.iso2.kbd \ Added: head/share/syscons/keymaps/colemak-dh.iso15.acc.kbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/syscons/keymaps/colemak-dh.iso15.acc.kbd Sun May 5 09:02:32 2019 (r347145) @@ -0,0 +1,151 @@ +# $FreeBSD$ +# +# Colemak Mod-DH (rev. 2) layout for FreeBSD console +# 2006-01-01 Shai Coleman (http://colemak.com/), +# 2014-10-27 Steve P (http://colemakmods.github.io/mod-dh/). +# Public domain. + +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + + 041 '`' '~' nop nop dtil '~' nop nop O + 002 '1' '!' nop nop '¡' '¹' nop nop O + 003 '2' '@' nul nul 'º' '²' nul nul O + 004 '3' '#' nop nop 'ª' '³' nop nop O + 005 '4' '$' nop nop '¢' '£' nop nop O + 006 '5' '%' nop nop '¤' '¥' nop nop O + 007 '6' '^' rs rs '~' '~' rs rs O + 008 '7' '&' nop nop 'ð' 'Ð' nop nop O + 009 '8' '*' nop nop 'þ' 'Þ' nop nop O + 010 '9' '(' nop nop '~' '~' nop nop O + 011 '0' ')' nop nop '~' '~' nop nop O + 012 '-' '_' us us '~' '~' us us O + 013 '=' '+' nop nop '×' '÷' nop nop O + + 016 'q' 'Q' dc1 dc1 'ä' 'Ä' dc1 dc1 C + 017 'w' 'W' etb etb 'å' 'Å' etb etb C + 018 'f' 'F' ack ack 'ã' 'Ã' ack ack C + 019 'p' 'P' dle dle 'ø' 'Ø' dle dle C + 020 'b' 'B' bel bel '~' '~' bel bel C + 021 'j' 'J' nl nl '~' '~' nl nl C + 022 'l' 'L' ff ff '~' '~' ff ff C + 023 'u' 'U' nak nak 'ú' 'Ú' nak nak C + 024 'y' 'Y' em em 'ü' 'Ü' em em C + 025 ';' ':' nop nop 'ö' 'Ö' nop nop O + 026 '[' '{' esc esc '«' '~' esc esc O + 027 ']' '}' gs gs '»' '~' gs gs O + 043 '\' '|' fs fs '~' '~' fs fs O + + 030 'a' 'A' soh soh 'á' 'Á' soh soh C + 031 'r' 'R' dc2 dc2 dgra '~' dc2 dc2 C + 032 's' 'S' dc3 dc3 'ß' '~' dc3 dc3 C + 033 't' 'T' dc4 dc4 dacu '~' dc4 dc4 C + 034 'g' 'G' eot eot duml '~' eot eot C + 035 'k' 'K' bs bs '~' '~' bs bs C + 036 'n' 'N' so so 'ñ' 'Ñ' so so C + 037 'e' 'E' enq enq 'é' 'É' enq enq C + 038 'i' 'I' ht ht 'í' 'Í' ht ht C + 039 'o' 'O' si si 'ó' 'Ó' si si C + 040 ''' '"' nop nop 'õ' 'Õ' nop nop O + + 044 'z' 'Z' sub sub 'æ' 'Æ' sub sub C + 045 'x' 'X' can can dcir '~' can can C + 046 'c' 'C' etx etx 'ç' 'Ç' etx etx C + 047 'd' 'D' syn syn '½' '¼' syn syn C + 048 'v' 'V' stx stx '~' '~' stx stx C + 049 'm' 'M' vt vt drin '~' vt vt C + 050 'h' 'H' cr cr '~' '~' cr cr C + 051 ',' '<' nop nop dced '~' nop nop O + 052 '.' '>' nop nop '~' '~' nop nop O + 053 '/' '?' nop nop '¿' '~' nop nop O + + 058 bs bs bs bs bs bs bs bs O + 086 '-' '_' us us '~' '~' us us O + 057 ' ' ' ' nul nul ' ' ' ' susp susp O + + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug debug O + 014 bs bs del del bs bs del del O + 015 ht btab nscr nscr ht btab nop nop O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr nscr nop nop debug debug debug debug O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 saver saver susp susp nop nop susp susp O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + + dgra '`' ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 ) + ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 ) + ( 'u' 249 ) ( 'U' 217 ) + dacu 180 ( 'a' 225 ) ( 'A' 193 ) ( 'e' 233 ) ( 'E' 201 ) + ( 'i' 237 ) ( 'I' 205 ) ( 'o' 243 ) ( 'O' 211 ) + ( 'u' 250 ) ( 'U' 218 ) ( 'y' 253 ) ( 'Y' 221 ) + dcir '^' ( 'a' 226 ) ( 'A' 194 ) ( 'e' 234 ) ( 'E' 202 ) + ( 'i' 238 ) ( 'I' 206 ) ( 'o' 244 ) ( 'O' 212 ) + ( 'u' 251 ) ( 'U' 219 ) + dtil '~' ( 'a' 227 ) ( 'A' 195 ) ( 'n' 241 ) ( 'N' 209 ) + ( 'o' 245 ) ( 'O' 213 ) + dmac 000 + dbre 000 + ddot 000 + duml 168 ( 'a' 228 ) ( 'A' 196 ) ( 'e' 235 ) ( 'E' 203 ) + ( 'i' 239 ) ( 'I' 207 ) ( 'o' 246 ) ( 'O' 214 ) + ( 'u' 252 ) ( 'U' 220 ) ( 'y' 255 ) + dsla 000 + drin 176 ( 'a' 229 ) ( 'A' 197 ) + dced 184 ( 'c' 231 ) ( 'C' 199 ) + dapo 000 + ddac 000 + dogo 000 + dcar 000 Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Sun May 5 08:08:15 2019 (r347144) +++ head/share/vt/keymaps/INDEX.keymaps Sun May 5 09:02:32 2019 (r347145) @@ -84,6 +84,7 @@ centraleuropean.qwerty.kbd:de:Zentral Europäisch (QWE centraleuropean.qwerty.kbd:fr:Centre européen (QWERTY) centraleuropean.qwerty.kbd:es:Centroeuropeo (QWERTY) +colemak-dh.acc.kbd:en:Colemak Mod-DH ergonomic alternative colemak.acc.kbd:en:Colemak ergonomic alternative cz.kbd:en:Czech (QWERTZ, accent keys) Modified: head/share/vt/keymaps/Makefile ============================================================================== --- head/share/vt/keymaps/Makefile Sun May 5 08:08:15 2019 (r347144) +++ head/share/vt/keymaps/Makefile Sun May 5 09:02:32 2019 (r347145) @@ -18,6 +18,7 @@ FILES= INDEX.keymaps \ ch.acc.kbd \ ch.kbd \ ch.macbook.acc.kbd \ + colemak-dh.acc.kbd \ colemak.acc.kbd \ cz.kbd \ de.acc.kbd \ Added: head/share/vt/keymaps/colemak-dh.acc.kbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/colemak-dh.acc.kbd Sun May 5 09:02:32 2019 (r347145) @@ -0,0 +1,149 @@ +# $FreeBSD $ +# +# Colemak Mod-DH (rev. 2) layout for FreeBSD console +# 2006-01-01 Shai Coleman (http://colemak.com/), +# 2014-10-27 Steve P (http://colemakmods.github.io/mod-dh/). +# Public domain. + +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + + 041 '`' '~' nop nop dtil '~' nop nop O + 002 '1' '!' nop nop 0xa1 0xb9 nop nop O + 003 '2' '@' nul nul 0xba 0xb2 nul nul O + 004 '3' '#' nop nop 0xaa 0xb3 nop nop O + 005 '4' '$' nop nop 0xa2 0xa3 nop nop O + 006 '5' '%' nop nop 0xa4 0xa5 nop nop O + 007 '6' '^' rs rs '~' '~' rs rs O + 008 '7' '&' nop nop 0xf0 0xd0 nop nop O + 009 '8' '*' nop nop 0xfe 0xde nop nop O + 010 '9' '(' nop nop '~' '~' nop nop O + 011 '0' ')' nop nop '~' '~' nop nop O + 012 '-' '_' us us '~' '~' us us O + 013 '=' '+' nop nop 0xd7 0xf7 nop nop O + + 016 'q' 'Q' dc1 dc1 0xe4 0xc4 dc1 dc1 C + 017 'w' 'W' etb etb 0xe5 0xc5 etb etb C + 018 'f' 'F' ack ack 0xe3 0xc3 ack ack C + 019 'p' 'P' dle dle 0xf8 0xd8 dle dle C + 020 'b' 'B' bel bel '~' '~' bel bel C + 021 'j' 'J' nl nl '~' '~' nl nl C + 022 'l' 'L' ff ff '~' '~' ff ff C + 023 'u' 'U' nak nak 0xfa 0xda nak nak C + 024 'y' 'Y' em em 0xfc 0xdc em em C + 025 ';' ':' nop nop 0xf6 0xd6 nop nop O + 026 '[' '{' esc esc 0xab '~' esc esc O + 027 ']' '}' gs gs 0xbb '~' gs gs O + 043 '\' '|' fs fs '~' '~' fs fs O + + 030 'a' 'A' soh soh 0xe1 0xc1 soh soh C + 031 'r' 'R' dc2 dc2 dgra '~' dc2 dc2 C + 032 's' 'S' dc3 dc3 0xdf '~' dc3 dc3 C + 033 't' 'T' dc4 dc4 dacu '~' dc4 dc4 C + 034 'g' 'G' eot eot duml '~' eot eot C + 035 'k' 'K' bs bs '~' '~' bs bs C + 036 'n' 'N' so so 0xf1 0xd1 so so C + 037 'e' 'E' enq enq 0xe9 0xc9 enq enq C + 038 'i' 'I' ht ht 0xed 0xcd ht ht C + 039 'o' 'O' si si 0xf3 0xd3 si si C + 040 ''' '"' nop nop 0xf5 0xd5 nop nop O + + 044 'z' 'Z' sub sub 0xe6 0xc6 sub sub C + 045 'x' 'X' can can dcir '~' can can C + 046 'c' 'C' etx etx 0xe7 0xc7 etx etx C + 047 'd' 'D' syn syn 0xbd 0xbc syn syn C + 048 'v' 'V' stx stx '~' '~' stx stx C + 049 'm' 'M' vt vt drin '~' vt vt C + 050 'h' 'H' cr cr '~' '~' cr cr C + 051 ',' '<' nop nop dced '~' nop nop O + 052 '.' '>' nop nop '~' '~' nop nop O + 053 '/' '?' nop nop 0xbf '~' nop nop O + + 058 bs bs bs bs bs bs bs bs O + 086 '-' '_' us us '~' '~' us us O + 057 ' ' ' ' nul nul ' ' ' ' susp susp O + + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug debug O + 014 bs bs del del bs bs del del O + 015 ht btab nscr nscr ht btab nop nop O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr nscr nop nop debug debug debug debug O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 saver saver susp susp nop nop susp susp O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + + dgra '`' ( 'a' 0xe0 ) ( 'A' 0xc0 ) ( 'e' 0xe8 ) ( 'E' 0xc8 ) + ( 'i' 0xec ) ( 'I' 0xcc ) ( 'o' 0xf2 ) ( 'O' 0xd2 ) + ( 'u' 0xf9 ) ( 'U' 0xd9 ) + + dacu 0xb4 ( 'a' 0xe1 ) ( 'A' 0xc1 ) ( 'e' 0xe9 ) ( 'E' 0xc9 ) + ( 'i' 0xed ) ( 'I' 0xcd ) ( 'o' 0xf3 ) ( 'O' 0xd3 ) + ( 'u' 0xfa ) ( 'U' 0xda ) ( 'y' 0xfd ) ( 'Y' 0xdd ) + + dcir '^' ( 'a' 0xe2 ) ( 'A' 0xc2 ) ( 'e' 0xea ) ( 'E' 0xca ) + ( 'i' 0xee ) ( 'I' 0xce ) ( 'o' 0xf4 ) ( 'O' 0xd4 ) + ( 'u' 0xfb ) ( 'U' 0xdb ) + + dtil '~' ( 'a' 0xe3 ) ( 'A' 0xc3 ) ( 'n' 0xf1 ) ( 'N' 0xd1 ) + ( 'o' 0xf5 ) ( 'O' 0xd5 ) + + duml 0xa8 ( 'a' 0xe4 ) ( 'A' 0xc4 ) ( 'e' 0xeb ) ( 'E' 0xcb ) + ( 'i' 0xef ) ( 'I' 0xcf ) ( 'o' 0xf6 ) ( 'O' 0xd6 ) + ( 'u' 0xfc ) ( 'U' 0xdc ) ( 'y' 0xff ) + + drin 0xb0 ( 'a' 0xe5 ) ( 'A' 0xc5 ) + + dced 0xb8 ( 'c' 0xe7 ) ( 'C' 0xc7 ) From owner-svn-src-all@freebsd.org Sun May 5 10:42:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B15701585D25; Sun, 5 May 2019 10:42:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5262F8E961; Sun, 5 May 2019 10:42:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 294CF1E78D; Sun, 5 May 2019 10:42:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45AgXQN076532; Sun, 5 May 2019 10:42:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45AgWMP076529; Sun, 5 May 2019 10:42:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051042.x45AgWMP076529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 10:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347146 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5262F8E961 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 10:42:33 -0000 Author: tuexen Date: Sun May 5 10:42:32 2019 New Revision: 347146 URL: https://svnweb.freebsd.org/changeset/base/347146 Log: MFC r333604: sctp_get_mbuf_for_msg() should honor the allinone parameter. When it is not required that the buffer is not a chain, return a chain. This is based on a patch provided by Irene Ruengeler. Modified: stable/11/sys/netinet/sctp_bsd_addr.c stable/11/sys/netinet/sctp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/11/sys/netinet/sctp_bsd_addr.c Sun May 5 09:02:32 2019 (r347145) +++ stable/11/sys/netinet/sctp_bsd_addr.c Sun May 5 10:42:32 2019 (r347146) @@ -385,10 +385,7 @@ sctp_get_mbuf_for_msg(unsigned int space_needed, int w m_freem(m); return (NULL); } - } - if (SCTP_BUF_NEXT(m)) { - sctp_m_freem(SCTP_BUF_NEXT(m)); - SCTP_BUF_NEXT(m) = NULL; + KASSERT(SCTP_BUF_NEXT(m) == NULL, ("%s: no chain allowed", __FUNCTION__)); } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sun May 5 09:02:32 2019 (r347145) +++ stable/11/sys/netinet/sctp_output.c Sun May 5 10:42:32 2019 (r347146) @@ -7467,7 +7467,7 @@ dont_do_it: /* Not enough room for a chunk header, get some */ struct mbuf *m; - m = sctp_get_mbuf_for_msg(1, 0, M_NOWAIT, 0, MT_DATA); + m = sctp_get_mbuf_for_msg(1, 0, M_NOWAIT, 1, MT_DATA); if (m == NULL) { /* * we're in trouble here. _PREPEND below will free From owner-svn-src-all@freebsd.org Sun May 5 10:57:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C43615872A6; Sun, 5 May 2019 10:57:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03F338EF54; Sun, 5 May 2019 10:57:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCE411E969; Sun, 5 May 2019 10:57:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45AvRHJ081964; Sun, 5 May 2019 10:57:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45AvRvB081963; Sun, 5 May 2019 10:57:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051057.x45AvRvB081963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 10:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347147 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03F338EF54 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 10:57:28 -0000 Author: tuexen Date: Sun May 5 10:57:27 2019 New Revision: 347147 URL: https://svnweb.freebsd.org/changeset/base/347147 Log: MFC r333979: Make clear why there is an assignment, which is not necessary. To resolve the merge conflict, this also contains the changes from r333869. Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sun May 5 10:42:32 2019 (r347146) +++ stable/11/sys/netinet/sctp_indata.c Sun May 5 10:57:27 2019 (r347147) @@ -1669,9 +1669,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc struct sctp_nets *net, uint32_t *high_tsn, int *abort_flag, int *break_flag, int last_chunk, uint8_t chk_type) { - /* Process a data chunk */ - /* struct sctp_tmit_chunk *chk; */ - struct sctp_tmit_chunk *chk; + struct sctp_tmit_chunk *chk = NULL; /* make gcc happy */ uint32_t tsn, fsn, gap, mid; struct mbuf *dmbuf; int the_len; From owner-svn-src-all@freebsd.org Sun May 5 11:04:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2172715875AF; Sun, 5 May 2019 11:04:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B920E8F369; Sun, 5 May 2019 11:04:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90C601EB0C; Sun, 5 May 2019 11:04:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45B41BC086848; Sun, 5 May 2019 11:04:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45B41Jr086847; Sun, 5 May 2019 11:04:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905051104.x45B41Jr086847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 5 May 2019 11:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347148 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B920E8F369 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 11:04:02 -0000 Author: kib Date: Sun May 5 11:04:01 2019 New Revision: 347148 URL: https://svnweb.freebsd.org/changeset/base/347148 Log: imgact_elf: do not relock the text vnode if possible. We unlock the vnode around malloc(M_WAITOK), to make it possible for pagedaemon to flush vnode pages for us. Instead of doing it unconditionally, first try M_NOWAIT allocation, which typically succeed. Only on failure, unlock the vnode and retry with M_WAITOK. Reviewed by: markj, trasz Tested by: mjg, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D19923 Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sun May 5 10:57:27 2019 (r347147) +++ head/sys/kern/imgact_elf.c Sun May 5 11:04:01 2019 (r347148) @@ -957,9 +957,12 @@ __elfN(get_interp)(struct image_params *imgp, const El interp_name_len = phdr->p_filesz; if (phdr->p_offset > PAGE_SIZE || interp_name_len > PAGE_SIZE - phdr->p_offset) { - VOP_UNLOCK(imgp->vp, 0); - interp = malloc(interp_name_len + 1, M_TEMP, M_WAITOK); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + interp = malloc(interp_name_len + 1, M_TEMP, M_NOWAIT); + if (interp == NULL) { + VOP_UNLOCK(imgp->vp, 0); + interp = malloc(interp_name_len + 1, M_TEMP, M_WAITOK); + vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + } error = vn_rdwr(UIO_READ, imgp->vp, interp, interp_name_len, phdr->p_offset, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, @@ -1278,7 +1281,12 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i /* * Construct auxargs table (used by the fixup routine) */ - elf_auxargs = malloc(sizeof(Elf_Auxargs), M_TEMP, M_WAITOK); + elf_auxargs = malloc(sizeof(Elf_Auxargs), M_TEMP, M_NOWAIT); + if (elf_auxargs == NULL) { + VOP_UNLOCK(imgp->vp, 0); + elf_auxargs = malloc(sizeof(Elf_Auxargs), M_TEMP, M_WAITOK); + vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + } elf_auxargs->execfd = -1; elf_auxargs->phdr = proghdr + et_dyn_addr; elf_auxargs->phent = hdr->e_phentsize; @@ -2558,9 +2566,12 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Not ASSERT_VOP_LOCKED(imgp->vp, "parse_notes"); if (pnote->p_offset > PAGE_SIZE || pnote->p_filesz > PAGE_SIZE - pnote->p_offset) { - VOP_UNLOCK(imgp->vp, 0); - buf = malloc(pnote->p_filesz, M_TEMP, M_WAITOK); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + buf = malloc(pnote->p_filesz, M_TEMP, M_NOWAIT); + if (buf == NULL) { + VOP_UNLOCK(imgp->vp, 0); + buf = malloc(pnote->p_filesz, M_TEMP, M_WAITOK); + vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + } error = vn_rdwr(UIO_READ, imgp->vp, buf, pnote->p_filesz, pnote->p_offset, UIO_SYSSPACE, IO_NODELOCKED, curthread->td_ucred, NOCRED, NULL, curthread); From owner-svn-src-all@freebsd.org Sun May 5 11:05:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E40A0158766F; Sun, 5 May 2019 11:05:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89B178F4E9; Sun, 5 May 2019 11:05:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 665B61EB17; Sun, 5 May 2019 11:05:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45B5bqI086958; Sun, 5 May 2019 11:05:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45B5b4C086957; Sun, 5 May 2019 11:05:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051105.x45B5b4C086957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 11:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347149 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89B178F4E9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 11:05:38 -0000 Author: tuexen Date: Sun May 5 11:05:36 2019 New Revision: 347149 URL: https://svnweb.freebsd.org/changeset/base/347149 Log: MFC r333980: Do the appropriate accounting when ip_output() fails. Manually remove a merge conflict. Modified: stable/11/sys/netinet/sctp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sun May 5 11:04:01 2019 (r347148) +++ stable/11/sys/netinet/sctp_output.c Sun May 5 11:05:36 2019 (r347149) @@ -11055,9 +11055,8 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad struct sctp_chunkhdr *ch; #if defined(INET) || defined(INET6) struct udphdr *udp; - int ret; #endif - int len, cause_len, padding_len; + int ret, len, cause_len, padding_len; #ifdef INET struct sockaddr_in *src_sin, *dst_sin; struct ip *ip; @@ -11284,9 +11283,13 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad SCTP_LTRACE_ERR_RET_PKT(mout, NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); return; } + SCTPDBG(SCTP_DEBUG_OUTPUT3, "return from send is %d\n", ret); SCTP_STAT_INCR(sctps_sendpackets); SCTP_STAT_INCR_COUNTER64(sctps_outpackets); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); + if (ret) { + SCTP_STAT_INCR(sctps_senderrors); + } return; } From owner-svn-src-all@freebsd.org Sun May 5 11:06:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD79915876FC; Sun, 5 May 2019 11:06:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 823648F60A; Sun, 5 May 2019 11:06:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DA571EB18; Sun, 5 May 2019 11:06:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45B6KTL087046; Sun, 5 May 2019 11:06:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45B6Ktw087045; Sun, 5 May 2019 11:06:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905051106.x45B6Ktw087045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 5 May 2019 11:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347150 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 347150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 823648F60A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 11:06:21 -0000 Author: kib Date: Sun May 5 11:06:19 2019 New Revision: 347150 URL: https://svnweb.freebsd.org/changeset/base/347150 Log: Do not collapse objects with OBJ_NOSPLIT backing swap object. NOSPLIT swap objects are not anonymous, they are used by tmpfs regular files and POSIX shared memory. For such objects, collapse is not permitted. Reported by: mjg Reviewed by: markj, trasz Tested by: mjg, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D19923 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun May 5 11:05:36 2019 (r347149) +++ head/sys/vm/vm_object.c Sun May 5 11:06:19 2019 (r347150) @@ -1748,7 +1748,8 @@ vm_object_collapse(vm_object_t object) VM_OBJECT_WLOCK(backing_object); if (backing_object->handle != NULL || (backing_object->type != OBJT_DEFAULT && - backing_object->type != OBJT_SWAP) || + (backing_object->type != OBJT_SWAP || + (backing_object->flags & OBJ_NOSPLIT) != 0)) || (backing_object->flags & OBJ_DEAD) || object->handle != NULL || (object->type != OBJT_DEFAULT && From owner-svn-src-all@freebsd.org Sun May 5 11:20:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D9515880F6; Sun, 5 May 2019 11:20:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD1028FD9F; Sun, 5 May 2019 11:20:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 705F31ECE2; Sun, 5 May 2019 11:20:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45BKlC7092738; Sun, 5 May 2019 11:20:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45BKi23092719; Sun, 5 May 2019 11:20:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905051120.x45BKi23092719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 5 May 2019 11:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347151 - in head: libexec/rtld-elf sys/compat/linux sys/fs/deadfs sys/fs/nfsclient sys/fs/nullfs sys/fs/unionfs sys/kern sys/sys sys/ufs/ufs sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: libexec/rtld-elf sys/compat/linux sys/fs/deadfs sys/fs/nfsclient sys/fs/nullfs sys/fs/unionfs sys/kern sys/sys sys/ufs/ufs sys/vm X-SVN-Commit-Revision: 347151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AD1028FD9F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 11:20:48 -0000 Author: kib Date: Sun May 5 11:20:43 2019 New Revision: 347151 URL: https://svnweb.freebsd.org/changeset/base/347151 Log: Switch to use shared vnode locks for text files during image activation. kern_execve() locks text vnode exclusive to be able to set and clear VV_TEXT flag. VV_TEXT is mutually exclusive with the v_writecount > 0 condition. The change removes VV_TEXT, replacing it with the condition v_writecount <= -1, and puts v_writecount under the vnode interlock. Each text reference decrements v_writecount. To clear the text reference when the segment is unmapped, it is recorded in the vm_map_entry backed by the text file as MAP_ENTRY_VN_TEXT flag, and v_writecount is incremented on the map entry removal The operations like VOP_ADD_WRITECOUNT() and VOP_SET_TEXT() check that v_writecount does not contradict the desired change. vn_writecheck() is now racy and its use was eliminated everywhere except access. Atomic check for writeability and increment of v_writecount is performed by the VOP. vn_truncate() now increments v_writecount around VOP_SETATTR() call, lack of which is arguably a bug on its own. nullfs bypasses v_writecount to the lower vnode always, so nullfs vnode has its own v_writecount correct, and lower vnode gets all references, since object->handle is always lower vnode. On the text vnode' vm object dealloc, the v_writecount value is reset to zero, and deadfs vop_unset_text short-circuit the operation. Reclamation of lowervp always reclaims all nullfs vnodes referencing lowervp first, so no stray references are left. Reviewed by: markj, trasz Tested by: mjg, pho Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D19923 Modified: head/libexec/rtld-elf/rtld.c head/sys/compat/linux/linux_misc.c head/sys/fs/deadfs/dead_vnops.c head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nullfs/null_vnops.c head/sys/fs/unionfs/union_subr.c head/sys/kern/imgact_aout.c head/sys/kern/imgact_elf.c head/sys/kern/kern_exec.c head/sys/kern/vfs_default.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_vnops.c head/sys/kern/vnode_if.src head/sys/sys/imgact.h head/sys/sys/vnode.h head/sys/ufs/ufs/ufs_extattr.c head/sys/vm/vm_fault.c head/sys/vm/vm_map.c head/sys/vm/vm_map.h head/sys/vm/vm_mmap.c head/sys/vm/vm_object.c head/sys/vm/vnode_pager.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sun May 5 11:06:19 2019 (r347150) +++ head/libexec/rtld-elf/rtld.c Sun May 5 11:20:43 2019 (r347151) @@ -458,7 +458,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr * others x bit is enabled. * mmap(2) does not allow to mmap with PROT_EXEC if * binary' file comes from noexec mount. We cannot - * set VV_TEXT on the binary. + * set a text reference on the binary. */ dir_enable = false; if (st.st_uid == geteuid()) { Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/compat/linux/linux_misc.c Sun May 5 11:20:43 2019 (r347151) @@ -258,13 +258,16 @@ linux_uselib(struct thread *td, struct linux_uselib_ar struct nameidata ni; struct vnode *vp; struct exec *a_out; + vm_map_t map; + vm_map_entry_t entry; struct vattr attr; vm_offset_t vmaddr; unsigned long file_offset; unsigned long bss_size; char *library; ssize_t aresid; - int error, locked, writecount; + int error; + bool locked, opened, textset; LCONVPATHEXIST(td, args->library, &library); @@ -274,8 +277,10 @@ linux_uselib(struct thread *td, struct linux_uselib_ar #endif a_out = NULL; - locked = 0; vp = NULL; + locked = false; + textset = false; + opened = false; NDINIT(&ni, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_SYSSPACE, library, td); @@ -291,17 +296,8 @@ linux_uselib(struct thread *td, struct linux_uselib_ar * From here on down, we have a locked vnode that must be unlocked. * XXX: The code below largely duplicates exec_check_permissions(). */ - locked = 1; + locked = true; - /* Writable? */ - error = VOP_GET_WRITECOUNT(vp, &writecount); - if (error != 0) - goto cleanup; - if (writecount != 0) { - error = ETXTBSY; - goto cleanup; - } - /* Executable? */ error = VOP_GETATTR(vp, &attr, td->td_ucred); if (error) @@ -339,6 +335,7 @@ linux_uselib(struct thread *td, struct linux_uselib_ar error = VOP_OPEN(vp, FREAD, td->td_ucred, td, NULL); if (error) goto cleanup; + opened = true; /* Pull in executable header into exec_map */ error = vm_mmap(exec_map, (vm_offset_t *)&a_out, PAGE_SIZE, @@ -401,15 +398,16 @@ linux_uselib(struct thread *td, struct linux_uselib_ar /* * Prevent more writers. - * XXX: Note that if any of the VM operations fail below we don't - * clear this flag. */ - VOP_SET_TEXT(vp); + error = VOP_SET_TEXT(vp); + if (error != 0) + goto cleanup; + textset = true; /* * Lock no longer needed */ - locked = 0; + locked = false; VOP_UNLOCK(vp, 0); /* @@ -456,11 +454,21 @@ linux_uselib(struct thread *td, struct linux_uselib_ar * Map it all into the process's space as a single * copy-on-write "data" segment. */ - error = vm_mmap(&td->td_proc->p_vmspace->vm_map, &vmaddr, + map = &td->td_proc->p_vmspace->vm_map; + error = vm_mmap(map, &vmaddr, a_out->a_text + a_out->a_data, VM_PROT_ALL, VM_PROT_ALL, MAP_PRIVATE | MAP_FIXED, OBJT_VNODE, vp, file_offset); if (error) goto cleanup; + vm_map_lock(map); + if (!vm_map_lookup_entry(map, vmaddr, &entry)) { + vm_map_unlock(map); + error = EDOOFUS; + goto cleanup; + } + entry->eflags |= MAP_ENTRY_VN_EXEC; + vm_map_unlock(map); + textset = false; } #ifdef DEBUG printf("mem=%08lx = %08lx %08lx\n", (long)vmaddr, ((long *)vmaddr)[0], @@ -480,7 +488,14 @@ linux_uselib(struct thread *td, struct linux_uselib_ar } cleanup: - /* Unlock vnode if needed */ + if (opened) { + if (locked) + VOP_UNLOCK(vp, 0); + locked = false; + VOP_CLOSE(vp, FREAD, td->td_ucred, td); + } + if (textset) + VOP_UNSET_TEXT_CHECKED(vp); if (locked) VOP_UNLOCK(vp, 0); Modified: head/sys/fs/deadfs/dead_vnops.c ============================================================================== --- head/sys/fs/deadfs/dead_vnops.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/fs/deadfs/dead_vnops.c Sun May 5 11:20:43 2019 (r347151) @@ -47,6 +47,7 @@ static vop_lookup_t dead_lookup; static vop_open_t dead_open; static vop_getwritemount_t dead_getwritemount; static vop_rename_t dead_rename; +static vop_unset_text_t dead_unset_text; struct vop_vector dead_vnodeops = { .vop_default = &default_vnodeops, @@ -76,6 +77,7 @@ struct vop_vector dead_vnodeops = { .vop_setattr = VOP_EBADF, .vop_symlink = VOP_PANIC, .vop_vptocnp = VOP_EBADF, + .vop_unset_text = dead_unset_text, .vop_write = dead_write, }; @@ -147,4 +149,11 @@ dead_rename(struct vop_rename_args *ap) vop_rename_fail(ap); return (EXDEV); +} + +static int +dead_unset_text(struct vop_unset_text_args *ap) +{ + + return (0); } Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/fs/nfsclient/nfs_clbio.c Sun May 5 11:20:43 2019 (r347151) @@ -1639,7 +1639,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre } } /* ASSERT_VOP_LOCKED(vp, "ncl_doio"); */ - if (p && (vp->v_vflag & VV_TEXT)) { + if (p && vp->v_writecount <= -1) { mtx_lock(&np->n_mtx); if (NFS_TIMESPEC_COMPARE(&np->n_mtime, &np->n_vattr.na_mtime)) { mtx_unlock(&np->n_mtx); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sun May 5 11:20:43 2019 (r347151) @@ -3442,8 +3442,7 @@ nfs_set_text(struct vop_set_text_args *ap) np->n_mtime = np->n_vattr.na_mtime; mtx_unlock(&np->n_mtx); - vp->v_vflag |= VV_TEXT; - return (0); + return (vop_stdset_text(ap)); } /* Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/fs/nullfs/null_vnops.c Sun May 5 11:20:43 2019 (r347151) @@ -339,15 +339,15 @@ null_add_writecount(struct vop_add_writecount_args *ap vp = ap->a_vp; lvp = NULLVPTOLOWERVP(vp); - KASSERT(vp->v_writecount + ap->a_inc >= 0, ("wrong writecount inc")); - if (vp->v_writecount > 0 && vp->v_writecount + ap->a_inc == 0) - error = VOP_ADD_WRITECOUNT(lvp, -1); - else if (vp->v_writecount == 0 && vp->v_writecount + ap->a_inc > 0) - error = VOP_ADD_WRITECOUNT(lvp, 1); - else - error = 0; + VI_LOCK(vp); + /* text refs are bypassed to lowervp */ + VNASSERT(vp->v_writecount >= 0, vp, ("wrong null writecount")); + VNASSERT(vp->v_writecount + ap->a_inc >= 0, vp, + ("wrong writecount inc %d", ap->a_inc)); + error = VOP_ADD_WRITECOUNT(lvp, ap->a_inc); if (error == 0) vp->v_writecount += ap->a_inc; + VI_UNLOCK(vp); return (error); } @@ -802,15 +802,17 @@ null_reclaim(struct vop_reclaim_args *ap) vp->v_data = NULL; vp->v_object = NULL; vp->v_vnlock = &vp->v_lock; - VI_UNLOCK(vp); /* - * If we were opened for write, we leased one write reference + * If we were opened for write, we leased the write reference * to the lower vnode. If this is a reclamation due to the * forced unmount, undo the reference now. */ if (vp->v_writecount > 0) - VOP_ADD_WRITECOUNT(lowervp, -1); + VOP_ADD_WRITECOUNT(lowervp, -vp->v_writecount); + + VI_UNLOCK(vp); + if ((xp->null_flags & NULLV_NOUNLOCK) != 0) vunref(lowervp); else Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/fs/unionfs/union_subr.c Sun May 5 11:20:43 2019 (r347151) @@ -941,10 +941,14 @@ unionfs_vn_create_on_upper(struct vnode **vpp, struct vput(vp); goto unionfs_vn_create_on_upper_free_out1; } - VOP_ADD_WRITECOUNT(vp, 1); + error = VOP_ADD_WRITECOUNT(vp, 1); CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp, vp->v_writecount); - *vpp = vp; + if (error == 0) { + *vpp = vp; + } else { + VOP_CLOSE(vp, fmode, cred, td); + } unionfs_vn_create_on_upper_free_out1: VOP_UNLOCK(udvp, LK_RELEASE); @@ -1078,7 +1082,7 @@ unionfs_copyfile(struct unionfs_node *unp, int docopy, } } VOP_CLOSE(uvp, FWRITE, cred, td); - VOP_ADD_WRITECOUNT(uvp, -1); + VOP_ADD_WRITECOUNT_CHECKED(uvp, -1); CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", __func__, uvp, uvp->v_writecount); Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/kern/imgact_aout.c Sun May 5 11:20:43 2019 (r347151) @@ -247,8 +247,8 @@ exec_aout_imgact(struct image_params *imgp) /* data + bss can't exceed rlimit */ a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) || racct_set(imgp->proc, RACCT_DATA, a_out->a_data + bss_size) != 0) { - PROC_UNLOCK(imgp->proc); - return (ENOMEM); + PROC_UNLOCK(imgp->proc); + return (ENOMEM); } PROC_UNLOCK(imgp->proc); @@ -267,7 +267,7 @@ exec_aout_imgact(struct image_params *imgp) */ error = exec_new_vmspace(imgp, &aout_sysvec); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); if (error) return (error); @@ -286,12 +286,13 @@ exec_aout_imgact(struct image_params *imgp) file_offset, virtual_offset, text_end, VM_PROT_READ | VM_PROT_EXECUTE, VM_PROT_ALL, - MAP_COPY_ON_WRITE | MAP_PREFAULT); + MAP_COPY_ON_WRITE | MAP_PREFAULT | MAP_VN_EXEC); if (error) { vm_map_unlock(map); vm_object_deallocate(object); return (error); } + VOP_SET_TEXT_CHECKED(imgp->vp); data_end = text_end + a_out->a_data; if (a_out->a_data) { vm_object_reference(object); @@ -299,12 +300,13 @@ exec_aout_imgact(struct image_params *imgp) file_offset + a_out->a_text, text_end, data_end, VM_PROT_ALL, VM_PROT_ALL, - MAP_COPY_ON_WRITE | MAP_PREFAULT); + MAP_COPY_ON_WRITE | MAP_PREFAULT | MAP_VN_EXEC); if (error) { vm_map_unlock(map); vm_object_deallocate(object); return (error); } + VOP_SET_TEXT_CHECKED(imgp->vp); } if (bss_size) { Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/kern/imgact_elf.c Sun May 5 11:20:43 2019 (r347151) @@ -526,13 +526,17 @@ __elfN(map_insert)(struct image_params *imgp, vm_map_t } else { vm_object_reference(object); rv = vm_map_fixed(map, object, offset, start, end - start, - prot, VM_PROT_ALL, cow | MAP_CHECK_EXCL); + prot, VM_PROT_ALL, cow | MAP_CHECK_EXCL | + (object != NULL ? MAP_VN_EXEC : 0)); if (rv != KERN_SUCCESS) { locked = VOP_ISLOCKED(imgp->vp); VOP_UNLOCK(imgp->vp, 0); vm_object_deallocate(object); vn_lock(imgp->vp, locked | LK_RETRY); return (rv); + } else if (object != NULL) { + MPASS(imgp->vp->v_object == object); + VOP_SET_TEXT_CHECKED(imgp->vp); } } return (KERN_SUCCESS); @@ -589,13 +593,8 @@ __elfN(load_section)(struct image_params *imgp, vm_oof cow = MAP_COPY_ON_WRITE | MAP_PREFAULT | (prot & VM_PROT_WRITE ? 0 : MAP_DISABLE_COREDUMP); - rv = __elfN(map_insert)(imgp, map, - object, - file_addr, /* file offset */ - map_addr, /* virtual start */ - map_addr + map_len,/* virtual end */ - prot, - cow); + rv = __elfN(map_insert)(imgp, map, object, file_addr, + map_addr, map_addr + map_len, prot, cow); if (rv != KERN_SUCCESS) return (EINVAL); @@ -716,7 +715,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_ struct nameidata *nd; struct vattr *attr; struct image_params *imgp; - u_long flags, rbase; + u_long rbase; u_long base_addr = 0; int error; @@ -744,10 +743,8 @@ __elfN(load_file)(struct proc *p, const char *file, u_ imgp->object = NULL; imgp->execlabel = NULL; - flags = FOLLOW | LOCKSHARED | LOCKLEAF; - -again: - NDINIT(nd, LOOKUP, flags, UIO_SYSSPACE, file, curthread); + NDINIT(nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF, UIO_SYSSPACE, file, + curthread); if ((error = namei(nd)) != 0) { nd->ni_vp = NULL; goto fail; @@ -762,27 +759,6 @@ again: if (error) goto fail; - /* - * Also make certain that the interpreter stays the same, - * so set its VV_TEXT flag, too. Since this function is only - * used to load the interpreter, the VV_TEXT is almost always - * already set. - */ - if (VOP_IS_TEXT(nd->ni_vp) == 0) { - if (VOP_ISLOCKED(nd->ni_vp) != LK_EXCLUSIVE) { - /* - * LK_UPGRADE could have resulted in dropping - * the lock. Just try again from the start, - * this time with exclusive vnode lock. - */ - vput(nd->ni_vp); - flags &= ~LOCKSHARED; - goto again; - } - - VOP_SET_TEXT(nd->ni_vp); - } - error = exec_map_first_page(imgp); if (error) goto fail; @@ -825,9 +801,11 @@ fail: if (imgp->firstpage) exec_unmap_first_page(imgp); - if (nd->ni_vp) + if (nd->ni_vp) { + if (imgp->textset) + VOP_UNSET_TEXT_CHECKED(nd->ni_vp); vput(nd->ni_vp); - + } free(tempdata, M_TEMP); return (error); @@ -961,7 +939,7 @@ __elfN(get_interp)(struct image_params *imgp, const El if (interp == NULL) { VOP_UNLOCK(imgp->vp, 0); interp = malloc(interp_name_len + 1, M_TEMP, M_WAITOK); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); } error = vn_rdwr(UIO_READ, imgp->vp, interp, interp_name_len, phdr->p_offset, @@ -1228,7 +1206,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i maxv / 2, 1UL << flsl(maxalign)); } - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); if (error != 0) goto ret; @@ -1272,7 +1250,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i } error = __elfN(load_interp)(imgp, brand_info, interp, &addr, &imgp->entry_addr); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); if (error != 0) goto ret; } else @@ -1285,7 +1263,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i if (elf_auxargs == NULL) { VOP_UNLOCK(imgp->vp, 0); elf_auxargs = malloc(sizeof(Elf_Auxargs), M_TEMP, M_WAITOK); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); } elf_auxargs->execfd = -1; elf_auxargs->phdr = proghdr + et_dyn_addr; @@ -2570,7 +2548,7 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Not if (buf == NULL) { VOP_UNLOCK(imgp->vp, 0); buf = malloc(pnote->p_filesz, M_TEMP, M_WAITOK); - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); } error = vn_rdwr(UIO_READ, imgp->vp, buf, pnote->p_filesz, pnote->p_offset, UIO_SYSSPACE, IO_NODELOCKED, Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/kern/kern_exec.c Sun May 5 11:20:43 2019 (r347151) @@ -375,7 +375,6 @@ do_execve(struct thread *td, struct image_args *args, #endif struct vnode *oldtextvp = NULL, *newtextvp; int credential_changing; - int textset; #ifdef MAC struct label *interpvplabel = NULL; int will_transition; @@ -423,8 +422,8 @@ do_execve(struct thread *td, struct image_args *args, * interpreter if this is an interpreted binary. */ if (args->fname != NULL) { - NDINIT(&nd, LOOKUP, ISOPEN | LOCKLEAF | FOLLOW | SAVENAME - | AUDITVNODE1, UIO_SYSSPACE, args->fname, td); + NDINIT(&nd, LOOKUP, ISOPEN | LOCKLEAF | LOCKSHARED | FOLLOW | + SAVENAME | AUDITVNODE1, UIO_SYSSPACE, args->fname, td); } SDT_PROBE1(proc, , , exec, args->fname); @@ -457,13 +456,14 @@ interpret: error = fgetvp_exec(td, args->fd, &cap_fexecve_rights, &newtextvp); if (error) goto exec_fail; - vn_lock(newtextvp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(newtextvp, LK_SHARED | LK_RETRY); AUDIT_ARG_VNODE1(newtextvp); imgp->vp = newtextvp; } /* - * Check file permissions (also 'opens' file) + * Check file permissions. Also 'opens' file and sets its vnode to + * text mode. */ error = exec_check_permissions(imgp); if (error) @@ -473,16 +473,6 @@ interpret: if (imgp->object != NULL) vm_object_reference(imgp->object); - /* - * Set VV_TEXT now so no one can write to the executable while we're - * activating it. - * - * Remember if this was set before and unset it in case this is not - * actually an executable image. - */ - textset = VOP_IS_TEXT(imgp->vp); - VOP_SET_TEXT(imgp->vp); - error = exec_map_first_page(imgp); if (error) goto exec_fail_dealloc; @@ -610,11 +600,8 @@ interpret: } if (error) { - if (error == -1) { - if (textset == 0) - VOP_UNSET_TEXT(imgp->vp); + if (error == -1) error = ENOEXEC; - } goto exec_fail_dealloc; } @@ -625,12 +612,13 @@ interpret: if (imgp->interpreted) { exec_unmap_first_page(imgp); /* - * VV_TEXT needs to be unset for scripts. There is a short - * period before we determine that something is a script where - * VV_TEXT will be set. The vnode lock is held over this - * entire period so nothing should illegitimately be blocked. + * The text reference needs to be removed for scripts. + * There is a short period before we determine that + * something is a script where text reference is active. + * The vnode lock is held over this entire period + * so nothing should illegitimately be blocked. */ - VOP_UNSET_TEXT(imgp->vp); + VOP_UNSET_TEXT_CHECKED(imgp->vp); /* free name buffer and old vnode */ if (args->fname != NULL) NDFREE(&nd, NDF_ONLY_PNBUF); @@ -886,6 +874,8 @@ exec_fail_dealloc: NDFREE(&nd, NDF_ONLY_PNBUF); if (imgp->opened) VOP_CLOSE(imgp->vp, FREAD, td->td_ucred, td); + if (imgp->textset) + VOP_UNSET_TEXT_CHECKED(imgp->vp); if (error != 0) vput(imgp->vp); else @@ -1706,7 +1696,7 @@ exec_check_permissions(struct image_params *imgp) struct vnode *vp = imgp->vp; struct vattr *attr = imgp->attr; struct thread *td; - int error, writecount; + int error; td = curthread; @@ -1750,12 +1740,17 @@ exec_check_permissions(struct image_params *imgp) /* * Check number of open-for-writes on the file and deny execution * if there are any. + * + * Add a text reference now so no one can write to the + * executable while we're activating it. + * + * Remember if this was set before and unset it in case this is not + * actually an executable image. */ - error = VOP_GET_WRITECOUNT(vp, &writecount); + error = VOP_SET_TEXT(vp); if (error != 0) return (error); - if (writecount != 0) - return (ETXTBSY); + imgp->textset = true; /* * Call filesystem specific open routine (which does nothing in the Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/kern/vfs_default.c Sun May 5 11:20:43 2019 (r347151) @@ -81,9 +81,7 @@ static int dirent_exists(struct vnode *vp, const char #define DIRENT_MINSIZE (sizeof(struct dirent) - (MAXNAMLEN+1) + 4) static int vop_stdis_text(struct vop_is_text_args *ap); -static int vop_stdset_text(struct vop_set_text_args *ap); static int vop_stdunset_text(struct vop_unset_text_args *ap); -static int vop_stdget_writecount(struct vop_get_writecount_args *ap); static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); static int vop_stdfdatasync(struct vop_fdatasync_args *ap); static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); @@ -141,7 +139,6 @@ struct vop_vector default_vnodeops = { .vop_is_text = vop_stdis_text, .vop_set_text = vop_stdset_text, .vop_unset_text = vop_stdunset_text, - .vop_get_writecount = vop_stdget_writecount, .vop_add_writecount = vop_stdadd_writecount, }; @@ -1070,39 +1067,63 @@ static int vop_stdis_text(struct vop_is_text_args *ap) { - return ((ap->a_vp->v_vflag & VV_TEXT) != 0); + return (ap->a_vp->v_writecount < 0); } -static int +int vop_stdset_text(struct vop_set_text_args *ap) { + struct vnode *vp; + int error; - ap->a_vp->v_vflag |= VV_TEXT; - return (0); + vp = ap->a_vp; + VI_LOCK(vp); + if (vp->v_writecount > 0) { + error = ETXTBSY; + } else { + vp->v_writecount--; + error = 0; + } + VI_UNLOCK(vp); + return (error); } static int vop_stdunset_text(struct vop_unset_text_args *ap) { + struct vnode *vp; + int error; - ap->a_vp->v_vflag &= ~VV_TEXT; - return (0); + vp = ap->a_vp; + VI_LOCK(vp); + if (vp->v_writecount < 0) { + vp->v_writecount++; + error = 0; + } else { + error = EINVAL; + } + VI_UNLOCK(vp); + return (error); } static int -vop_stdget_writecount(struct vop_get_writecount_args *ap) -{ - - *ap->a_writecount = ap->a_vp->v_writecount; - return (0); -} - -static int vop_stdadd_writecount(struct vop_add_writecount_args *ap) { + struct vnode *vp; + int error; - ap->a_vp->v_writecount += ap->a_inc; - return (0); + vp = ap->a_vp; + VI_LOCK(vp); + if (vp->v_writecount < 0) { + error = ETXTBSY; + } else { + VNASSERT(vp->v_writecount + ap->a_inc >= 0, vp, + ("neg writecount increment %d", ap->a_inc)); + vp->v_writecount += ap->a_inc; + error = 0; + } + VI_UNLOCK(vp); + return (error); } /* Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/kern/vfs_subr.c Sun May 5 11:20:43 2019 (r347151) @@ -3491,8 +3491,6 @@ vn_printf(struct vnode *vp, const char *fmt, ...) strlcat(buf, "|VV_ETERNALDEV", sizeof(buf)); if (vp->v_vflag & VV_CACHEDLABEL) strlcat(buf, "|VV_CACHEDLABEL", sizeof(buf)); - if (vp->v_vflag & VV_TEXT) - strlcat(buf, "|VV_TEXT", sizeof(buf)); if (vp->v_vflag & VV_COPYONWRITE) strlcat(buf, "|VV_COPYONWRITE", sizeof(buf)); if (vp->v_vflag & VV_SYSTEM) @@ -3508,7 +3506,7 @@ vn_printf(struct vnode *vp, const char *fmt, ...) if (vp->v_vflag & VV_FORCEINSMQ) strlcat(buf, "|VV_FORCEINSMQ", sizeof(buf)); flags = vp->v_vflag & ~(VV_ROOT | VV_ISTTY | VV_NOSYNC | VV_ETERNALDEV | - VV_CACHEDLABEL | VV_TEXT | VV_COPYONWRITE | VV_SYSTEM | VV_PROCDEP | + VV_CACHEDLABEL | VV_COPYONWRITE | VV_SYSTEM | VV_PROCDEP | VV_NOKNOTE | VV_DELETED | VV_MD | VV_FORCEINSMQ); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VV(0x%lx)", flags); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/kern/vfs_vnops.c Sun May 5 11:20:43 2019 (r347151) @@ -294,6 +294,39 @@ bad: return (error); } +static int +vn_open_vnode_advlock(struct vnode *vp, int fmode, struct file *fp) +{ + struct flock lf; + int error, lock_flags, type; + + ASSERT_VOP_LOCKED(vp, "vn_open_vnode_advlock"); + if ((fmode & (O_EXLOCK | O_SHLOCK)) == 0) + return (0); + KASSERT(fp != NULL, ("open with flock requires fp")); + if (fp->f_type != DTYPE_NONE && fp->f_type != DTYPE_VNODE) + return (EOPNOTSUPP); + + lock_flags = VOP_ISLOCKED(vp); + VOP_UNLOCK(vp, 0); + + lf.l_whence = SEEK_SET; + lf.l_start = 0; + lf.l_len = 0; + lf.l_type = (fmode & O_EXLOCK) != 0 ? F_WRLCK : F_RDLCK; + type = F_FLOCK; + if ((fmode & FNONBLOCK) == 0) + type |= F_WAIT; + error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, type); + if (error == 0) + fp->f_flag |= FHASLOCK; + + vn_lock(vp, lock_flags | LK_RETRY); + if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) + error = ENOENT; + return (error); +} + /* * Common code for vnode open operations once a vnode is located. * Check permissions, and call the VOP_OPEN routine. @@ -303,8 +336,7 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucre struct thread *td, struct file *fp) { accmode_t accmode; - struct flock lf; - int error, lock_flags, type; + int error; if (vp->v_type == VLNK) return (EMLINK); @@ -335,63 +367,31 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucre accmode &= ~(VCREAT | VVERIFY); #endif - if ((fmode & O_CREAT) == 0) { - if (accmode & VWRITE) { - error = vn_writechk(vp); - if (error) - return (error); - } - if (accmode) { - error = VOP_ACCESS(vp, accmode, cred, td); - if (error) - return (error); - } + if ((fmode & O_CREAT) == 0 && accmode != 0) { + error = VOP_ACCESS(vp, accmode, cred, td); + if (error != 0) + return (error); } if (vp->v_type == VFIFO && VOP_ISLOCKED(vp) != LK_EXCLUSIVE) vn_lock(vp, LK_UPGRADE | LK_RETRY); - if ((error = VOP_OPEN(vp, fmode, cred, td, fp)) != 0) + error = VOP_OPEN(vp, fmode, cred, td, fp); + if (error != 0) return (error); - while ((fmode & (O_EXLOCK | O_SHLOCK)) != 0) { - KASSERT(fp != NULL, ("open with flock requires fp")); - if (fp->f_type != DTYPE_NONE && fp->f_type != DTYPE_VNODE) { - error = EOPNOTSUPP; - break; + error = vn_open_vnode_advlock(vp, fmode, fp); + if (error == 0 && (fmode & FWRITE) != 0) { + error = VOP_ADD_WRITECOUNT(vp, 1); + if (error == 0) { + CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", + __func__, vp, vp->v_writecount); } - lock_flags = VOP_ISLOCKED(vp); - VOP_UNLOCK(vp, 0); - lf.l_whence = SEEK_SET; - lf.l_start = 0; - lf.l_len = 0; - if (fmode & O_EXLOCK) - lf.l_type = F_WRLCK; - else - lf.l_type = F_RDLCK; - type = F_FLOCK; - if ((fmode & FNONBLOCK) == 0) - type |= F_WAIT; - error = VOP_ADVLOCK(vp, (caddr_t)fp, F_SETLK, &lf, type); - if (error == 0) - fp->f_flag |= FHASLOCK; - vn_lock(vp, lock_flags | LK_RETRY); - if (error != 0) - break; - if ((vp->v_iflag & VI_DOOMED) != 0) { - error = ENOENT; - break; - } - - /* - * Another thread might have used this vnode as an - * executable while the vnode lock was dropped. - * Ensure the vnode is still able to be opened for - * writing after the lock has been obtained. - */ - if ((accmode & VWRITE) != 0) - error = vn_writechk(vp); - break; } + /* + * Error from advlock or VOP_ADD_WRITECOUNT() still requires + * calling VOP_CLOSE() to pair with earlier VOP_OPEN(). + * Arrange for that by having fdrop() to use vn_closefile(). + */ if (error != 0) { fp->f_flag |= FOPENFAILED; fp->f_vnode = vp; @@ -400,18 +400,17 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucre fp->f_ops = &vnops; } vref(vp); - } else if ((fmode & FWRITE) != 0) { - VOP_ADD_WRITECOUNT(vp, 1); - CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", - __func__, vp, vp->v_writecount); } + ASSERT_VOP_LOCKED(vp, "vn_open_vnode"); return (error); + } /* * Check for write permissions on the specified vnode. * Prototype text segments cannot be written. + * It is racy. */ int vn_writechk(struct vnode *vp) @@ -449,9 +448,7 @@ vn_close1(struct vnode *vp, int flags, struct ucred *f vn_lock(vp, lock_flags | LK_RETRY); AUDIT_ARG_VNODE1(vp); if ((flags & (FWRITE | FOPENFAILED)) == FWRITE) { - VNASSERT(vp->v_writecount > 0, vp, - ("vn_close: negative writecount")); - VOP_ADD_WRITECOUNT(vp, -1); + VOP_ADD_WRITECOUNT_CHECKED(vp, -1); CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", __func__, vp, vp->v_writecount); } @@ -1319,13 +1316,14 @@ vn_truncate(struct file *fp, off_t length, struct ucre if (error) goto out; #endif - error = vn_writechk(vp); + error = VOP_ADD_WRITECOUNT(vp, 1); if (error == 0) { VATTR_NULL(&vattr); vattr.va_size = length; if ((fp->f_flag & O_FSYNC) != 0) vattr.va_vaflags |= VA_SYNC; error = VOP_SETATTR(vp, &vattr, fp->f_cred); + VOP_ADD_WRITECOUNT_CHECKED(vp, -1); } out: VOP_UNLOCK(vp, 0); Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Sun May 5 11:06:19 2019 (r347150) +++ head/sys/kern/vnode_if.src Sun May 5 11:20:43 2019 (r347151) @@ -688,29 +688,21 @@ vop_is_text { }; -%% set_text vp E E E +%% set_text vp = = = vop_set_text { IN struct vnode *vp; }; -%% vop_unset_text vp E E E +%% vop_unset_text vp = = = vop_unset_text { IN struct vnode *vp; }; -%% get_writecount vp L L L - -vop_get_writecount { - IN struct vnode *vp; - OUT int *writecount; -}; - - -%% add_writecount vp E E E +%% add_writecount vp L L L vop_add_writecount { IN struct vnode *vp; Modified: head/sys/sys/imgact.h ============================================================================== --- head/sys/sys/imgact.h Sun May 5 11:06:19 2019 (r347150) +++ head/sys/sys/imgact.h Sun May 5 11:20:43 2019 (r347151) @@ -89,6 +89,7 @@ struct image_params { u_long stack_sz; struct ucred *newcred; /* new credentials if changing */ bool credential_setid; /* true if becoming setid */ + bool textset; u_int map_flags; }; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun May 5 11:06:19 2019 (r347150) +++ head/sys/sys/vnode.h Sun May 5 11:20:43 2019 (r347151) @@ -169,7 +169,8 @@ struct vnode { u_int v_iflag; /* i vnode flags (see below) */ u_int v_vflag; /* v vnode flags */ u_int v_mflag; /* l mnt-specific vnode flags */ - int v_writecount; /* v ref count of writers */ + int v_writecount; /* I ref count of writers or + (negative) text users */ u_int v_hash; enum vtype v_type; /* u vnode type */ }; @@ -244,7 +245,6 @@ struct xvnode { #define VV_NOSYNC 0x0004 /* unlinked, stop syncing */ #define VV_ETERNALDEV 0x0008 /* device that is never destroyed */ #define VV_CACHEDLABEL 0x0010 /* Vnode has valid cached MAC label */ -#define VV_TEXT 0x0020 /* vnode is a pure text prototype */ #define VV_COPYONWRITE 0x0040 /* vnode is doing copy-on-write */ #define VV_SYSTEM 0x0080 /* vnode being used by kernel */ #define VV_PROCDEP 0x0100 /* vnode is process dependent */ @@ -749,6 +749,7 @@ int vop_stdadvlock(struct vop_advlock_args *ap); int vop_stdadvlockasync(struct vop_advlockasync_args *ap); int vop_stdadvlockpurge(struct vop_advlockpurge_args *ap); int vop_stdallocate(struct vop_allocate_args *ap); +int vop_stdset_text(struct vop_set_text_args *ap); int vop_stdpathconf(struct vop_pathconf_args *); int vop_stdpoll(struct vop_poll_args *); int vop_stdvptocnp(struct vop_vptocnp_args *ap); @@ -828,6 +829,33 @@ void vop_rename_fail(struct vop_rename_args *ap); #define VOP_LOCK(vp, flags) VOP_LOCK1(vp, flags, __FILE__, __LINE__) +#ifdef INVARIANTS +#define VOP_ADD_WRITECOUNT_CHECKED(vp, cnt) \ +do { \ + int error_; \ + \ + error_ = VOP_ADD_WRITECOUNT((vp), (cnt)); \ + MPASS(error_ == 0); \ +} while (0) +#define VOP_SET_TEXT_CHECKED(vp) \ +do { \ + int error_; \ + \ + error_ = VOP_SET_TEXT((vp)); \ + MPASS(error_ == 0); \ +} while (0) +#define VOP_UNSET_TEXT_CHECKED(vp) \ +do { \ + int error_; \ + \ + error_ = VOP_UNSET_TEXT((vp)); \ + MPASS(error_ == 0); \ +} while (0) +#else +#define VOP_ADD_WRITECOUNT_CHECKED(vp, cnt) VOP_ADD_WRITECOUNT((vp), (cnt)) +#define VOP_SET_TEXT_CHECKED(vp) VOP_SET_TEXT((vp)) +#define VOP_UNSET_TEXT_CHECKED(vp) VOP_UNSET_TEXT((vp)) +#endif void vput(struct vnode *vp); void vrele(struct vnode *vp); Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Sun May 5 11:06:19 2019 (r347150) +++ head/sys/ufs/ufs/ufs_extattr.c Sun May 5 11:20:43 2019 (r347151) @@ -338,7 +338,12 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, str return (error); } - VOP_ADD_WRITECOUNT(vp, 1); + error = VOP_ADD_WRITECOUNT(vp, 1); + if (error != 0) { + VOP_CLOSE(vp, FREAD | FWRITE, td->td_ucred, td); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun May 5 11:35:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30C801588736; Sun, 5 May 2019 11:35:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8538905BB; Sun, 5 May 2019 11:35:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FC531F036; Sun, 5 May 2019 11:35:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45BZccK003177; Sun, 5 May 2019 11:35:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45BZcqv003176; Sun, 5 May 2019 11:35:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051135.x45BZcqv003176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 11:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347152 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C8538905BB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 11:35:39 -0000 Author: tuexen Date: Sun May 5 11:35:38 2019 New Revision: 347152 URL: https://svnweb.freebsd.org/changeset/base/347152 Log: MFC r333981: Only fillin data srucuture when actually stored. Manually fixed a merge conflict. Modified: stable/11/sys/netinet/sctputil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Sun May 5 11:20:43 2019 (r347151) +++ stable/11/sys/netinet/sctputil.c Sun May 5 11:35:38 2019 (r347152) @@ -70,6 +70,7 @@ extern const struct sctp_ss_functions sctp_ss_function void sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.sb.stcb = stcb; @@ -86,11 +87,13 @@ sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_closing(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int16_t loc) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.close.inp = (void *)inp; @@ -110,11 +113,13 @@ sctp_log_closing(struct sctp_inpcb *inp, struct sctp_t sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void rto_logging(struct sctp_nets *net, int from) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; memset(&sctp_clog, 0, sizeof(sctp_clog)); @@ -127,11 +132,13 @@ rto_logging(struct sctp_nets *net, int from) sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_strm_del_alt(struct sctp_tcb *stcb, uint32_t tsn, uint16_t sseq, uint16_t stream, int from) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.strlog.stcb = stcb; @@ -147,11 +154,13 @@ sctp_log_strm_del_alt(struct sctp_tcb *stcb, uint32_t sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_nagle_event(struct sctp_tcb *stcb, int action) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.nagle.stcb = (void *)stcb; @@ -166,11 +175,13 @@ sctp_log_nagle_event(struct sctp_tcb *stcb, int action sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_sack(uint32_t old_cumack, uint32_t cumack, uint32_t tsn, uint16_t gaps, uint16_t dups, int from) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.sack.cumack = cumack; @@ -185,11 +196,13 @@ sctp_log_sack(uint32_t old_cumack, uint32_t cumack, ui sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_map(uint32_t map, uint32_t cum, uint32_t high, int from) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; memset(&sctp_clog, 0, sizeof(sctp_clog)); @@ -203,11 +216,13 @@ sctp_log_map(uint32_t map, uint32_t cum, uint32_t high sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_fr(uint32_t biggest_tsn, uint32_t biggest_new_tsn, uint32_t tsn, int from) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; memset(&sctp_clog, 0, sizeof(sctp_clog)); @@ -221,12 +236,14 @@ sctp_log_fr(uint32_t biggest_tsn, uint32_t biggest_new sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } #ifdef SCTP_MBUF_LOGGING void sctp_log_mb(struct mbuf *m, int from) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.mb.mp = m; @@ -247,6 +264,7 @@ sctp_log_mb(struct mbuf *m, int from) sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void @@ -263,6 +281,7 @@ sctp_log_mbc(struct mbuf *m, int from) void sctp_log_strm_del(struct sctp_queued_to_read *control, struct sctp_queued_to_read *poschk, int from) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; if (control == NULL) { @@ -287,11 +306,13 @@ sctp_log_strm_del(struct sctp_queued_to_read *control, sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_cwnd(struct sctp_tcb *stcb, struct sctp_nets *net, int augment, uint8_t from) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.cwnd.net = net; @@ -322,11 +343,13 @@ sctp_log_cwnd(struct sctp_tcb *stcb, struct sctp_nets sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; memset(&sctp_clog, 0, sizeof(sctp_clog)); @@ -366,11 +389,13 @@ sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_nets *net, int error, int burst, uint8_t from) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; memset(&sctp_clog, 0, sizeof(sctp_clog)); @@ -393,11 +418,13 @@ sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_n sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_rwnd(uint8_t from, uint32_t peers_rwnd, uint32_t snd_size, uint32_t overhead) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.rwnd.rwnd = peers_rwnd; @@ -411,11 +438,13 @@ sctp_log_rwnd(uint8_t from, uint32_t peers_rwnd, uint3 sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_rwnd_set(uint8_t from, uint32_t peers_rwnd, uint32_t flight_size, uint32_t overhead, uint32_t a_rwndval) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.rwnd.rwnd = peers_rwnd; @@ -429,12 +458,14 @@ sctp_log_rwnd_set(uint8_t from, uint32_t peers_rwnd, u sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } #ifdef SCTP_MBCNT_LOGGING static void sctp_log_mbcnt(uint8_t from, uint32_t total_oq, uint32_t book, uint32_t total_mbcnt_q, uint32_t mbcnt) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.mbcnt.total_queue_size = total_oq; @@ -448,21 +479,25 @@ sctp_log_mbcnt(uint8_t from, uint32_t total_oq, uint32 sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } #endif void sctp_misc_ints(uint8_t from, uint32_t a, uint32_t b, uint32_t c, uint32_t d) { +#if defined(SCTP_LOCAL_TRACE_BUF) SCTP_CTR6(KTR_SCTP, "SCTP:%d[%d]:%x-%x-%x-%x", SCTP_LOG_MISC_EVENT, from, a, b, c, d); +#endif } void sctp_wakeup_log(struct sctp_tcb *stcb, uint32_t wake_cnt, int from) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.wake.stcb = (void *)stcb; @@ -504,11 +539,13 @@ sctp_wakeup_log(struct sctp_tcb *stcb, uint32_t wake_c sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } void sctp_log_block(uint8_t from, struct sctp_association *asoc, size_t sendlen) { +#if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; sctp_clog.x.blk.onsb = asoc->total_output_queue_size; @@ -525,6 +562,7 @@ sctp_log_block(uint8_t from, struct sctp_association * sctp_clog.x.misc.log2, sctp_clog.x.misc.log3, sctp_clog.x.misc.log4); +#endif } int From owner-svn-src-all@freebsd.org Sun May 5 12:12:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 004B81589AC3; Sun, 5 May 2019 12:11:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9874C914D3; Sun, 5 May 2019 12:11:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BFB51F584; Sun, 5 May 2019 12:11:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45CBxih022787; Sun, 5 May 2019 12:11:59 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45CBxh9022785; Sun, 5 May 2019 12:11:59 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051211.x45CBxh9022785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 12:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347153 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9874C914D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 12:12:00 -0000 Author: tuexen Date: Sun May 5 12:11:58 2019 New Revision: 347153 URL: https://svnweb.freebsd.org/changeset/base/347153 Log: MFC r335194: When retransmitting TCP SYN-ACK segments with the TCP timestamp option enabled use an updated timestamp instead of reusing the one used in the initial TCP SYN-ACK segment. This patch ensures that an updated timestamp is used when sending the SYN-ACK from the syncache code. It was already done if the SYN-ACK was retransmitted from the generic code. This makes the behaviour consistent and also conformant with the TCP specification. Reviewed by: jtl@, Jason Eggleston Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D15634 Modified: stable/11/sys/netinet/tcp_syncache.c stable/11/sys/netinet/tcp_syncache.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_syncache.c ============================================================================== --- stable/11/sys/netinet/tcp_syncache.c Sun May 5 11:35:38 2019 (r347152) +++ stable/11/sys/netinet/tcp_syncache.c Sun May 5 12:11:58 2019 (r347153) @@ -1158,25 +1158,6 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt } } - /* - * If timestamps were negotiated, the reflected timestamp - * must be equal to what we actually sent in the SYN|ACK - * except in the case of 0. Some boxes are known for sending - * broken timestamp replies during the 3whs (and potentially - * during the connection also). - * - * Accept the final ACK of 3whs with reflected timestamp of 0 - * instead of sending a RST and deleting the syncache entry. - */ - if ((to->to_flags & TOF_TS) && to->to_tsecr && - to->to_tsecr != sc->sc_ts) { - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: TSECR %u != TS %u, " - "segment rejected\n", - s, __func__, to->to_tsecr, sc->sc_ts); - goto failed; - } - *lsop = syncache_socket(sc, *lsop, m); if (*lsop == NULL) @@ -1510,7 +1491,6 @@ skip_alloc: */ if (to->to_flags & TOF_TS) { sc->sc_tsreflect = to->to_tsval; - sc->sc_ts = tcp_ts_getticks(); sc->sc_flags |= SCF_TIMESTAMP; } if (to->to_flags & TOF_SCALE) { @@ -1734,8 +1714,7 @@ syncache_respond(struct syncache *sc, struct syncache_ to.to_flags |= TOF_SCALE; } if (sc->sc_flags & SCF_TIMESTAMP) { - /* Virgin timestamp or TCP cookie enhanced one. */ - to.to_tsval = sc->sc_ts; + to.to_tsval = sc->sc_tsoff + tcp_ts_getticks(); to.to_tsecr = sc->sc_tsreflect; to.to_flags |= TOF_TS; } @@ -2044,8 +2023,7 @@ syncookie_generate(struct syncache_head *sch, struct s /* Randomize the timestamp. */ if (sc->sc_flags & SCF_TIMESTAMP) { - sc->sc_ts = arc4random(); - sc->sc_tsoff = sc->sc_ts - tcp_ts_getticks(); + sc->sc_tsoff = arc4random() - tcp_ts_getticks(); } TCPSTAT_INC(tcps_sc_sendcookie); @@ -2134,7 +2112,6 @@ syncookie_lookup(struct in_conninfo *inc, struct synca if (to->to_flags & TOF_TS) { sc->sc_flags |= SCF_TIMESTAMP; sc->sc_tsreflect = to->to_tsval; - sc->sc_ts = to->to_tsecr; sc->sc_tsoff = to->to_tsecr - tcp_ts_getticks(); } Modified: stable/11/sys/netinet/tcp_syncache.h ============================================================================== --- stable/11/sys/netinet/tcp_syncache.h Sun May 5 11:35:38 2019 (r347152) +++ stable/11/sys/netinet/tcp_syncache.h Sun May 5 12:11:58 2019 (r347153) @@ -54,7 +54,6 @@ struct syncache { int sc_rxttime; /* retransmit time */ u_int16_t sc_rxmits; /* retransmit counter */ u_int32_t sc_tsreflect; /* timestamp to reflect */ - u_int32_t sc_ts; /* our timestamp to send */ u_int32_t sc_tsoff; /* ts offset w/ syncookies */ u_int32_t sc_flowlabel; /* IPv6 flowlabel */ tcp_seq sc_irs; /* seq from peer */ From owner-svn-src-all@freebsd.org Sun May 5 12:28:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 270E1158A0D0; Sun, 5 May 2019 12:28:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE00891B0F; Sun, 5 May 2019 12:28:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9368D1F877; Sun, 5 May 2019 12:28:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45CSg0P029302; Sun, 5 May 2019 12:28:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45CSdfh029287; Sun, 5 May 2019 12:28:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051228.x45CSdfh029287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 12:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347154 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/11/sys: netinet netinet6 X-SVN-Commit-Revision: 347154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE00891B0F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 12:28:43 -0000 Author: tuexen Date: Sun May 5 12:28:39 2019 New Revision: 347154 URL: https://svnweb.freebsd.org/changeset/base/347154 Log: MFC r336511: Whitespace changes due to changes in ident. Modified: stable/11/sys/netinet/sctp.h stable/11/sys/netinet/sctp_asconf.c stable/11/sys/netinet/sctp_asconf.h stable/11/sys/netinet/sctp_auth.c stable/11/sys/netinet/sctp_auth.h stable/11/sys/netinet/sctp_bsd_addr.c stable/11/sys/netinet/sctp_cc_functions.c stable/11/sys/netinet/sctp_header.h stable/11/sys/netinet/sctp_indata.c stable/11/sys/netinet/sctp_indata.h stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_input.h stable/11/sys/netinet/sctp_output.h stable/11/sys/netinet/sctp_pcb.c stable/11/sys/netinet/sctp_pcb.h stable/11/sys/netinet/sctp_peeloff.c stable/11/sys/netinet/sctp_structs.h stable/11/sys/netinet/sctp_timer.c stable/11/sys/netinet/sctp_uio.h stable/11/sys/netinet/sctp_usrreq.c stable/11/sys/netinet/sctp_var.h stable/11/sys/netinet/sctputil.c stable/11/sys/netinet/sctputil.h stable/11/sys/netinet6/sctp6_usrreq.c stable/11/sys/netinet6/sctp6_var.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp.h ============================================================================== --- stable/11/sys/netinet/sctp.h Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp.h Sun May 5 12:28:39 2019 (r347154) @@ -417,7 +417,7 @@ struct sctp_error_unresolv_addr { struct sctp_error_unrecognized_chunk { struct sctp_error_cause cause; /* code=SCTP_CAUSE_UNRECOG_CHUNK */ - struct sctp_chunkhdr ch;/* header from chunk in error */ + struct sctp_chunkhdr ch; /* header from chunk in error */ } SCTP_PACKED; struct sctp_error_no_user_data { Modified: stable/11/sys/netinet/sctp_asconf.c ============================================================================== --- stable/11/sys/netinet/sctp_asconf.c Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_asconf.c Sun May 5 12:28:39 2019 (r347154) @@ -275,6 +275,7 @@ sctp_asconf_del_remote_addrs_except(struct sctp_tcb *s /* not found */ return (-1); } + /* delete all destination addresses except the source */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (net != src_net) { @@ -381,6 +382,7 @@ sctp_process_asconf_delete_ip(struct sockaddr *src, aparam_length); return (m_reply); } + /* if deleting 0.0.0.0/::0, delete all addresses except src addr */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { result = sctp_asconf_del_remote_addrs_except(stcb, src); @@ -399,6 +401,7 @@ sctp_process_asconf_delete_ip(struct sockaddr *src, } return (m_reply); } + /* delete the address */ result = sctp_del_remote_addr(stcb, sa); /* @@ -614,6 +617,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset serial_num, asoc->asconf_seq_in + 1); return; } + /* it's the expected "next" sequence number, so process it */ asoc->asconf_seq_in = serial_num; /* update sequence */ /* get length of all the param's in the ASCONF */ @@ -638,6 +642,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asconf_ack), ack); } } + m_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_ack_chunk), 0, M_NOWAIT, 1, MT_DATA); if (m_ack == NULL) { @@ -972,6 +977,7 @@ sctp_assoc_immediate_retrans(struct sctp_tcb *stcb, st if (stcb->asoc.deleted_primary == NULL) { return; } + if (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) { SCTPDBG(SCTP_DEBUG_ASCONF1, "assoc_immediate_retrans: Deleted primary is "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &stcb->asoc.deleted_primary->ro._l_addr.sa); @@ -1075,6 +1081,7 @@ sctp_path_check_and_react(struct sctp_tcb *stcb, struc } return; } + /* Multiple local addresses exsist in the association. */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { /* clear any cached route and source address */ @@ -1321,6 +1328,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, struct sc if (stcb->asoc.asconf_supported == 0) { return (-1); } + /* * if this is deleting the last address from the assoc, mark it as * pending. @@ -1341,6 +1349,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, struct sc return (-1); } } + /* queue an asconf parameter */ status = sctp_asconf_queue_mgmt(stcb, ifa, type); @@ -1362,6 +1371,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, struct sc stcb->asoc.asconf_addr_del_pending = NULL; } } + if (pending_delete_queued) { struct sctp_nets *net; @@ -1386,6 +1396,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, struct sc SCTP_FROM_SCTP_ASCONF, __LINE__); } + /* queue in an advisory set primary too */ (void)sctp_asconf_queue_mgmt(stcb, ifa, SCTP_SET_PRIM_ADDR); /* let caller know we should send this out immediately */ @@ -1683,11 +1694,13 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, serial_num, asoc->asconf_seq_out_acked + 1); return; } + if (serial_num == asoc->asconf_seq_out - 1) { /* stop our timer */ sctp_timer_stop(SCTP_TIMER_TYPE_ASCONF, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_ASCONF + SCTP_LOC_5); } + /* process the ASCONF-ACK contents */ ack_length = ntohs(cp->ch.chunk_length) - sizeof(struct sctp_asconf_ack_chunk); @@ -1776,7 +1789,7 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, * at any given time */ if (last_error_id == 0) - last_error_id--;/* set to "max" value */ + last_error_id--; /* set to "max" value */ TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { if (aa->sent == 1) { /* @@ -2056,6 +2069,7 @@ sctp_asconf_iterator_ep_end(struct sctp_inpcb *inp, vo laddr->action = 0; break; } + } } else if (l->action == SCTP_DEL_IP_ADDRESS) { LIST_FOREACH_SAFE(laddr, &inp->sctp_addr_list, sctp_nxt_addr, nladdr) { @@ -2089,6 +2103,7 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, stru if (ifa->vrf_id != stcb->asoc.vrf_id) { continue; } + /* Same checks again for assoc */ switch (ifa->address.sa.sa_family) { #ifdef INET6 @@ -2279,6 +2294,7 @@ sctp_set_primary_ip_address_sa(struct sctp_tcb *stcb, /* Invalid address */ return (-1); } + /* queue an ASCONF:SET_PRIM_ADDR to be sent */ if (!sctp_asconf_queue_add(stcb, ifa, SCTP_SET_PRIM_ADDR)) { /* set primary queuing succeeded */ @@ -2357,11 +2373,13 @@ sctp_is_addr_pending(struct sctp_tcb *stcb, struct sct SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: param length(%u) too short\n", param_length); break; } + aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(chk->data, offset, param_length, aparam_buf); if (aph == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: couldn't get entire param\n"); break; } + ph = (struct sctp_paramhdr *)(aph + 1); if (sctp_addr_match(ph, &sctp_ifa->address.sa) != 0) { switch (param_type) { @@ -2376,6 +2394,7 @@ sctp_is_addr_pending(struct sctp_tcb *stcb, struct sct } last_param_type = param_type; } + offset += SCTP_SIZE32(param_length); if (offset >= asconf_limit) { /* no more data in the mbuf chain */ @@ -2459,6 +2478,7 @@ sctp_find_valid_localaddr(struct sctp_tcb *stcb, int a if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) { continue; } + sin6 = &sctp_ifa->address.sin6; if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { /* @@ -2834,6 +2854,7 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb, } } } + next_addr: /* * Sanity check: Make sure the length isn't 0, otherwise @@ -3368,6 +3389,7 @@ sctp_asconf_send_nat_state_update(struct sctp_tcb *stc if (vrf == NULL) { goto skip_rest; } + SCTP_IPI_ADDR_RLOCK(); LIST_FOREACH(sctp_ifnp, &vrf->ifnlist, next_ifn) { LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) { Modified: stable/11/sys/netinet/sctp_asconf.h ============================================================================== --- stable/11/sys/netinet/sctp_asconf.h Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_asconf.h Sun May 5 12:28:39 2019 (r347154) @@ -58,10 +58,10 @@ sctp_addr_mgmt_ep_sa(struct sctp_inpcb *, struct socka uint32_t, uint32_t, struct sctp_ifa *); -extern int +extern int sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr, uint32_t val); -extern void +extern void sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, uint32_t type); Modified: stable/11/sys/netinet/sctp_auth.c ============================================================================== --- stable/11/sys/netinet/sctp_auth.c Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_auth.c Sun May 5 12:28:39 2019 (r347154) @@ -1307,6 +1307,7 @@ sctp_auth_setactivekey(struct sctp_tcb *stcb, uint16_t /* can't reactivate a deactivated key with other refcounts */ return (-1); } + /* set the (new) active key */ stcb->asoc.authinfo.active_keyid = keyid; /* reset the deactivated flag */ @@ -1361,6 +1362,7 @@ sctp_deact_sharedkey(struct sctp_tcb *stcb, uint16_t k sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb, keyid, 0, SCTP_SO_LOCKED); } + /* mark the key as deactivated */ skey->deactivated = 1; @@ -1580,6 +1582,7 @@ sctp_fill_hmac_digest_m(struct mbuf *m, uint32_t auth_ "Assoc Key"); #endif } + /* set in the active key id */ auth->shared_key_id = htons(keyid); @@ -1767,6 +1770,7 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint /* If the socket is gone we are out of here */ return; } + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_AUTHEVNT)) /* event not enabled */ return; @@ -1927,6 +1931,7 @@ sctp_validate_init_auth_params(struct mbuf *m, int off if (num_chunks) got_chklist = 1; } + offset += SCTP_SIZE32(plen); if (offset >= limit) { break; @@ -2021,6 +2026,7 @@ sctp_initialize_auth_params(struct sctp_inpcb *inp, st new_key->key[keylen++] = i; } } + /* append in the HMACs */ ph = (struct sctp_paramhdr *)(new_key->key + keylen); ph->param_type = htons(SCTP_HMAC_LIST); Modified: stable/11/sys/netinet/sctp_auth.h ============================================================================== --- stable/11/sys/netinet/sctp_auth.h Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_auth.h Sun May 5 12:28:39 2019 (r347154) @@ -85,7 +85,7 @@ typedef struct sctp_hmaclist { typedef struct sctp_authinformation { sctp_key_t *random; /* local random key (concatenated) */ uint32_t random_len; /* local random number length for param */ - sctp_key_t *peer_random;/* peer's random key (concatenated) */ + sctp_key_t *peer_random; /* peer's random key (concatenated) */ sctp_key_t *assoc_key; /* cached concatenated send key */ sctp_key_t *recv_key; /* cached concatenated recv key */ uint16_t active_keyid; /* active send keyid */ @@ -112,13 +112,13 @@ extern sctp_auth_chklist_t *sctp_copy_chunklist(sctp_a extern int sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t *list); extern int sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t *list); extern size_t sctp_auth_get_chklist_size(const sctp_auth_chklist_t *list); -extern int +extern int sctp_serialize_auth_chunks(const sctp_auth_chklist_t *list, uint8_t *ptr); -extern int +extern int sctp_pack_auth_chunks(const sctp_auth_chklist_t *list, uint8_t *ptr); -extern int +extern int sctp_unpack_auth_chunks(const uint8_t *ptr, uint8_t num_chunks, sctp_auth_chklist_t *list); @@ -139,16 +139,16 @@ extern void sctp_free_sharedkey(sctp_sharedkey_t *skey extern sctp_sharedkey_t * sctp_find_sharedkey(struct sctp_keyhead *shared_keys, uint16_t key_id); -extern int +extern int sctp_insert_sharedkey(struct sctp_keyhead *shared_keys, sctp_sharedkey_t *new_skey); -extern int +extern int sctp_copy_skeylist(const struct sctp_keyhead *src, struct sctp_keyhead *dest); /* ref counts on shared keys, by key id */ extern void sctp_auth_key_acquire(struct sctp_tcb *stcb, uint16_t keyid); -extern void +extern void sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t keyid, int so_locked); @@ -159,11 +159,11 @@ extern void sctp_free_hmaclist(sctp_hmaclist_t *list); extern int sctp_auth_add_hmacid(sctp_hmaclist_t *list, uint16_t hmac_id); extern sctp_hmaclist_t *sctp_copy_hmaclist(sctp_hmaclist_t *list); extern sctp_hmaclist_t *sctp_default_supported_hmaclist(void); -extern uint16_t +extern uint16_t sctp_negotiate_hmacid(sctp_hmaclist_t *peer, sctp_hmaclist_t *local); extern int sctp_serialize_hmaclist(sctp_hmaclist_t *list, uint8_t *ptr); -extern int +extern int sctp_verify_hmac_param(struct sctp_auth_hmac_algo *hmacs, uint32_t num_hmacs); @@ -173,22 +173,22 @@ extern void sctp_free_authinfo(sctp_authinfo_t *authin /* keyed-HMAC functions */ extern uint32_t sctp_get_auth_chunk_len(uint16_t hmac_algo); extern uint32_t sctp_get_hmac_digest_len(uint16_t hmac_algo); -extern uint32_t +extern uint32_t sctp_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, uint8_t *text, uint32_t textlen, uint8_t *digest); -extern int +extern int sctp_verify_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, uint8_t *text, uint32_t textlen, uint8_t *digest, uint32_t digestlen); -extern uint32_t +extern uint32_t sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t *key, uint8_t *text, uint32_t textlen, uint8_t *digest); extern int sctp_auth_is_supported_hmac(sctp_hmaclist_t *list, uint16_t id); /* mbuf versions */ -extern uint32_t +extern uint32_t sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, struct mbuf *m, uint32_t m_offset, uint8_t *digest, uint32_t trailer); -extern uint32_t +extern uint32_t sctp_compute_hmac_m(uint16_t hmac_algo, sctp_key_t *key, struct mbuf *m, uint32_t m_offset, uint8_t *digest); @@ -204,26 +204,26 @@ extern int sctp_auth_setactivekey_ep(struct sctp_inpcb extern int sctp_deact_sharedkey(struct sctp_tcb *stcb, uint16_t keyid); extern int sctp_deact_sharedkey_ep(struct sctp_inpcb *inp, uint16_t keyid); -extern void +extern void sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m, uint32_t offset, uint32_t length); -extern void +extern void sctp_fill_hmac_digest_m(struct mbuf *m, uint32_t auth_offset, struct sctp_auth_chunk *auth, struct sctp_tcb *stcb, uint16_t key_id); extern struct mbuf * sctp_add_auth_chunk(struct mbuf *m, struct mbuf **m_end, struct sctp_auth_chunk **auth_ret, uint32_t *offset, struct sctp_tcb *stcb, uint8_t chunk); -extern int +extern int sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *ch, struct mbuf *m, uint32_t offset); -extern void +extern void sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, uint16_t keyid, uint16_t alt_keyid, int so_locked); -extern int +extern int sctp_validate_init_auth_params(struct mbuf *m, int offset, int limit); -extern void +extern void sctp_initialize_auth_params(struct sctp_inpcb *inp, struct sctp_tcb *stcb); Modified: stable/11/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/11/sys/netinet/sctp_bsd_addr.c Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_bsd_addr.c Sun May 5 12:28:39 2019 (r347154) @@ -303,10 +303,12 @@ sctp_addr_change(struct ifaddr *ifa, int cmd) SCTP_BASE_VAR(first_time) = 1; sctp_init_ifns_for_vrf(SCTP_DEFAULT_VRFID); } + if ((cmd != RTM_ADD) && (cmd != RTM_DELETE)) { /* don't know what to do with this */ return; } + if (ifa->ifa_addr == NULL) { return; } Modified: stable/11/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/11/sys/netinet/sctp_cc_functions.c Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_cc_functions.c Sun May 5 12:28:39 2019 (r347154) @@ -129,6 +129,7 @@ sctp_cwnd_update_after_fr(struct sctp_tcb *stcb, t_ucwnd_sbw = 1; } } + /*- * CMT fast recovery code. Need to debug. ((sctp_cmt_on_off > 0) && * (net->fast_retran_loss_recovery == 0))) @@ -1117,6 +1118,7 @@ sctp_cwnd_update_after_ecn_echo_common(struct sctp_tcb if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); } + } SCTP_STAT_INCR(sctps_ecnereducedcwnd); } else { @@ -1316,7 +1318,7 @@ sctp_cwnd_update_rtcc_after_ecn_echo(struct sctp_tcb * static -void +void sctp_cwnd_update_rtcc_tsn_acknowledged(struct sctp_nets *net, struct sctp_tmit_chunk *tp1) { @@ -1933,6 +1935,7 @@ measure_achieved_throughput(struct sctp_nets *net) net->cc_mod.htcp_ca.lasttime = now; return; } + net->cc_mod.htcp_ca.bytecount += net->net_ack; if ((net->cc_mod.htcp_ca.bytecount >= net->cwnd - (((net->cc_mod.htcp_ca.alpha >> 7) ? (net->cc_mod.htcp_ca.alpha >> 7) : 1) * net->mtu)) && (now - net->cc_mod.htcp_ca.lasttime >= net->cc_mod.htcp_ca.minRTT) && @@ -1969,6 +1972,7 @@ htcp_beta_update(struct htcp *ca, uint32_t minRTT, uin return; } } + if (ca->modeswitch && minRTT > (uint32_t)MSEC_TO_TICKS(10) && maxRTT) { ca->beta = (minRTT << 7) / maxRTT; if (ca->beta < BETA_MIN) @@ -1992,6 +1996,7 @@ htcp_alpha_update(struct htcp *ca) diff -= hz; factor = 1 + (10 * diff + ((diff / 2) * (diff / 2) / hz)) / hz; } + if (use_rtt_scaling && minRTT) { uint32_t scale = (hz << 3) / (10 * minRTT); @@ -2001,6 +2006,7 @@ htcp_alpha_update(struct htcp *ca) if (!factor) factor = 1; } + ca->alpha = 2 * factor * ((1 << 7) - ca->beta); if (!ca->alpha) ca->alpha = ALPHA_BASE; @@ -2055,12 +2061,14 @@ htcp_cong_avoid(struct sctp_tcb *stcb, struct sctp_net sctp_log_cwnd(stcb, net, net->mtu, SCTP_CWND_LOG_FROM_SS); } + } else { net->cwnd += net->net_ack; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { sctp_log_cwnd(stcb, net, net->net_ack, SCTP_CWND_LOG_FROM_SS); } + } sctp_enforce_cwnd_limit(&stcb->asoc, net); } else { Modified: stable/11/sys/netinet/sctp_header.h ============================================================================== --- stable/11/sys/netinet/sctp_header.h Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_header.h Sun May 5 12:28:39 2019 (r347154) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); * Parameter structures */ struct sctp_ipv4addr_param { - struct sctp_paramhdr ph;/* type=SCTP_IPV4_PARAM_TYPE, len=8 */ + struct sctp_paramhdr ph; /* type=SCTP_IPV4_PARAM_TYPE, len=8 */ uint32_t addr; /* IPV4 address */ } SCTP_PACKED; @@ -54,20 +54,20 @@ struct sctp_ipv4addr_param { struct sctp_ipv6addr_param { - struct sctp_paramhdr ph;/* type=SCTP_IPV6_PARAM_TYPE, len=20 */ + struct sctp_paramhdr ph; /* type=SCTP_IPV6_PARAM_TYPE, len=20 */ uint8_t addr[SCTP_V6_ADDR_BYTES]; /* IPV6 address */ } SCTP_PACKED; /* Cookie Preservative */ struct sctp_cookie_perserve_param { - struct sctp_paramhdr ph;/* type=SCTP_COOKIE_PRESERVE, len=8 */ + struct sctp_paramhdr ph; /* type=SCTP_COOKIE_PRESERVE, len=8 */ uint32_t time; /* time in ms to extend cookie */ } SCTP_PACKED; #define SCTP_ARRAY_MIN_LEN 1 /* Host Name Address */ struct sctp_host_name_param { - struct sctp_paramhdr ph;/* type=SCTP_HOSTNAME_ADDRESS */ + struct sctp_paramhdr ph; /* type=SCTP_HOSTNAME_ADDRESS */ char name[SCTP_ARRAY_MIN_LEN]; /* host name */ } SCTP_PACKED; @@ -78,7 +78,7 @@ struct sctp_host_name_param { #define SCTP_MAX_ADDR_PARAMS_SIZE 12 /* supported address type */ struct sctp_supported_addr_param { - struct sctp_paramhdr ph;/* type=SCTP_SUPPORTED_ADDRTYPE */ + struct sctp_paramhdr ph; /* type=SCTP_SUPPORTED_ADDRTYPE */ uint16_t addr_type[2]; /* array of supported address types */ } SCTP_PACKED; @@ -106,8 +106,8 @@ struct sctp_prsctp_supported_param { /* draft-ietf-tsvwg-addip-sctp */ struct sctp_asconf_paramhdr { /* an ASCONF "parameter" */ - struct sctp_paramhdr ph;/* a SCTP parameter header */ - uint32_t correlation_id;/* correlation id for this param */ + struct sctp_paramhdr ph; /* a SCTP parameter header */ + uint32_t correlation_id; /* correlation id for this param */ } SCTP_PACKED; struct sctp_asconf_addr_param { /* an ASCONF address parameter */ @@ -131,7 +131,7 @@ struct sctp_asconf_addrv4_param { /* an ASCONF address #define SCTP_MAX_SUPPORTED_EXT 256 struct sctp_supported_chunk_types_param { - struct sctp_paramhdr ph;/* type = 0x8008 len = x */ + struct sctp_paramhdr ph; /* type = 0x8008 len = x */ uint8_t chunk_types[]; } SCTP_PACKED; @@ -204,8 +204,8 @@ struct sctp_state_cookie { /* this is our definition.. uint16_t peerport; /* port address of the peer in the INIT */ uint16_t myport; /* my port address used in the INIT */ - uint8_t ipv4_addr_legal;/* Are V4 addr legal? */ - uint8_t ipv6_addr_legal;/* Are V6 addr legal? */ + uint8_t ipv4_addr_legal; /* Are V4 addr legal? */ + uint8_t ipv6_addr_legal; /* Are V6 addr legal? */ uint8_t local_scope; /* IPv6 local scope flag */ uint8_t site_scope; /* IPv6 site scope flag */ @@ -510,17 +510,17 @@ struct sctp_stream_reset_resp_tsn { /* Should we make the max be 32? */ #define SCTP_RANDOM_MAX_SIZE 256 struct sctp_auth_random { - struct sctp_paramhdr ph;/* type = 0x8002 */ + struct sctp_paramhdr ph; /* type = 0x8002 */ uint8_t random_data[]; } SCTP_PACKED; struct sctp_auth_chunk_list { - struct sctp_paramhdr ph;/* type = 0x8003 */ + struct sctp_paramhdr ph; /* type = 0x8003 */ uint8_t chunk_types[]; } SCTP_PACKED; struct sctp_auth_hmac_algo { - struct sctp_paramhdr ph;/* type = 0x8004 */ + struct sctp_paramhdr ph; /* type = 0x8004 */ uint16_t hmac_ids[]; } SCTP_PACKED; Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_indata.c Sun May 5 12:28:39 2019 (r347154) @@ -88,6 +88,7 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_asso if (stcb->sctp_socket == NULL) { return (calc); } + KASSERT(asoc->cnt_on_reasm_queue > 0 || asoc->size_on_reasm_queue == 0, ("size_on_reasm_queue is %u", asoc->size_on_reasm_queue)); KASSERT(asoc->cnt_on_all_streams > 0 || asoc->size_on_all_streams == 0, @@ -113,6 +114,7 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_asso /* out of space */ return (calc); } + /* what is the overhead of all these rwnd's */ calc = sctp_sbspace_sub(calc, stcb->asoc.my_rwnd_control_len); /* @@ -183,6 +185,7 @@ sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct s /* user does not want any ancillary data */ return (NULL); } + len = 0; if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) { len += CMSG_SPACE(sizeof(struct sctp_rcvinfo)); @@ -1042,6 +1045,7 @@ place_chunk: SCTP_FROM_SCTP_INDATA + SCTP_LOC_5); return; } + } if (inserted == 0) { /* Its at the end */ @@ -2136,6 +2140,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc control = NULL; goto finish_express_del; } + /* Now will we need a chunk too? */ if ((chk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) { sctp_alloc_a_chunk(stcb, chk); @@ -3094,6 +3099,7 @@ sctp_process_segment_range(struct sctp_tcb *stcb, stru tp1->do_rtt = 0; } } + } if (tp1->sent <= SCTP_DATAGRAM_RESEND) { if (SCTP_TSN_GT(tp1->rec.data.tsn, @@ -3359,6 +3365,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru continue; } } + } if (SCTP_TSN_GT(tp1->rec.data.tsn, asoc->this_sack_highest_gap) && !(accum_moved && asoc->fast_retran_loss_recovery)) { @@ -3594,6 +3601,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru tp1); } } + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_RWND_ENABLE) { sctp_log_rwnd(SCTP_INCREASE_PEER_RWND, asoc->peers_rwnd, tp1->send_size, SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)); @@ -3675,6 +3683,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, stru tp1->whoTo->find_pseudo_cumack = 1; tp1->whoTo->find_rtx_pseudo_cumack = 1; } + } else { /* CMT is OFF */ #ifdef SCTP_FR_TO_ALTERNATE @@ -3963,6 +3972,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 } return; } + /* First setup for CC stuff */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if (SCTP_TSN_GT(cumack, net->cwr_window_tsn)) { @@ -4228,6 +4238,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 asoc->total_flight = 0; asoc->total_flight_count = 0; } + /* RWND update */ asoc->peers_rwnd = sctp_sbspace_sub(rwnd, (uint32_t)(asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)))); @@ -4480,6 +4491,7 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o sctp_misc_ints(SCTP_SACK_LOG_NORMAL, cum_ack, rwnd, stcb->asoc.last_acked_seq, stcb->asoc.peers_rwnd); } + old_rwnd = stcb->asoc.peers_rwnd; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { sctp_misc_ints(SCTP_THRESHOLD_CLEAR, @@ -4551,6 +4563,7 @@ hopeless_peer: /* acking something behind */ return; } + /* update the Rwnd of the peer */ if (TAILQ_EMPTY(&asoc->sent_queue) && TAILQ_EMPTY(&asoc->send_queue) && @@ -4604,6 +4617,7 @@ hopeless_peer: if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) { (*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net); } + /* * CMT: SFR algo (and HTNA) - this_sack_highest_newack has * to be greater than the cumack. Also reset saw_newack to 0 @@ -4839,6 +4853,7 @@ hopeless_peer: #endif asoc->total_flight = 0; } + /* sa_ignore NO_NULL_CHK */ if ((wake_him) && (stcb->sctp_socket)) { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -4943,6 +4958,7 @@ hopeless_peer: sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, (void *)net, SCTP_SO_NOT_LOCKED); } + if (net == stcb->asoc.primary_destination) { if (stcb->asoc.alternate) { /* @@ -4953,6 +4969,7 @@ hopeless_peer: stcb->asoc.alternate = NULL; } } + if (net->dest_state & SCTP_ADDR_PF) { net->dest_state &= ~SCTP_ADDR_PF; sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, @@ -4975,6 +4992,7 @@ hopeless_peer: } asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, accum_moved, reneged_all, will_exit_fast_recovery); } + if (TAILQ_EMPTY(&asoc->sent_queue)) { /* nothing left in-flight */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { @@ -4988,6 +5006,7 @@ hopeless_peer: asoc->total_flight = 0; asoc->total_flight_count = 0; } + /**********************************/ /* Now what about shutdown issues */ /**********************************/ @@ -5122,6 +5141,7 @@ hopeless_peer: if (asoc->peers_rwnd > old_rwnd) { win_probe_recovery = 1; } + /* * Now we must setup so we have a timer up for anyone with * outstanding data. Modified: stable/11/sys/netinet/sctp_indata.h ============================================================================== --- stable/11/sys/netinet/sctp_indata.h Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_indata.h Sun May 5 12:28:39 2019 (r347154) @@ -97,8 +97,7 @@ void sctp_handle_forward_tsn(struct sctp_tcb *, struct sctp_forward_tsn_chunk *, int *, struct mbuf *, int); -struct sctp_tmit_chunk * - sctp_try_advance_peer_ack_point(struct sctp_tcb *, struct sctp_association *); +struct sctp_tmit_chunk *sctp_try_advance_peer_ack_point(struct sctp_tcb *, struct sctp_association *); void sctp_service_queues(struct sctp_tcb *, struct sctp_association *); Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_input.c Sun May 5 12:28:39 2019 (r347154) @@ -305,6 +305,7 @@ sctp_process_init(struct sctp_init_chunk *cp, struct s if (SCTP_BASE_SYSCTL(sctp_logging_level) & (SCTP_CWND_MONITOR_ENABLE | SCTP_CWND_LOGGING_ENABLE)) { sctp_log_cwnd(stcb, lnet, 0, SCTP_CWND_INITIALIZATION); } + } } SCTP_TCB_SEND_LOCK(stcb); @@ -491,6 +492,7 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int SCTP_FREE(param, SCTP_M_ASC_ADDR); } } + stcb->asoc.peer_hmac_id = sctp_negotiate_hmacid(stcb->asoc.peer_hmacs, stcb->asoc.local_hmacs); if (op_err) { @@ -553,6 +555,7 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int } return (retval); } + return (0); } @@ -570,6 +573,7 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk /* Invalid length */ return; } + memset(&store, 0, sizeof(store)); switch (cp->heartbeat.hb_info.addr_family) { #ifdef INET @@ -1717,6 +1721,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle asoc->cookie_how[how_indx] = 5; return (stcb); } + if (ntohl(initack_cp->init.initiate_tag) != asoc->my_vtag && ntohl(init_cp->init.initiate_tag) == asoc->peer_vtag && cookie->tie_tag_my_vtag == 0 && @@ -2292,6 +2297,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in stcb->asoc.authenticated = 1; } } + /* * if we're doing ASCONFs, check to see if we have any new local * addresses that need to get added to the peer (eg. addresses @@ -2589,6 +2595,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in (uint32_t)offset, cookie_offset, sig_offset); return (NULL); } + /* * check the cookie timestamps to be sure it's not stale */ @@ -2709,6 +2716,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in } } } + cookie_len -= SCTP_SIGNATURE_SIZE; if (*stcb == NULL) { /* this is the "normal" case... get a new TCB */ @@ -2911,6 +2919,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, (*stcb), 0, (void *)netl, SCTP_SO_NOT_LOCKED); } + /* * Pull it from the incomplete queue and wake the * guy @@ -2951,6 +2960,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c if ((stcb == NULL) || (net == NULL)) { return; } + asoc = &stcb->asoc; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { sctp_misc_ints(SCTP_THRESHOLD_CLEAR, @@ -3017,6 +3027,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c */ goto closed_socket; } + sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net); @@ -3795,6 +3806,7 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stc if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) { sctp_log_map(0, 7, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT); } + stcb->asoc.tsn_last_delivered = stcb->asoc.cumulative_tsn = stcb->asoc.highest_tsn_inside_map; stcb->asoc.mapping_array_base_tsn = ntohl(resp->senders_next_tsn); memset(stcb->asoc.mapping_array, 0, stcb->asoc.mapping_array_size); @@ -4394,6 +4406,7 @@ sctp_handle_packet_dropped(struct sctp_pktdrop_chunk * if (trunc_len > limit) { trunc_len = limit; } + /* now the chunks themselves */ while ((ch != NULL) && (chlen >= sizeof(struct sctp_chunkhdr))) { desc.chunk_type = ch->chunk_type; @@ -4653,6 +4666,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * */ SCTP_INP_DECR_REF(inp); } + /* now go back and verify any auth chunk to be sure */ if (auth_skipped && (stcb != NULL)) { struct sctp_auth_chunk *auth; @@ -4752,6 +4766,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, *netp); } + process_control_chunks: while (IS_SCTP_CONTROL(ch)) { /* validate chunk length */ @@ -4791,6 +4806,7 @@ process_control_chunks: } return (NULL); } + num_chunks++; /* Save off the last place we got a control from */ if (stcb != NULL) { @@ -5145,6 +5161,7 @@ process_control_chunks: goto abend; } } + if (netp != NULL) { struct sctp_tcb *locked_stcb; @@ -5317,6 +5334,7 @@ process_control_chunks: *offset = length; return (stcb); } + if (stcb != NULL) { int abort_flag = 0; @@ -5379,6 +5397,7 @@ process_control_chunks: *offset = length; return (stcb); } + if ((ch != NULL) && (stcb != NULL) && (netp != NULL) && (*netp != NULL)) { if (stcb->asoc.pktdrop_supported == 0) { goto unknown_chunk; @@ -5641,6 +5660,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph vrf_id, port); goto out; } + } if (IS_SCTP_CONTROL(ch)) { /* process the control portion of the SCTP packet */ @@ -5716,6 +5736,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph */ goto out; } + /* * DATA chunk processing */ @@ -5794,6 +5815,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph * process_data */ } + /* take care of ecn */ if ((data_processed == 1) && (stcb->asoc.ecn_supported == 1) && @@ -5801,6 +5823,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph /* Yep, we need to add a ECNE */ sctp_send_ecn_echo(stcb, net, high_tsn); } + if ((data_processed == 0) && (fwd_tsn_seen)) { int was_a_gap; uint32_t highest_tsn; Modified: stable/11/sys/netinet/sctp_input.h ============================================================================== --- stable/11/sys/netinet/sctp_input.h Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_input.h Sun May 5 12:28:39 2019 (r347154) @@ -50,7 +50,7 @@ struct sctp_stream_reset_request * sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, struct sctp_tmit_chunk **bchk); -void +void sctp_reset_in_stream(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t *list); Modified: stable/11/sys/netinet/sctp_output.h ============================================================================== --- stable/11/sys/netinet/sctp_output.h Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_output.h Sun May 5 12:28:39 2019 (r347154) @@ -72,7 +72,7 @@ int int sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t *ro); -void +void sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED @@ -115,7 +115,7 @@ void sctp_send_shutdown_ack(struct sctp_tcb *, struct void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *, int); -void +void sctp_send_shutdown_complete2(struct sockaddr *, struct sockaddr *, struct sctphdr *, uint8_t, uint32_t, uint16_t, @@ -144,13 +144,13 @@ int sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *, int); -void +void sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif ); -void +void sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED @@ -199,7 +199,7 @@ sctp_send_abort(struct mbuf *, int, struct sockaddr *, uint8_t, uint32_t, uint16_t, uint32_t, uint16_t); -void +void sctp_send_operr_to(struct sockaddr *, struct sockaddr *, struct sctphdr *, uint32_t, struct mbuf *, uint8_t, uint32_t, uint16_t, Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Sun May 5 12:11:58 2019 (r347153) +++ stable/11/sys/netinet/sctp_pcb.c Sun May 5 12:28:39 2019 (r347154) @@ -183,6 +183,7 @@ sctp_allocate_vrf(int vrf_id) SCTP_FREE(vrf, SCTP_M_VRF); return (NULL); } + /* Add it to the hash table */ bucket = &SCTP_BASE_INFO(sctp_vrfhash)[(vrf_id & SCTP_BASE_INFO(hashvrfmark))]; LIST_INSERT_HEAD(bucket, vrf, next_vrf); @@ -734,6 +735,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockadd SCTPDBG(SCTP_DEBUG_PCB4, "Can't find vrf_id 0x%x\n", vrf_id); goto out_now; } + #ifdef SCTP_DEBUG SCTPDBG(SCTP_DEBUG_PCB4, "vrf_id 0x%x: deleting address:", vrf_id); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun May 5 12:32:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42CC8158A37E; Sun, 5 May 2019 12:32:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7DE991EF1; Sun, 5 May 2019 12:32:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B22851FA16; Sun, 5 May 2019 12:32:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45CWmqk034367; Sun, 5 May 2019 12:32:48 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45CWmJO034364; Sun, 5 May 2019 12:32:48 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051232.x45CWmJO034364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 12:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347155 - in stable/11: share/man/man4 sys/netinet sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/netinet sys/netinet6 X-SVN-Commit-Revision: 347155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7DE991EF1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 12:32:49 -0000 Author: tuexen Date: Sun May 5 12:32:47 2019 New Revision: 347155 URL: https://svnweb.freebsd.org/changeset/base/347155 Log: MFC r336551: Add missing dtrace probes for received UDP packets. Fire UDP receive probes when a packet is received and there is no endpoint consuming it. Fire the probe also if the TTL of the received packet is smaller than the minimum required by the endpoint. Clarify also in the man page, when the probe fires. Reviewed by: dteske@, markj@, rrs@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16046 Modified: stable/11/share/man/man4/dtrace_udp.4 stable/11/sys/netinet/udp_usrreq.c stable/11/sys/netinet6/udp6_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/dtrace_udp.4 ============================================================================== --- stable/11/share/man/man4/dtrace_udp.4 Sun May 5 12:28:39 2019 (r347154) +++ stable/11/share/man/man4/dtrace_udp.4 Sun May 5 12:32:47 2019 (r347155) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2015 +.Dd July 20, 2018 .Dt DTRACE_UDP 4 .Os .Sh NAME @@ -45,7 +45,11 @@ The .Fn udp:::send probe fires whenever the kernel prepares to transmit a UDP packet, and the .Fn udp:::receive -probe fires whenever the kernel receives a UDP packet. +probe fires whenever the kernel receives a UDP packet, unless +the UDP header is incomplete, +the destination port is 0, +the length field is invalid, +or the checksum is wrong. The arguments to these probes can be used to obtain detailed information about the IP and UDP headers of the corresponding packet. .Sh ARGUMENTS Modified: stable/11/sys/netinet/udp_usrreq.c ============================================================================== --- stable/11/sys/netinet/udp_usrreq.c Sun May 5 12:28:39 2019 (r347154) +++ stable/11/sys/netinet/udp_usrreq.c Sun May 5 12:32:47 2019 (r347155) @@ -667,6 +667,7 @@ udp_input(struct mbuf **mp, int *offp, int proto) inet_ntoa_r(ip->ip_dst, dst), ntohs(uh->uh_dport), inet_ntoa_r(ip->ip_src, src), ntohs(uh->uh_sport)); } + UDP_PROBE(receive, NULL, NULL, ip, NULL, uh); UDPSTAT_INC(udps_noport); if (m->m_flags & (M_BCAST | M_MCAST)) { UDPSTAT_INC(udps_noportbcast); @@ -686,6 +687,7 @@ udp_input(struct mbuf **mp, int *offp, int proto) */ INP_RLOCK_ASSERT(inp); if (inp->inp_ip_minttl && inp->inp_ip_minttl > ip->ip_ttl) { + UDP_PROBE(receive, NULL, inp, ip, inp, uh); INP_RUNLOCK(inp); m_freem(m); return (IPPROTO_DONE); Modified: stable/11/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/11/sys/netinet6/udp6_usrreq.c Sun May 5 12:28:39 2019 (r347154) +++ stable/11/sys/netinet6/udp6_usrreq.c Sun May 5 12:32:47 2019 (r347155) @@ -456,6 +456,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) ip6_sprintf(ip6bufs, &ip6->ip6_src), ntohs(uh->uh_sport)); } + UDP_PROBE(receive, NULL, NULL, ip6, NULL, uh); UDPSTAT_INC(udps_noport); if (m->m_flags & M_MCAST) { printf("UDP6: M_MCAST is set in a unicast packet.\n"); From owner-svn-src-all@freebsd.org Sun May 5 12:34:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCA24158A44B; Sun, 5 May 2019 12:34:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E1ED92052; Sun, 5 May 2019 12:34:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1058E1FA18; Sun, 5 May 2019 12:34:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45CYWCd034513; Sun, 5 May 2019 12:34:32 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45CYWxs034512; Sun, 5 May 2019 12:34:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051234.x45CYWxs034512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 12:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347156 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E1ED92052 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 12:34:34 -0000 Author: tuexen Date: Sun May 5 12:34:32 2019 New Revision: 347156 URL: https://svnweb.freebsd.org/changeset/base/347156 Log: MFC r336574: Set the IPv4 version in the IP header for UDP and UDPLite. Modified: stable/11/sys/netinet/udp_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/udp_usrreq.c ============================================================================== --- stable/11/sys/netinet/udp_usrreq.c Sun May 5 12:32:47 2019 (r347155) +++ stable/11/sys/netinet/udp_usrreq.c Sun May 5 12:34:32 2019 (r347156) @@ -1383,6 +1383,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s */ ui = mtod(m, struct udpiphdr *); bzero(ui->ui_x1, sizeof(ui->ui_x1)); /* XXX still needed? */ + ui->ui_v = IPVERSION << 4; ui->ui_pr = pr; ui->ui_src = laddr; ui->ui_dst = faddr; @@ -1405,8 +1406,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s * the entire UDPLite packet is covered by the checksum. */ cscov_partial = (cscov == 0) ? 0 : 1; - } else - ui->ui_v = IPVERSION << 4; + } /* * Set the Don't Fragment bit in the IP header. From owner-svn-src-all@freebsd.org Sun May 5 14:14:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CF20158C2B7; Sun, 5 May 2019 14:14:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C557194697; Sun, 5 May 2019 14:14:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B65BB20AB9; Sun, 5 May 2019 14:14:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45EE6Ga086317; Sun, 5 May 2019 14:14:06 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45EE6i4086314; Sun, 5 May 2019 14:14:06 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051414.x45EE6i4086314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 14:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347157 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C557194697 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 14:14:07 -0000 Author: tuexen Date: Sun May 5 14:14:05 2019 New Revision: 347157 URL: https://svnweb.freebsd.org/changeset/base/347157 Log: MFC r336932: Add missing send/recv dtrace probes for TCP. These missing probe are mostly in the syncache and timewait code. Reviewed by: markj@, rrs@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D16369 Modified: stable/11/sys/netinet/tcp_input.c stable/11/sys/netinet/tcp_syncache.c stable/11/sys/netinet/tcp_timewait.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_input.c ============================================================================== --- stable/11/sys/netinet/tcp_input.c Sun May 5 12:34:32 2019 (r347156) +++ stable/11/sys/netinet/tcp_input.c Sun May 5 14:14:05 2019 (r347157) @@ -1178,6 +1178,7 @@ new_tfo_socket: * contains. tcp_do_segment() consumes * the mbuf chain and unlocks the inpcb. */ + TCP_PROBE5(receive, NULL, tp, m, tp, th); tp->t_fb->tfb_tcp_do_segment(m, th, so, tp, drop_hdrlen, tlen, iptos, ti_locked); INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); Modified: stable/11/sys/netinet/tcp_syncache.c ============================================================================== --- stable/11/sys/netinet/tcp_syncache.c Sun May 5 12:34:32 2019 (r347156) +++ stable/11/sys/netinet/tcp_syncache.c Sun May 5 14:14:05 2019 (r347157) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1393,6 +1394,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t */ mac_syncache_destroy(&maclabel); #endif + TCP_PROBE5(receive, NULL, NULL, m, NULL, th); /* Retransmit SYN|ACK and reset retransmit count. */ if ((s = tcp_log_addrs(&sc->sc_inc, th, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: Received duplicate SYN, " @@ -1407,7 +1409,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t TCPSTAT_INC(tcps_sndtotal); } SCH_UNLOCK(sch); - goto done; + goto donenoprobe; } #ifdef TCP_RFC7413 @@ -1565,6 +1567,7 @@ skip_alloc: } #endif + TCP_PROBE5(receive, NULL, NULL, m, NULL, th); /* * Do a standard 3-way handshake. */ @@ -1580,8 +1583,11 @@ skip_alloc: syncache_free(sc); TCPSTAT_INC(tcps_sc_dropped); } + goto donenoprobe; done: + TCP_PROBE5(receive, NULL, NULL, m, NULL, th); +donenoprobe: if (m) { *lsop = NULL; m_freem(m); @@ -1787,6 +1793,7 @@ syncache_respond(struct syncache *sc, struct syncache_ return (error); } #endif + TCP_PROBE5(send, NULL, NULL, ip6, NULL, th); error = ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); } #endif @@ -1807,6 +1814,7 @@ syncache_respond(struct syncache *sc, struct syncache_ return (error); } #endif + TCP_PROBE5(send, NULL, NULL, ip, NULL, th); error = ip_output(m, sc->sc_ipopts, NULL, 0, NULL, NULL); } #endif Modified: stable/11/sys/netinet/tcp_timewait.c ============================================================================== --- stable/11/sys/netinet/tcp_timewait.c Sun May 5 12:34:32 2019 (r347156) +++ stable/11/sys/netinet/tcp_timewait.c Sun May 5 14:14:05 2019 (r347157) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -450,9 +451,14 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to __unu * Acknowledge the segment if it has data or is not a duplicate ACK. */ if (thflags != TH_ACK || tlen != 0 || - th->th_seq != tw->rcv_nxt || th->th_ack != tw->snd_nxt) + th->th_seq != tw->rcv_nxt || th->th_ack != tw->snd_nxt) { + TCP_PROBE5(receive, NULL, NULL, m, NULL, th); tcp_twrespond(tw, TH_ACK); + goto dropnoprobe; + } drop: + TCP_PROBE5(receive, NULL, NULL, m, NULL, th); +dropnoprobe: INP_WUNLOCK(inp); m_freem(m); return (0); @@ -599,6 +605,7 @@ tcp_twrespond(struct tcptw *tw, int flags) th->th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) + optlen, IPPROTO_TCP, 0); ip6->ip6_hlim = in6_selecthlim(inp, NULL); + TCP_PROBE5(send, NULL, NULL, ip6, NULL, th); error = ip6_output(m, inp->in6p_outputopts, NULL, (tw->tw_so_options & SO_DONTROUTE), NULL, NULL, inp); } @@ -614,6 +621,7 @@ tcp_twrespond(struct tcptw *tw, int flags) ip->ip_len = htons(m->m_pkthdr.len); if (V_path_mtu_discovery) ip->ip_off |= htons(IP_DF); + TCP_PROBE5(send, NULL, NULL, ip, NULL, th); error = ip_output(m, inp->inp_options, NULL, ((tw->tw_so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), NULL, inp); From owner-svn-src-all@freebsd.org Sun May 5 15:47:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA202158E393; Sun, 5 May 2019 15:47:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B70C96B7D; Sun, 5 May 2019 15:47:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5922321992; Sun, 5 May 2019 15:47:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45FlMAo033371; Sun, 5 May 2019 15:47:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45FlM2G033369; Sun, 5 May 2019 15:47:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905051547.x45FlM2G033369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 5 May 2019 15:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347158 - in head: sbin/nvmecontrol sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: sbin/nvmecontrol sys/dev/nvme X-SVN-Commit-Revision: 347158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B70C96B7D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 15:47:23 -0000 Author: mav Date: Sun May 5 15:47:21 2019 New Revision: 347158 URL: https://svnweb.freebsd.org/changeset/base/347158 Log: Decode Deallocate Logical Block Features. MFC after: 1 week Modified: head/sbin/nvmecontrol/identify.c head/sys/dev/nvme/nvme.h Modified: head/sbin/nvmecontrol/identify.c ============================================================================== --- head/sbin/nvmecontrol/identify.c Sun May 5 14:14:05 2019 (r347157) +++ head/sbin/nvmecontrol/identify.c Sun May 5 15:47:21 2019 (r347158) @@ -52,7 +52,7 @@ print_namespace(struct nvme_namespace_data *nsdata) uint32_t i; uint32_t lbaf, lbads, ms, rp; uint8_t thin_prov, ptype; - uint8_t flbas_fmt; + uint8_t flbas_fmt, t; thin_prov = (nsdata->nsfeat >> NVME_NS_DATA_NSFEAT_THIN_PROV_SHIFT) & NVME_NS_DATA_NSFEAT_THIN_PROV_MASK; @@ -125,6 +125,16 @@ print_namespace(struct nvme_namespace_data *nsdata) NVME_NS_DATA_FPI_PERC_MASK); } else printf("Not Supported\n"); + t = (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_READ_SHIFT) & + NVME_NS_DATA_DLFEAT_READ_MASK; + printf("Deallocate Logical Block: Read %s%s%s\n", + (t == NVME_NS_DATA_DLFEAT_READ_NR) ? "Not Reported" : + (t == NVME_NS_DATA_DLFEAT_READ_00) ? "00h" : + (t == NVME_NS_DATA_DLFEAT_READ_FF) ? "FFh" : "Unknown", + (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_DWZ_SHIFT) & + NVME_NS_DATA_DLFEAT_DWZ_MASK ? ", Write Zero" : "", + (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_GCRC_SHIFT) & + NVME_NS_DATA_DLFEAT_GCRC_MASK ? ", Guard CRC" : ""); printf("Optimal I/O Boundary (LBAs): %u\n", nsdata->noiob); printf("Globally Unique Identifier: "); for (i = 0; i < sizeof(nsdata->nguid); i++) Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Sun May 5 14:14:05 2019 (r347157) +++ head/sys/dev/nvme/nvme.h Sun May 5 15:47:21 2019 (r347158) @@ -349,6 +349,20 @@ #define NVME_NS_DATA_FPI_SUPP_SHIFT (7) #define NVME_NS_DATA_FPI_SUPP_MASK (0x1) +/** Deallocate Logical Block Features */ +/* deallocated logical block read behavior */ +#define NVME_NS_DATA_DLFEAT_READ_SHIFT (0) +#define NVME_NS_DATA_DLFEAT_READ_MASK (0x07) +#define NVME_NS_DATA_DLFEAT_READ_NR (0x00) +#define NVME_NS_DATA_DLFEAT_READ_00 (0x01) +#define NVME_NS_DATA_DLFEAT_READ_FF (0x02) +/* supports the Deallocate bit in the Write Zeroes */ +#define NVME_NS_DATA_DLFEAT_DWZ_SHIFT (3) +#define NVME_NS_DATA_DLFEAT_DWZ_MASK (0x01) +/* Guard field for deallocated logical blocks is set to the CRC */ +#define NVME_NS_DATA_DLFEAT_GCRC_SHIFT (4) +#define NVME_NS_DATA_DLFEAT_GCRC_MASK (0x01) + /** lba format support */ /* metadata size */ #define NVME_NS_DATA_LBAF_MS_SHIFT (0) From owner-svn-src-all@freebsd.org Sun May 5 16:57:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB8C158F6D8; Sun, 5 May 2019 16:57:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4486C68527; Sun, 5 May 2019 16:57:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B0792253B; Sun, 5 May 2019 16:57:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45Gv3P1069804; Sun, 5 May 2019 16:57:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45Gv3cB069803; Sun, 5 May 2019 16:57:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905051657.x45Gv3cB069803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 5 May 2019 16:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347159 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 347159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4486C68527 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 16:57:04 -0000 Author: markj Date: Sun May 5 16:57:03 2019 New Revision: 347159 URL: https://svnweb.freebsd.org/changeset/base/347159 Log: Ensure that error is initialized in ufs_bmap_seekdata(). Reported and tested by: jhibbits MFC with: r346932 Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ufs/ufs_bmap.c Modified: head/sys/ufs/ufs/ufs_bmap.c ============================================================================== --- head/sys/ufs/ufs/ufs_bmap.c Sun May 5 15:47:21 2019 (r347158) +++ head/sys/ufs/ufs/ufs_bmap.c Sun May 5 16:57:03 2019 (r347159) @@ -354,6 +354,7 @@ ufs_bmap_seekdata(vp, offp) int error, num, num1, off; bp = NULL; + error = 0; ip = VTOI(vp); mp = vp->v_mount; ump = VFSTOUFS(mp); From owner-svn-src-all@freebsd.org Sun May 5 17:10:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B411A158FE16; Sun, 5 May 2019 17:10:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56B8469F55; Sun, 5 May 2019 17:10:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26012226EE; Sun, 5 May 2019 17:10:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45HACEa075017; Sun, 5 May 2019 17:10:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45HACXq075016; Sun, 5 May 2019 17:10:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905051710.x45HACXq075016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 5 May 2019 17:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347160 - head/sys/cam/ata X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ata X-SVN-Commit-Revision: 347160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56B8469F55 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 17:10:14 -0000 Author: mav Date: Sun May 5 17:10:12 2019 New Revision: 347160 URL: https://svnweb.freebsd.org/changeset/base/347160 Log: Decode some more ATA commands found in ACS-4. MFC after: 1 week Modified: head/sys/cam/ata/ata_all.c Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Sun May 5 16:57:03 2019 (r347159) +++ head/sys/cam/ata/ata_all.c Sun May 5 17:10:12 2019 (r347160) @@ -89,8 +89,14 @@ ata_op_string(struct ata_cmd *cmd) case 0x01: return ("DSM TRIM"); } return "DSM"; + case 0x07: + switch (cmd->features) { + case 0x01: return ("DSM_XL TRIM"); + } + return "DSM_XL"; case 0x08: return ("DEVICE_RESET"); case 0x0b: return ("REQUEST_SENSE_DATA_EXT"); + case 0x12: return ("GET_PHYSICAL_ELEMENT_STATUS"); case 0x20: return ("READ"); case 0x24: return ("READ48"); case 0x25: return ("READ_DMA48"); @@ -113,7 +119,11 @@ ata_op_string(struct ata_cmd *cmd) case 0x3f: return ("WRITE_LOG_EXT"); case 0x40: return ("READ_VERIFY"); case 0x42: return ("READ_VERIFY48"); - case 0x44: return ("ZERO_EXT"); + case 0x44: + switch (cmd->features) { + case 0x01: return ("ZERO_EXT TRIM"); + } + return "ZERO_EXT"; case 0x45: switch (cmd->features) { case 0x55: return ("WRITE_UNCORRECTABLE48 PSEUDO"); @@ -135,6 +145,9 @@ ata_op_string(struct ata_cmd *cmd) switch (cmd->features & 0xf) { case 0x00: return ("NCQ_NON_DATA ABORT NCQ QUEUE"); case 0x01: return ("NCQ_NON_DATA DEADLINE HANDLING"); + case 0x02: return ("NCQ_NON_DATA HYBRID DEMOTE BY SIZE"); + case 0x03: return ("NCQ_NON_DATA HYBRID CHANGE BY LBA RANGE"); + case 0x04: return ("NCQ_NON_DATA HYBRID CONTROL"); case 0x05: return ("NCQ_NON_DATA SET FEATURES"); /* * XXX KDM need common decoding between NCQ and non-NCQ @@ -147,6 +160,7 @@ ata_op_string(struct ata_cmd *cmd) case 0x64: switch (cmd->sector_count_exp & 0xf) { case 0x00: return ("SEND_FPDMA_QUEUED DATA SET MANAGEMENT"); + case 0x01: return ("SEND_FPDMA_QUEUED HYBRID EVICT"); case 0x02: return ("SEND_FPDMA_QUEUED WRITE LOG DMA EXT"); case 0x03: return ("SEND_FPDMA_QUEUED ZAC MANAGEMENT OUT"); case 0x04: return ("SEND_FPDMA_QUEUED DATA SET MANAGEMENT XL"); @@ -171,6 +185,7 @@ ata_op_string(struct ata_cmd *cmd) case 0x70: return ("SEEK"); case 0x77: return ("SET_DATE_TIME_EXT"); case 0x78: return ("ACCESSIBLE_MAX_ADDRESS_CONFIGURATION"); + case 0x7C: return ("REMOVE_ELEMENT_AND_TRUNCATE"); case 0x87: return ("CFA_TRANSLATE_SECTOR"); case 0x90: return ("EXECUTE_DEVICE_DIAGNOSTIC"); case 0x92: return ("DOWNLOAD_MICROCODE"); @@ -185,13 +200,15 @@ ata_op_string(struct ata_cmd *cmd) case 0xd1: return ("SMART READ ATTR THRESHOLDS"); case 0xd3: return ("SMART SAVE ATTR VALUES"); case 0xd4: return ("SMART EXECUTE OFFLINE IMMEDIATE"); - case 0xd5: return ("SMART READ LOG DATA"); + case 0xd5: return ("SMART READ LOG"); + case 0xd6: return ("SMART WRITE LOG"); case 0xd8: return ("SMART ENABLE OPERATION"); case 0xd9: return ("SMART DISABLE OPERATION"); case 0xda: return ("SMART RETURN STATUS"); } return ("SMART"); case 0xb1: return ("DEVICE CONFIGURATION"); + case 0xb2: return ("SET_SECTOR_CONFIGURATION_EXT"); case 0xb4: return ("SANITIZE_DEVICE"); case 0xc0: return ("CFA_ERASE"); case 0xc4: return ("READ_MUL"); @@ -229,7 +246,7 @@ ata_op_string(struct ata_cmd *cmd) switch (cmd->features) { case 0x02: return ("SETFEATURES ENABLE WCACHE"); case 0x03: return ("SETFEATURES SET TRANSFER MODE"); - case 0x04: return ("SETFEATURES ENABLE APM"); + case 0x05: return ("SETFEATURES ENABLE APM"); case 0x06: return ("SETFEATURES ENABLE PUIS"); case 0x07: return ("SETFEATURES SPIN-UP"); case 0x0b: return ("SETFEATURES ENABLE WRITE READ VERIFY"); @@ -239,6 +256,7 @@ ata_op_string(struct ata_cmd *cmd) case 0x43: return ("SETFEATURES SET MAX HOST INT SECT TIMES"); case 0x45: return ("SETFEATURES SET RATE BASIS"); case 0x4a: return ("SETFEATURES EXTENDED POWER CONDITIONS"); + case 0x50: return ("SETFEATURES ADVANCED BACKGROUD OPERATION"); case 0x55: return ("SETFEATURES DISABLE RCACHE"); case 0x5d: return ("SETFEATURES ENABLE RELIRQ"); case 0x5e: return ("SETFEATURES ENABLE SRVIRQ"); From owner-svn-src-all@freebsd.org Sun May 5 19:20:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 515521592716; Sun, 5 May 2019 19:20:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB1596DB20; Sun, 5 May 2019 19:20:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C01C723CD5; Sun, 5 May 2019 19:20:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45JKRYs044269; Sun, 5 May 2019 19:20:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45JKRmn044268; Sun, 5 May 2019 19:20:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051920.x45JKRmn044268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 19:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347161 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB1596DB20 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 19:20:28 -0000 Author: tuexen Date: Sun May 5 19:20:27 2019 New Revision: 347161 URL: https://svnweb.freebsd.org/changeset/base/347161 Log: MFC r336937: Send consistent SEG.WIN when using timewait codepath for TCP. When sending TCP segments from the timewait code path, a stored value of the last sent window is used. Use the same code for computing this in the timewait code path as in the main code path used in tcp_output() to avoid inconsistencies. MFC r344148: Fix a byte ordering issue for the advertised receiver window in ACK segments sent in TIMEWAIT state, which I introduced in r336937. Modified: stable/11/sys/netinet/tcp_timewait.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_timewait.c ============================================================================== --- stable/11/sys/netinet/tcp_timewait.c Sun May 5 17:10:12 2019 (r347160) +++ stable/11/sys/netinet/tcp_timewait.c Sun May 5 19:20:27 2019 (r347161) @@ -228,6 +228,7 @@ tcp_twstart(struct tcpcb *tp) struct inpcb *inp = tp->t_inpcb; int acknow; struct socket *so; + uint32_t recwin; #ifdef INET6 int isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6; #endif @@ -294,10 +295,16 @@ tcp_twstart(struct tcpcb *tp) /* * Recover last window size sent. */ - if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) - tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; - else - tw->last_win = 0; + so = inp->inp_socket; + recwin = lmin(lmax(sbspace(&so->so_rcv), 0), + (long)TCP_MAXWIN << tp->rcv_scale); + if (recwin < (so->so_rcv.sb_hiwat / 4) && + recwin < tp->t_maxseg) + recwin = 0; + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && + recwin < (tp->rcv_adv - tp->rcv_nxt)) + recwin = (tp->rcv_adv - tp->rcv_nxt); + tw->last_win = (u_short)(recwin >> tp->rcv_scale); /* * Set t_recent if timestamps are used on the connection. @@ -334,7 +341,6 @@ tcp_twstart(struct tcpcb *tp) * and might not be needed here any longer. */ tcp_discardcb(tp); - so = inp->inp_socket; soisdisconnected(so); tw->tw_cred = crhold(so->so_cred); SOCK_LOCK(so); From owner-svn-src-all@freebsd.org Sun May 5 19:24:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A715C1592BB4 for ; Sun, 5 May 2019 19:24:34 +0000 (UTC) (envelope-from njm@njm.me.uk) Received: from smtp001-out2.apm-internet.net (smtp001-out2.apm-internet.net [85.119.248.224]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C16346E001 for ; Sun, 5 May 2019 19:24:32 +0000 (UTC) (envelope-from njm@njm.me.uk) Received: (qmail 99075 invoked from network); 5 May 2019 19:17:50 -0000 X-APM-Out-ID: 15570838699907 X-APM-Authkey: 18389/1(18389/1) 5 Received: from unknown (HELO meld.njm.me.uk) (90.194.180.219) by smtp001.apm-internet.net with SMTP; 5 May 2019 19:17:50 -0000 Received: from triton.njm.me.uk (triton.njm.me.uk [192.168.144.133]) by meld.njm.me.uk (8.15.2/8.15.2) with ESMTP id x45JHnVV056298; Sun, 5 May 2019 20:17:49 +0100 (BST) (envelope-from njm@njm.me.uk) Received: from localhost (localhost [127.0.0.1]) by triton.njm.me.uk (8.15.2/8.15.2) with ESMTP id x45JHn9p093620; Sun, 5 May 2019 20:17:49 +0100 (BST) (envelope-from njm@njm.me.uk) Date: Sun, 05 May 2019 20:17:49 +0100 From: "N.J. Mann" To: Rick Macklem , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r347009 - stable/11/usr.sbin/nfsdumpstate Message-ID: <44A4D649336608E100695337@triton.njm.me.uk> In-Reply-To: <201905020111.x421Bonf082237@repo.freebsd.org> References: <201905020111.x421Bonf082237@repo.freebsd.org> X-Mailer: Mulberry/4.0.8 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Rspamd-Queue-Id: C16346E001 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-0.15 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.87)[-0.870,0]; RCVD_COUNT_FIVE(0.00)[5]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.78)[0.783,0]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[njm.me.uk]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-0.83)[-0.830,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[b.mx.fluent.ltd.uk,b.mx.fluent.ltd.uk,b.mx.fluent.ltd.uk,b.mx.fluent.ltd.uk,b.mx.fluent.ltd.uk]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[224.248.119.85.list.dnswl.org : 127.0.3.1]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:35259, ipnet:85.119.248.0/21, country:GB]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-0.02)[country: GB(-0.09)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 19:24:34 -0000 Hi, On Thursday, May 02, 2019 01:11:50 +0000 Rick Macklem wrote: > Author: rmacklem > Date: Thu May 2 01:11:49 2019 > New Revision: 347009 > URL: https://svnweb.freebsd.org/changeset/base/347009 > > Log: > MFC: r346709 > Add support to nfsdumpstate for printing of INET6 addresses for locks. > > r346190 added support for printing of INET6 addresses for the "-o" option > (all opens) but missed adding support for INET6 addresses for the "-l" option. > This patch adds that support. > > Modified: > stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c > Directory Properties: > stable/11/ (props changed) This MFC and the corresponding ones to 12-STABLE and 10-STABLE is incomplete. You need to MFC revision 346856 which makes the definitions on nbuf conditional on INET6. Best wishes, Nick. -- From owner-svn-src-all@freebsd.org Sun May 5 19:31:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED3841593043; Sun, 5 May 2019 19:31:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91E216E463; Sun, 5 May 2019 19:31:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C51223EAD; Sun, 5 May 2019 19:31:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45JVIjl051610; Sun, 5 May 2019 19:31:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45JVIgT051609; Sun, 5 May 2019 19:31:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051931.x45JVIgT051609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 19:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347162 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347162 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 91E216E463 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 19:31:19 -0000 Author: tuexen Date: Sun May 5 19:31:17 2019 New Revision: 347162 URL: https://svnweb.freebsd.org/changeset/base/347162 Log: MFC r337688: Add explicit cast to silence a warning for the userland stack. Thanks to Felix Weinrank for providing the patch. Modified: stable/11/sys/netinet/sctp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sun May 5 19:20:27 2019 (r347161) +++ stable/11/sys/netinet/sctp_output.c Sun May 5 19:31:17 2019 (r347162) @@ -4394,7 +4394,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, } else { ip6h->ip6_nxt = IPPROTO_SCTP; } - ip6h->ip6_plen = htons(packet_length - sizeof(struct ip6_hdr)); + ip6h->ip6_plen = htons((uint16_t)(packet_length - sizeof(struct ip6_hdr))); ip6h->ip6_dst = sin6->sin6_addr; /* @@ -11256,7 +11256,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad #endif #ifdef INET6 case AF_INET6: - ip6->ip6_plen = htons(len - sizeof(struct ip6_hdr)); + ip6->ip6_plen = htons((uint16_t)(len - sizeof(struct ip6_hdr))); if (port) { shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); From owner-svn-src-all@freebsd.org Sun May 5 19:39:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62BA915931A8; Sun, 5 May 2019 19:39:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 138F46E71D; Sun, 5 May 2019 19:39:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C35F824012; Sun, 5 May 2019 19:39:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45JdXGD054781; Sun, 5 May 2019 19:39:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45JdWW1054772; Sun, 5 May 2019 19:39:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905051939.x45JdWW1054772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 19:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347163 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 138F46E71D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 19:39:34 -0000 Author: tuexen Date: Sun May 5 19:39:32 2019 New Revision: 347163 URL: https://svnweb.freebsd.org/changeset/base/347163 Log: MFC r337706: Use consistently the macors to modify the assoc state. No functional change. Modified: stable/11/sys/netinet/sctp_indata.c stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_pcb.c stable/11/sys/netinet/sctp_usrreq.c stable/11/sys/netinet/sctputil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sun May 5 19:31:17 2019 (r347162) +++ stable/11/sys/netinet/sctp_indata.c Sun May 5 19:39:32 2019 (r347163) @@ -4327,9 +4327,9 @@ again: /* clean up */ if ((asoc->stream_queue_cnt == 1) && ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (asoc->state & SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { - asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && @@ -5024,9 +5024,9 @@ hopeless_peer: /* clean up */ if ((asoc->stream_queue_cnt == 1) && ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (asoc->state & SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { - asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sun May 5 19:31:17 2019 (r347162) +++ stable/11/sys/netinet/sctp_input.c Sun May 5 19:39:32 2019 (r347163) @@ -742,8 +742,7 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) */ /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); - stcb->asoc.state &= ~SCTP_STATE_COOKIE_ECHOED; - stcb->asoc.state |= SCTP_STATE_COOKIE_WAIT; + SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); sctp_stop_all_cookie_timers(stcb); sctp_toss_old_cookies(stcb, &stcb->asoc); stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); @@ -840,7 +839,7 @@ sctp_handle_abort(struct sctp_abort_chunk *abort, SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif - stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; + SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_WAS_ABORTED); (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_8); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -1266,8 +1265,7 @@ sctp_handle_error(struct sctp_chunkhdr *ch, } /* blast back to INIT state */ sctp_toss_old_cookies(stcb, &stcb->asoc); - asoc->state &= ~SCTP_STATE_COOKIE_ECHOED; - asoc->state |= SCTP_STATE_COOKIE_WAIT; + SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); sctp_stop_all_cookie_timers(stcb); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); } @@ -1418,7 +1416,7 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int o return (-1); } /* process according to association state... */ - switch (stcb->asoc.state & SCTP_STATE_MASK) { + switch (SCTP_GET_STATE(&stcb->asoc)) { case SCTP_STATE_COOKIE_WAIT: /* this is the expected state for this chunk */ /* process the INIT-ACK parameters */ @@ -1842,8 +1840,8 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle asoc->cookie_how[how_indx] = 10; return (NULL); } - if ((asoc->state & SCTP_STATE_COOKIE_WAIT) || - (asoc->state & SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { *notification = SCTP_NOTIFY_ASSOC_UP; if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || @@ -1956,7 +1954,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, asoc->primary_destination); - } else if (!(asoc->state & SCTP_STATE_SHUTDOWN_SENT)) { + } else if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) { /* move to OPEN state, if not in SHUTDOWN_SENT */ SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); } @@ -2884,7 +2882,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in * the accept state waiting for the accept! */ if (*stcb) { - (*stcb)->asoc.state |= SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_ADD_SUBSTATE(&(*stcb)->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); } sctp_move_pcb_and_assoc(*inp_p, inp, *stcb); Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sun May 5 19:31:17 2019 (r347162) +++ stable/11/sys/netinet/sctp_output.c Sun May 5 19:39:32 2019 (r347163) @@ -6732,9 +6732,9 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } - asoc->state |= SCTP_STATE_SHUTDOWN_PENDING; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { @@ -7854,7 +7854,7 @@ sctp_med_chunk_output(struct sctp_inpcb *inp, *reason_code = 0; auth_keyid = stcb->asoc.authinfo.active_keyid; if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (asoc->state & SCTP_STATE_SHUTDOWN_RECEIVED) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR))) { eeor_mode = 1; } else { @@ -8662,7 +8662,7 @@ again_one_more_time: chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; } if (SCTP_BASE_SYSCTL(sctp_enable_sack_immediately) && - ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) == SCTP_STATE_SHUTDOWN_PENDING)) { + (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) { struct sctp_data_chunk *dchkh; dchkh = mtod(chk->data, struct sctp_data_chunk *); @@ -13537,9 +13537,9 @@ dataless_eof: hold_tcblock = 1; } if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } - asoc->state |= SCTP_STATE_SHUTDOWN_PENDING; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Sun May 5 19:31:17 2019 (r347162) +++ stable/11/sys/netinet/sctp_pcb.c Sun May 5 19:39:32 2019 (r347163) @@ -3371,7 +3371,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, * was not closed. So go ahead and * start it now. */ - asoc->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); } SCTP_TCB_UNLOCK(asoc); @@ -3395,7 +3395,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, } /* Disconnect the socket please */ asoc->sctp_socket = NULL; - asoc->asoc.state |= SCTP_STATE_CLOSED_SOCKET; + SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_CLOSED_SOCKET); if ((asoc->asoc.size_on_reasm_queue > 0) || (asoc->asoc.control_pdapi) || (asoc->asoc.size_on_all_streams > 0) || @@ -3451,11 +3451,11 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, } } else { /* mark into shutdown pending */ - asoc->asoc.state |= SCTP_STATE_SHUTDOWN_PENDING; + SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, asoc->sctp_ep, asoc, asoc->asoc.primary_destination); if ((*asoc->asoc.ss_functions.sctp_ss_is_user_msgs_incomplete) (asoc, &asoc->asoc)) { - asoc->asoc.state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } if (TAILQ_EMPTY(&asoc->asoc.send_queue) && TAILQ_EMPTY(&asoc->asoc.sent_queue) && @@ -3516,7 +3516,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, SCTP_TCB_LOCK(asoc); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { - asoc->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); } cnt++; @@ -4801,7 +4801,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc } /* Now the read queue needs to be cleaned up (only once) */ if ((stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0) { - stcb->asoc.state |= SCTP_STATE_ABOUT_TO_BE_FREED; + SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_ABOUT_TO_BE_FREED); SCTP_INP_READ_LOCK(inp); TAILQ_FOREACH(sq, &inp->read_queue, next) { if (sq->stcb == stcb) { @@ -4855,7 +4855,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc if ((stcb->asoc.refcnt) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { - stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_CLEAR_SUBSTATE(&stcb->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); } SCTP_TCB_UNLOCK(stcb); @@ -4937,7 +4937,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc atomic_add_int(&stcb->asoc.refcnt, -1); } if (stcb->asoc.refcnt) { - stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_CLEAR_SUBSTATE(&stcb->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); if (from_inpcbfree == SCTP_NORMAL_PROC) { SCTP_INP_INFO_WUNLOCK(); @@ -6275,7 +6275,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * assoc? straighten out locks. */ if (stcb_tmp) { - if (SCTP_GET_STATE(&stcb_tmp->asoc) & SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(&stcb_tmp->asoc) == SCTP_STATE_COOKIE_WAIT) { struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; @@ -6375,7 +6375,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * assoc? straighten out locks. */ if (stcb_tmp) { - if (SCTP_GET_STATE(&stcb_tmp->asoc) & SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(&stcb_tmp->asoc) == SCTP_STATE_COOKIE_WAIT) { struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; Modified: stable/11/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/11/sys/netinet/sctp_usrreq.c Sun May 5 19:31:17 2019 (r347162) +++ stable/11/sys/netinet/sctp_usrreq.c Sun May 5 19:39:32 2019 (r347163) @@ -771,11 +771,11 @@ sctp_disconnect(struct socket *so) netp = stcb->asoc.primary_destination; } - asoc->state |= SCTP_STATE_SHUTDOWN_PENDING; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - asoc->state |= SCTP_STATE_PARTIAL_MSG_LEFT; + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && @@ -7224,7 +7224,7 @@ sctp_accept(struct socket *so, struct sockaddr **addr) SCTP_TCB_LOCK(stcb); SCTP_INP_RUNLOCK(inp); store = stcb->asoc.primary_destination->ro._l_addr; - stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + SCTP_CLEAR_SUBSTATE(&stcb->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); SCTP_TCB_UNLOCK(stcb); switch (store.sa.sa_family) { #ifdef INET Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Sun May 5 19:31:17 2019 (r347162) +++ stable/11/sys/netinet/sctputil.c Sun May 5 19:39:32 2019 (r347163) @@ -3695,8 +3695,8 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb if (stcb->sctp_socket->so_rcv.sb_state & SBS_CANTRCVMORE) { return; } - if ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || - (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { if ((notification == SCTP_NOTIFY_INTERFACE_DOWN) || (notification == SCTP_NOTIFY_INTERFACE_UP) || (notification == SCTP_NOTIFY_INTERFACE_CONFIRMED)) { @@ -3770,16 +3770,16 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb break; } case SCTP_NOTIFY_ASSOC_LOC_ABORTED: - if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 0, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 0, so_locked); } break; case SCTP_NOTIFY_ASSOC_REM_ABORTED: - if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 1, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 1, so_locked); @@ -4023,7 +4023,7 @@ sctp_abort_association(struct sctp_inpcb *inp, struct if (stcb != NULL) { /* We have a TCB to abort, send notification too */ sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); - stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; + SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_WAS_ABORTED); /* Ok, now lets free it */ #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); @@ -4134,7 +4134,7 @@ sctp_abort_an_association(struct sctp_inpcb *inp, stru } return; } else { - stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; + SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_WAS_ABORTED); } /* notify the peer */ sctp_send_abort_tcb(stcb, op_err, so_locked); @@ -5127,9 +5127,8 @@ sctp_user_rcvd(struct sctp_tcb *stcb, uint32_t *freed_ atomic_add_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & (SCTP_STATE_ABOUT_TO_BE_FREED | - SCTP_STATE_SHUTDOWN_RECEIVED | - SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) || + (stcb->asoc.state & (SCTP_STATE_ABOUT_TO_BE_FREED | SCTP_STATE_SHUTDOWN_RECEIVED))) { /* Pre-check If we are freeing no update */ goto no_lock; } From owner-svn-src-all@freebsd.org Sun May 5 20:05:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A1BD1593C2C; Sun, 5 May 2019 20:05:51 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 003A86F572; Sun, 5 May 2019 20:05:51 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D031724528; Sun, 5 May 2019 20:05:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45K5okf070152; Sun, 5 May 2019 20:05:50 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45K5oHf070151; Sun, 5 May 2019 20:05:50 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905052005.x45K5oHf070151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 5 May 2019 20:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347164 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 347164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 003A86F572 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 20:05:51 -0000 Author: jhibbits Date: Sun May 5 20:05:50 2019 New Revision: 347164 URL: https://svnweb.freebsd.org/changeset/base/347164 Log: powerpc/booke: Fix size check for phys_avail in pmap bootstrap Use the nitems() macro instead of the expansion, a'la r298352. Also, fix the location of this check to after initializing availmem_regions_sz, so that the check isn't always against 0, thus always failing (nitems(phys_avail) is always more than 0). Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun May 5 19:39:32 2019 (r347163) +++ head/sys/powerpc/booke/pmap.c Sun May 5 20:05:50 2019 (r347164) @@ -1843,9 +1843,6 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o debugf(" kernstart = 0x%"PRI0ptrX"\n", kernstart); debugf(" kernsize = 0x%"PRI0ptrX"\n", kernsize); - if (sizeof(phys_avail) / sizeof(phys_avail[0]) < availmem_regions_sz) - panic("mmu_booke_bootstrap: phys_avail too small"); - /* * Remove kernel physical address range from avail regions list. Page * align all regions. Non-page aligned memory isn't very interesting @@ -1855,6 +1852,10 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o /* Retrieve phys/avail mem regions */ mem_regions(&physmem_regions, &physmem_regions_sz, &availmem_regions, &availmem_regions_sz); + + if (nitems(phys_avail) < availmem_regions_sz) + panic("mmu_booke_bootstrap: phys_avail too small"); + sz = 0; cnt = availmem_regions_sz; debugf("processing avail regions:\n"); From owner-svn-src-all@freebsd.org Sun May 5 20:08:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 926CD1593DDE; Sun, 5 May 2019 20:08:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 420C86F7B5; Sun, 5 May 2019 20:08:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AF0B2452A; Sun, 5 May 2019 20:08:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45K83hW070308; Sun, 5 May 2019 20:08:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45K81c0070299; Sun, 5 May 2019 20:08:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905052008.x45K81c0070299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 20:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347165 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 420C86F7B5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 20:08:04 -0000 Author: tuexen Date: Sun May 5 20:08:01 2019 New Revision: 347165 URL: https://svnweb.freebsd.org/changeset/base/347165 Log: MFC r337708: Use the stcb instead of the asoc in state macros. This is not a functional change. Just a preparation for upcoming dtrace state change provider support. Modified: stable/11/sys/netinet/sctp_asconf.c stable/11/sys/netinet/sctp_constants.h stable/11/sys/netinet/sctp_indata.c stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_pcb.c stable/11/sys/netinet/sctp_peeloff.c stable/11/sys/netinet/sctp_timer.c stable/11/sys/netinet/sctp_usrreq.c stable/11/sys/netinet/sctputil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_asconf.c ============================================================================== --- stable/11/sys/netinet/sctp_asconf.c Sun May 5 20:05:50 2019 (r347164) +++ stable/11/sys/netinet/sctp_asconf.c Sun May 5 20:08:01 2019 (r347165) @@ -1989,8 +1989,8 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *inp, struct sc * sent when the state goes open. */ if (status == 0 && - ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED))) { + ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED))) { #ifdef SCTP_TIMER_BASED_ASCONF sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp, stcb, stcb->asoc.primary_destination); @@ -2240,8 +2240,8 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, stru * count of queued params. If in the non-open * state, these get sent when the assoc goes open. */ - if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { if (status >= 0) { num_queued++; } @@ -2302,8 +2302,8 @@ sctp_set_primary_ip_address_sa(struct sctp_tcb *stcb, "set_primary_ip_address_sa: queued on tcb=%p, ", (void *)stcb); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); - if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { #ifdef SCTP_TIMER_BASED_ASCONF sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, stcb->sctp_ep, stcb, @@ -2842,8 +2842,7 @@ sctp_process_initack_addresses(struct sctp_tcb *stcb, * out the ASCONF. */ if (status == 0 && - SCTP_GET_STATE(&stcb->asoc) == - SCTP_STATE_OPEN) { + SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { #ifdef SCTP_TIMER_BASED_ASCONF sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, stcb->sctp_ep, stcb, Modified: stable/11/sys/netinet/sctp_constants.h ============================================================================== --- stable/11/sys/netinet/sctp_constants.h Sun May 5 20:05:50 2019 (r347164) +++ stable/11/sys/netinet/sctp_constants.h Sun May 5 20:08:01 2019 (r347165) @@ -468,10 +468,14 @@ __FBSDID("$FreeBSD$"); #define SCTP_STATE_IN_ACCEPT_QUEUE 0x1000 #define SCTP_STATE_MASK 0x007f -#define SCTP_GET_STATE(asoc) ((asoc)->state & SCTP_STATE_MASK) -#define SCTP_SET_STATE(asoc, newstate) ((asoc)->state = ((asoc)->state & ~SCTP_STATE_MASK) | newstate) -#define SCTP_CLEAR_SUBSTATE(asoc, substate) ((asoc)->state &= ~substate) -#define SCTP_ADD_SUBSTATE(asoc, substate) ((asoc)->state |= substate) +#define SCTP_GET_STATE(_stcb) \ + ((_stcb)->asoc.state & SCTP_STATE_MASK) +#define SCTP_SET_STATE(_stcb, _state) \ + (_stcb)->asoc.state = ((_stcb)->asoc.state & ~SCTP_STATE_MASK) | (_state) +#define SCTP_CLEAR_SUBSTATE(_stcb, _substate) \ + (_stcb)->asoc.state &= ~(_substate) +#define SCTP_ADD_SUBSTATE(_stcb, _substate) \ + (_stcb)->asoc.state |= (_substate) /* SCTP reachability state for each address */ #define SCTP_ADDR_REACHABLE 0x001 Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sun May 5 20:05:50 2019 (r347164) +++ stable/11/sys/netinet/sctp_indata.c Sun May 5 20:08:01 2019 (r347165) @@ -2571,7 +2571,7 @@ sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap) * Now we need to see if we need to queue a sack or just start the * timer (if allowed). */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) { /* * Ok special case, in SHUTDOWN-SENT case. here we maker * sure SACK timer is off and instead send a SHUTDOWN and a @@ -2928,7 +2928,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_last_rcvd); } /* now service all of the reassm queue if needed */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) { /* Assure that we ack right away */ stcb->asoc.send_sack = 1; } @@ -4327,12 +4327,12 @@ again: /* clean up */ if ((asoc->stream_queue_cnt == 1) && ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) && ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); } if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) && (asoc->stream_queue_cnt == 1) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { struct mbuf *op_err; @@ -4348,12 +4348,12 @@ again: (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); if (asoc->alternate) { netp = asoc->alternate; @@ -4365,13 +4365,13 @@ again: stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); - } else if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) && + } else if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) && (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; SCTP_STAT_DECR_GAUGE32(sctps_currestab); - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_ACK_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); if (asoc->alternate) { netp = asoc->alternate; @@ -5024,12 +5024,12 @@ hopeless_peer: /* clean up */ if ((asoc->stream_queue_cnt == 1) && ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) && ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc))) { - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); } if (((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) && (asoc->stream_queue_cnt == 1) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { struct mbuf *op_err; @@ -5045,12 +5045,12 @@ hopeless_peer: (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); if (asoc->alternate) { netp = asoc->alternate; @@ -5063,13 +5063,13 @@ hopeless_peer: sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); return; - } else if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) && + } else if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) && (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; SCTP_STAT_DECR_GAUGE32(sctps_currestab); - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_ACK_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); if (asoc->alternate) { netp = asoc->alternate; Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sun May 5 20:05:50 2019 (r347164) +++ stable/11/sys/netinet/sctp_input.c Sun May 5 20:08:01 2019 (r347165) @@ -190,7 +190,7 @@ sctp_handle_init(struct mbuf *m, int iphlen, int offse goto outnow; } if ((stcb != NULL) && - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT)) { + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT)) { SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending SHUTDOWN-ACK\n"); sctp_send_shutdown_ack(stcb, NULL); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); @@ -713,15 +713,15 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) */ struct sctpasochead *head; - if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_INP_INFO_WLOCK(); SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) { /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); @@ -735,14 +735,14 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) SCTP_INP_INFO_WUNLOCK(); return (1); } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) { /* * treat like a case where the cookie expired i.e.: - dump * current cookie. - generate a new vtag. - resend init. */ /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); - SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); sctp_stop_all_cookie_timers(stcb); sctp_toss_old_cookies(stcb, &stcb->asoc); stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); @@ -824,8 +824,8 @@ sctp_handle_abort(struct sctp_abort_chunk *abort, sctp_abort_notification(stcb, 1, error, abort, SCTP_SO_NOT_LOCKED); /* free the tcb */ SCTP_STAT_INCR_COUNTER32(sctps_aborted); - if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } #ifdef SCTP_ASOCLOG_OF_TSNS @@ -839,7 +839,7 @@ sctp_handle_abort(struct sctp_abort_chunk *abort, SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif - SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_WAS_ABORTED); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_WAS_ABORTED); (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_8); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -894,15 +894,15 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, if (stcb == NULL) return; asoc = &stcb->asoc; - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { return; } if (ntohs(cp->ch.chunk_length) != sizeof(struct sctp_shutdown_chunk)) { /* Shutdown NOT the expected size */ return; } - old_state = SCTP_GET_STATE(asoc); + old_state = SCTP_GET_STATE(stcb); sctp_update_acked(stcb, cp, abort_flag); if (*abort_flag) { return; @@ -958,11 +958,11 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, } /* goto SHUTDOWN_RECEIVED state to block new requests */ if (stcb->sctp_socket) { - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT)) { - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_RECEIVED); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT)) { + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_RECEIVED); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); /* * notify upper layer that peer has initiated a * shutdown @@ -973,7 +973,7 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); } } - if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) { /* * stop the shutdown timer, since we WILL move to * SHUTDOWN-ACK-SENT. @@ -993,13 +993,13 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, /* no outstanding data to send, so move on... */ /* send SHUTDOWN-ACK */ /* move to SHUTDOWN-ACK-SENT state */ - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT) { - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); + if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) { + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_ACK_SENT); sctp_stop_timers_for_shutdown(stcb); sctp_send_shutdown_ack(stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, @@ -1028,15 +1028,15 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chun asoc = &stcb->asoc; /* process according to association state */ - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { /* unexpected SHUTDOWN-ACK... do OOTB handling... */ sctp_send_shutdown_complete(stcb, net, 1); SCTP_TCB_UNLOCK(stcb); return; } - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { /* unexpected SHUTDOWN-ACK... so ignore... */ SCTP_TCB_UNLOCK(stcb); return; @@ -1232,7 +1232,7 @@ sctp_handle_error(struct sctp_chunkhdr *ch, * waiting. */ if ((cause_length >= sizeof(struct sctp_error_stale_cookie)) && - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { struct sctp_error_stale_cookie *stale_cookie; stale_cookie = (struct sctp_error_stale_cookie *)cause; @@ -1265,7 +1265,7 @@ sctp_handle_error(struct sctp_chunkhdr *ch, } /* blast back to INIT state */ sctp_toss_old_cookies(stcb, &stcb->asoc); - SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); sctp_stop_all_cookie_timers(stcb); sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); } @@ -1416,7 +1416,7 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int o return (-1); } /* process according to association state... */ - switch (SCTP_GET_STATE(&stcb->asoc)) { + switch (SCTP_GET_STATE(stcb)) { case SCTP_STATE_COOKIE_WAIT: /* this is the expected state for this chunk */ /* process the INIT-ACK parameters */ @@ -1442,7 +1442,7 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int o } /* update our state */ SCTPDBG(SCTP_DEBUG_INPUT2, "moving to COOKIE-ECHOED state\n"); - SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_ECHOED); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_ECHOED); /* reset the RTO calc */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { @@ -1536,7 +1536,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle if (how_indx < sizeof(asoc->cookie_how)) { asoc->cookie_how[how_indx] = 1; } - if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) { /* SHUTDOWN came in after sending INIT-ACK */ sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination); op_err = sctp_generate_cause(SCTP_CAUSE_COOKIE_IN_SHUTDOWN, ""); @@ -1605,7 +1605,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle return (NULL); } - switch (SCTP_GET_STATE(asoc)) { + switch (SCTP_GET_STATE(stcb)) { case SCTP_STATE_COOKIE_WAIT: case SCTP_STATE_COOKIE_ECHOED: /* @@ -1629,12 +1629,12 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_14); /* update current state */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) SCTP_STAT_INCR_COUNTER32(sctps_activeestab); else SCTP_STAT_INCR_COUNTER32(sctps_collisionestab); - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, asoc->primary_destination); @@ -1735,7 +1735,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle * If nat support, and the below and stcb is established, send back * a ABORT(colliding state) if we are established. */ - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) && + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) && (asoc->peer_supports_nat) && ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) && ((ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) || @@ -1840,8 +1840,8 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle asoc->cookie_how[how_indx] = 10; return (NULL); } - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { *notification = SCTP_NOTIFY_ASSOC_UP; if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || @@ -1869,17 +1869,17 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle SCTP_SOCKET_UNLOCK(so, 1); #endif } - if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) SCTP_STAT_INCR_COUNTER32(sctps_activeestab); else SCTP_STAT_INCR_COUNTER32(sctps_collisionestab); SCTP_STAT_INCR_GAUGE32(sctps_currestab); - } else if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { + } else if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { SCTP_STAT_INCR_COUNTER32(sctps_restartestab); } else { SCTP_STAT_INCR_COUNTER32(sctps_collisionestab); } - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, asoc->primary_destination); @@ -1939,24 +1939,24 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle /* notify upper layer */ *notification = SCTP_NOTIFY_ASSOC_RESTART; atomic_add_int(&stcb->asoc.refcnt, 1); - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_OPEN) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_OPEN) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT)) { SCTP_STAT_INCR_GAUGE32(sctps_currestab); } - if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { SCTP_STAT_INCR_GAUGE32(sctps_restartestab); - } else if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) { + } else if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) { SCTP_STAT_INCR_GAUGE32(sctps_collisionestab); } if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, asoc->primary_destination); - } else if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) { + } else if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) { /* move to OPEN state, if not in SHUTDOWN_SENT */ - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); } asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams); @@ -2345,7 +2345,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in /* update current state */ SCTPDBG(SCTP_DEBUG_INPUT2, "moving to OPEN state\n"); - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, asoc->primary_destination); @@ -2882,7 +2882,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, in * the accept state waiting for the accept! */ if (*stcb) { - SCTP_ADD_SUBSTATE(&(*stcb)->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); + SCTP_ADD_SUBSTATE(*stcb, SCTP_STATE_IN_ACCEPT_QUEUE); } sctp_move_pcb_and_assoc(*inp_p, inp, *stcb); @@ -2970,10 +2970,10 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c asoc->overall_error_count = 0; sctp_stop_all_cookie_timers(stcb); /* process according to association state */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) { /* state change only needed when I am in right state */ SCTPDBG(SCTP_DEBUG_INPUT2, "moving to OPEN state\n"); - SCTP_SET_STATE(asoc, SCTP_STATE_OPEN); + SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); sctp_start_net_timers(stcb); if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, @@ -3244,7 +3244,7 @@ sctp_handle_shutdown_complete(struct sctp_shutdown_com asoc = &stcb->asoc; /* process according to association state */ - if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT) { + if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) { /* unexpected SHUTDOWN-COMPLETE... so ignore... */ SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_complete: not in SCTP_STATE_SHUTDOWN_ACK_SENT --- ignore\n"); @@ -4759,7 +4759,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (((ch->chunk_type == SCTP_SELECTIVE_ACK) || (ch->chunk_type == SCTP_NR_SELECTIVE_ACK) || (ch->chunk_type == SCTP_HEARTBEAT_REQUEST)) && - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { /* implied cookie-ack.. we must have lost the ack */ sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, *netp); @@ -4953,7 +4953,7 @@ process_control_chunks: break; } } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) { /*- * If we have sent a shutdown-ack, we will pay no * attention to a sack sent in to us since @@ -5762,7 +5762,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph * not get here unless we really did have a tag, so we don't * abort if this happens, just dump the chunk silently. */ - switch (SCTP_GET_STATE(&stcb->asoc)) { + switch (SCTP_GET_STATE(stcb)) { case SCTP_STATE_COOKIE_ECHOED: /* * we consider data with valid tags in this state Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sun May 5 20:05:50 2019 (r347164) +++ stable/11/sys/netinet/sctp_output.c Sun May 5 20:08:01 2019 (r347165) @@ -5527,7 +5527,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct asoc = NULL; } if ((asoc != NULL) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_COOKIE_WAIT)) { + (SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_WAIT)) { if (sctp_are_there_new_addresses(asoc, init_pkt, offset, src)) { /* * new addresses, out of here in non-cookie-wait @@ -5830,9 +5830,9 @@ do_a_abort: initack->ch.chunk_length = 0; /* place in my tag */ if ((asoc != NULL) && - ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_INUSE) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED))) { + ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_INUSE) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED))) { /* re-use the v-tags and init-seq here */ initack->init.initiate_tag = htonl(asoc->my_vtag); initack->init.initial_tsn = htonl(asoc->init_seq_number); @@ -6361,9 +6361,9 @@ sctp_msg_append(struct sctp_tcb *stcb, } strm = &stcb->asoc.strmout[srcv->sinfo_stream]; /* Now can we send this? */ - if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_SENT) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) || - (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || (stcb->asoc.state & SCTP_STATE_SHUTDOWN_PENDING)) { /* got data while shutting down */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ECONNRESET); @@ -6696,18 +6696,18 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s * there is nothing queued to send, so I'm * done... */ - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { /* * only send SHUTDOWN the first time * through */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); sctp_send_shutdown(stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, @@ -6728,13 +6728,13 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s * we will allow user data to be sent first * and move to SHUTDOWN-PENDING */ - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); } - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { @@ -7854,7 +7854,7 @@ sctp_med_chunk_output(struct sctp_inpcb *inp, *reason_code = 0; auth_keyid = stcb->asoc.authinfo.active_keyid; if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR))) { eeor_mode = 1; } else { @@ -8612,8 +8612,8 @@ again_one_more_time: omtu = 0; break; } - if ((((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) && + if ((((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) && (skip_data_for_this_net == 0)) || (cookie)) { TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { @@ -9563,8 +9563,8 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, if (TAILQ_EMPTY(&asoc->sent_queue)) { return (SCTP_RETRAN_DONE); } - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT)) { /* not yet open, resend the cookie and that is it */ return (1); } @@ -12386,9 +12386,9 @@ sctp_copy_it_in(struct sctp_tcb *stcb, *error = 0; /* Now can we send this? */ - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) { /* got data while shutting down */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ECONNRESET); @@ -12774,7 +12774,7 @@ sctp_lower_sosend(struct socket *so, */ queue_only = 1; asoc = &stcb->asoc; - SCTP_SET_STATE(asoc, SCTP_STATE_COOKIE_WAIT); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); /* initialize authentication params for the assoc */ @@ -12896,8 +12896,8 @@ sctp_lower_sosend(struct socket *so, SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, error); goto out_unlocked; } - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { queue_only = 1; } /* we are now done with all control */ @@ -12905,9 +12905,9 @@ sctp_lower_sosend(struct socket *so, sctp_m_freem(control); control = NULL; } - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) || + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) || (asoc->state & SCTP_STATE_SHUTDOWN_PENDING)) { if (srcv->sinfo_flags & SCTP_ABORT) { ; @@ -12927,8 +12927,8 @@ sctp_lower_sosend(struct socket *so, int tot_demand, tot_out = 0, max_out; SCTP_STAT_INCR(sctps_sends_with_abort); - if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { /* It has to be up before we abort */ /* how big is the user initiated abort? */ SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); @@ -13307,12 +13307,12 @@ skip_preblock: SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { /* a collision took us forward? */ queue_only = 0; } else { sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); - SCTP_SET_STATE(asoc, SCTP_STATE_COOKIE_WAIT); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); queue_only = 1; } } @@ -13495,17 +13495,17 @@ dataless_eof: goto abort_anyway; } /* there is nothing queued to send, so I'm done... */ - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { struct sctp_nets *netp; /* only send SHUTDOWN the first time through */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); if (stcb->asoc.alternate) { netp = stcb->asoc.alternate; @@ -13529,17 +13529,17 @@ dataless_eof: * data to be sent first and move to * SHUTDOWN-PENDING */ - if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) && - (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && + (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { if (hold_tcblock == 0) { SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); } - SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) { @@ -13580,12 +13580,12 @@ skip_out_eof: SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { /* a collision took us forward? */ queue_only = 0; } else { sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); - SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); + SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); queue_only = 1; } } Modified: stable/11/sys/netinet/sctp_pcb.c ============================================================================== --- stable/11/sys/netinet/sctp_pcb.c Sun May 5 20:05:50 2019 (r347164) +++ stable/11/sys/netinet/sctp_pcb.c Sun May 5 20:08:01 2019 (r347165) @@ -3371,14 +3371,14 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, * was not closed. So go ahead and * start it now. */ - SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); + SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); } SCTP_TCB_UNLOCK(asoc); continue; } - if (((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_COOKIE_WAIT) || - (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_COOKIE_ECHOED)) && + if (((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) && (asoc->asoc.total_output_queue_size == 0)) { /* * If we have data in queue, we don't want @@ -3395,7 +3395,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, } /* Disconnect the socket please */ asoc->sctp_socket = NULL; - SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_CLOSED_SOCKET); + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_CLOSED_SOCKET); if ((asoc->asoc.size_on_reasm_queue > 0) || (asoc->asoc.control_pdapi) || (asoc->asoc.size_on_all_streams > 0) || @@ -3407,8 +3407,8 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_3; sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); SCTP_STAT_INCR_COUNTER32(sctps_aborted); - if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } if (sctp_free_assoc(inp, asoc, @@ -3422,20 +3422,20 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, if ((*asoc->asoc.ss_functions.sctp_ss_is_user_msgs_incomplete) (asoc, &asoc->asoc)) { goto abort_anyway; } - if ((SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_SHUTDOWN_SENT) && - (SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { + if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && + (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { struct sctp_nets *netp; /* * there is nothing queued to send, * so I send shutdown */ - if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } - SCTP_SET_STATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_SENT); - SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); + SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(asoc); if (asoc->asoc.alternate) { netp = asoc->asoc.alternate; @@ -3451,11 +3451,11 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, } } else { /* mark into shutdown pending */ - SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_PENDING); + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, asoc->sctp_ep, asoc, asoc->asoc.primary_destination); if ((*asoc->asoc.ss_functions.sctp_ss_is_user_msgs_incomplete) (asoc, &asoc->asoc)) { - SCTP_ADD_SUBSTATE(&asoc->asoc, SCTP_STATE_PARTIAL_MSG_LEFT); + SCTP_ADD_SUBSTATE(asoc, SCTP_STATE_PARTIAL_MSG_LEFT); } if (TAILQ_EMPTY(&asoc->asoc.send_queue) && TAILQ_EMPTY(&asoc->asoc.sent_queue) && @@ -3467,8 +3467,8 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_5; sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); SCTP_STAT_INCR_COUNTER32(sctps_aborted); - if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } if (sctp_free_assoc(inp, asoc, @@ -3516,7 +3516,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, SCTP_TCB_LOCK(asoc); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { - SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); + SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, asoc, NULL); } cnt++; @@ -3524,7 +3524,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, continue; } /* Free associations that are NOT killing us */ - if ((SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_COOKIE_WAIT) && + if ((SCTP_GET_STATE(asoc) != SCTP_STATE_COOKIE_WAIT) && ((asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0)) { struct mbuf *op_err; @@ -3537,8 +3537,8 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, SCTP_TCB_UNLOCK(asoc); continue; } - if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || - (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } if (sctp_free_assoc(inp, asoc, SCTP_PCBFREE_FORCE, @@ -4801,7 +4801,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc } /* Now the read queue needs to be cleaned up (only once) */ if ((stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0) { - SCTP_ADD_SUBSTATE(&stcb->asoc, SCTP_STATE_ABOUT_TO_BE_FREED); + SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_ABOUT_TO_BE_FREED); SCTP_INP_READ_LOCK(inp); TAILQ_FOREACH(sq, &inp->read_queue, next) { if (sq->stcb == stcb) { @@ -4855,7 +4855,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc if ((stcb->asoc.refcnt) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { - SCTP_CLEAR_SUBSTATE(&stcb->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); } SCTP_TCB_UNLOCK(stcb); @@ -4937,7 +4937,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc atomic_add_int(&stcb->asoc.refcnt, -1); } if (stcb->asoc.refcnt) { - SCTP_CLEAR_SUBSTATE(&stcb->asoc, SCTP_STATE_IN_ACCEPT_QUEUE); + SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_IN_ACCEPT_QUEUE); sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); if (from_inpcbfree == SCTP_NORMAL_PROC) { SCTP_INP_INFO_WUNLOCK(); @@ -6275,7 +6275,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * assoc? straighten out locks. */ if (stcb_tmp) { - if (SCTP_GET_STATE(&stcb_tmp->asoc) == SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(stcb_tmp) == SCTP_STATE_COOKIE_WAIT) { struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; @@ -6375,7 +6375,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * assoc? straighten out locks. */ if (stcb_tmp) { - if (SCTP_GET_STATE(&stcb_tmp->asoc) == SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(stcb_tmp) == SCTP_STATE_COOKIE_WAIT) { struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; Modified: stable/11/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/11/sys/netinet/sctp_peeloff.c Sun May 5 20:05:50 2019 (r347164) +++ stable/11/sys/netinet/sctp_peeloff.c Sun May 5 20:08:01 2019 (r347165) @@ -72,7 +72,7 @@ sctp_can_peel_off(struct socket *head, sctp_assoc_t as SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOENT); return (ENOENT); } - state = SCTP_GET_STATE((&stcb->asoc)); + state = SCTP_GET_STATE(stcb); if ((state == SCTP_STATE_EMPTY) || (state == SCTP_STATE_INUSE)) { SCTP_TCB_UNLOCK(stcb); @@ -102,7 +102,7 @@ sctp_do_peeloff(struct socket *head, struct socket *so return (ENOTCONN); } - state = SCTP_GET_STATE((&stcb->asoc)); + state = SCTP_GET_STATE(stcb); if ((state == SCTP_STATE_EMPTY) || (state == SCTP_STATE_INUSE)) { SCTP_TCB_UNLOCK(stcb); Modified: stable/11/sys/netinet/sctp_timer.c ============================================================================== --- stable/11/sys/netinet/sctp_timer.c Sun May 5 20:05:50 2019 (r347164) +++ stable/11/sys/netinet/sctp_timer.c Sun May 5 20:08:01 2019 (r347165) @@ -960,7 +960,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * Special case for cookie-echo'ed case, we don't do output but must * await the COOKIE-ACK before retransmission */ - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED) { + if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) { /* * Here we just reset the timer and start again since we * have not established the asoc @@ -1002,7 +1002,7 @@ sctp_t1init_timer(struct sctp_inpcb *inp, sctp_send_initiate(inp, stcb, SCTP_SO_NOT_LOCKED); return (0); } - if (SCTP_GET_STATE((&stcb->asoc)) != SCTP_STATE_COOKIE_WAIT) { + if (SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_WAIT) { return (0); } if (sctp_threshold_management(inp, stcb, net, @@ -1050,7 +1050,7 @@ sctp_cookie_timer(struct sctp_inpcb *inp, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun May 5 20:14:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC90A15940D8; Sun, 5 May 2019 20:14:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 804076FC19; Sun, 5 May 2019 20:14:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55319246D3; Sun, 5 May 2019 20:14:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45KEbns075677; Sun, 5 May 2019 20:14:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45KEbSF075676; Sun, 5 May 2019 20:14:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905052014.x45KEbSF075676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 May 2019 20:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347166 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 804076FC19 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 20:14:38 -0000 Author: tuexen Date: Sun May 5 20:14:36 2019 New Revision: 347166 URL: https://svnweb.freebsd.org/changeset/base/347166 Log: MFC r337737: Remove a set but not used warning showing up in usrsctp. Modified: stable/11/sys/netinet/sctp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sun May 5 20:08:01 2019 (r347165) +++ stable/11/sys/netinet/sctp_input.c Sun May 5 20:14:36 2019 (r347166) @@ -3232,7 +3232,6 @@ static void sctp_handle_shutdown_complete(struct sctp_shutdown_complete_chunk *cp SCTP_UNUSED, struct sctp_tcb *stcb, struct sctp_nets *net) { - struct sctp_association *asoc; #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3242,7 +3241,6 @@ sctp_handle_shutdown_complete(struct sctp_shutdown_com if (stcb == NULL) return; - asoc = &stcb->asoc; /* process according to association state */ if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) { /* unexpected SHUTDOWN-COMPLETE... so ignore... */ @@ -3256,8 +3254,8 @@ sctp_handle_shutdown_complete(struct sctp_shutdown_com sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } #ifdef INVARIANTS - if (!TAILQ_EMPTY(&asoc->send_queue) || - !TAILQ_EMPTY(&asoc->sent_queue) || + if (!TAILQ_EMPTY(&stcb->asoc.send_queue) || + !TAILQ_EMPTY(&stcb->asoc.sent_queue) || sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED)) { panic("Queues are not empty when handling SHUTDOWN-COMPLETE"); } From owner-svn-src-all@freebsd.org Sun May 5 20:23:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 778451594411; Sun, 5 May 2019 20:23:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AEC470161; Sun, 5 May 2019 20:23:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E85432488B; Sun, 5 May 2019 20:23:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x45KNhcQ081078; Sun, 5 May 2019 20:23:43 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x45KNhTk081077; Sun, 5 May 2019 20:23:43 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905052023.x45KNhTk081077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 5 May 2019 20:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347167 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 347167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AEC470161 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 20:23:44 -0000 Author: jhibbits Date: Sun May 5 20:23:43 2019 New Revision: 347167 URL: https://svnweb.freebsd.org/changeset/base/347167 Log: powerpc/booke: Use #ifdef __powerpc64__ instead of hw_direct_map in places Since the DMAP is only available on powerpc64, and is *always* available on Book-E powerpc64, don't penalize either side (32-bit or 64-bit) by always checking hw_direct_map to perform operations. This saves 5-10% time on various ports builds, and on buildworld+buildkernel on Book-E hardware. MFC after: 3 weeks Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun May 5 20:14:36 2019 (r347166) +++ head/sys/powerpc/booke/pmap.c Sun May 5 20:23:43 2019 (r347167) @@ -2974,19 +2974,19 @@ mmu_booke_zero_page_area(mmu_t mmu, vm_page_t m, int o /* XXX KASSERT off and size are within a single page? */ - if (hw_direct_map) { - va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - bzero((caddr_t)va + off, size); - } else { - mtx_lock(&zero_page_mutex); - va = zero_page_va; +#ifdef __powerpc64__ + va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); + bzero((caddr_t)va + off, size); +#else + mtx_lock(&zero_page_mutex); + va = zero_page_va; - mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); - bzero((caddr_t)va + off, size); - mmu_booke_kremove(mmu, va); + mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); + bzero((caddr_t)va + off, size); + mmu_booke_kremove(mmu, va); - mtx_unlock(&zero_page_mutex); - } + mtx_unlock(&zero_page_mutex); +#endif } /* @@ -2997,23 +2997,24 @@ mmu_booke_zero_page(mmu_t mmu, vm_page_t m) { vm_offset_t off, va; - if (hw_direct_map) { - va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - } else { - va = zero_page_va; - mtx_lock(&zero_page_mutex); +#ifdef __powerpc64__ + va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); - } + for (off = 0; off < PAGE_SIZE; off += cacheline_size) + __asm __volatile("dcbz 0,%0" :: "r"(va + off)); +#else + va = zero_page_va; + mtx_lock(&zero_page_mutex); + mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); + for (off = 0; off < PAGE_SIZE; off += cacheline_size) __asm __volatile("dcbz 0,%0" :: "r"(va + off)); - if (!hw_direct_map) { - mmu_booke_kremove(mmu, va); + mmu_booke_kremove(mmu, va); - mtx_unlock(&zero_page_mutex); - } + mtx_unlock(&zero_page_mutex); +#endif } /* @@ -3026,23 +3027,23 @@ mmu_booke_copy_page(mmu_t mmu, vm_page_t sm, vm_page_t { vm_offset_t sva, dva; +#ifdef __powerpc64__ + sva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(sm)); + dva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dm)); + memcpy((caddr_t)dva, (caddr_t)sva, PAGE_SIZE); +#else + mtx_lock(©_page_mutex); + mmu_booke_kenter(mmu, sva, VM_PAGE_TO_PHYS(sm)); + mmu_booke_kenter(mmu, dva, VM_PAGE_TO_PHYS(dm)); sva = copy_page_src_va; dva = copy_page_dst_va; - if (hw_direct_map) { - sva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(sm)); - dva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dm)); - } else { - mtx_lock(©_page_mutex); - mmu_booke_kenter(mmu, sva, VM_PAGE_TO_PHYS(sm)); - mmu_booke_kenter(mmu, dva, VM_PAGE_TO_PHYS(dm)); - } memcpy((caddr_t)dva, (caddr_t)sva, PAGE_SIZE); - if (!hw_direct_map) { - mmu_booke_kremove(mmu, dva); - mmu_booke_kremove(mmu, sva); - mtx_unlock(©_page_mutex); - } + + mmu_booke_kremove(mmu, dva); + mmu_booke_kremove(mmu, sva); + mtx_unlock(©_page_mutex); +#endif } static inline void @@ -3053,39 +3054,55 @@ mmu_booke_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offs vm_offset_t a_pg_offset, b_pg_offset; int cnt; - if (hw_direct_map) { - a_cp = (caddr_t)((uintptr_t)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*ma)) + - a_offset); - b_cp = (caddr_t)((uintptr_t)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*mb)) + - b_offset); - bcopy(a_cp, b_cp, xfersize); - } else { - mtx_lock(©_page_mutex); - while (xfersize > 0) { - a_pg_offset = a_offset & PAGE_MASK; - cnt = min(xfersize, PAGE_SIZE - a_pg_offset); - mmu_booke_kenter(mmu, copy_page_src_va, - VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT])); - a_cp = (char *)copy_page_src_va + a_pg_offset; - b_pg_offset = b_offset & PAGE_MASK; - cnt = min(cnt, PAGE_SIZE - b_pg_offset); - mmu_booke_kenter(mmu, copy_page_dst_va, - VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT])); - b_cp = (char *)copy_page_dst_va + b_pg_offset; - bcopy(a_cp, b_cp, cnt); - mmu_booke_kremove(mmu, copy_page_dst_va); - mmu_booke_kremove(mmu, copy_page_src_va); - a_offset += cnt; - b_offset += cnt; - xfersize -= cnt; - } - mtx_unlock(©_page_mutex); +#ifdef __powerpc64__ + vm_page_t pa, pb; + + while (xfersize > 0) { + a_pg_offset = a_offset & PAGE_MASK; + pa = ma[a_offset >> PAGE_SHIFT]; + b_pg_offset = b_offset & PAGE_MASK; + pb = mb[b_offset >> PAGE_SHIFT]; + cnt = min(xfersize, PAGE_SIZE - a_pg_offset); + cnt = min(cnt, PAGE_SIZE - b_pg_offset); + a_cp = (caddr_t)((uintptr_t)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pa)) + + a_pg_offset); + b_cp = (caddr_t)((uintptr_t)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pb)) + + b_pg_offset); + bcopy(a_cp, b_cp, cnt); + a_offset += cnt; + b_offset += cnt; + xfersize -= cnt; } +#else + mtx_lock(©_page_mutex); + while (xfersize > 0) { + a_pg_offset = a_offset & PAGE_MASK; + cnt = min(xfersize, PAGE_SIZE - a_pg_offset); + mmu_booke_kenter(mmu, copy_page_src_va, + VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT])); + a_cp = (char *)copy_page_src_va + a_pg_offset; + b_pg_offset = b_offset & PAGE_MASK; + cnt = min(cnt, PAGE_SIZE - b_pg_offset); + mmu_booke_kenter(mmu, copy_page_dst_va, + VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT])); + b_cp = (char *)copy_page_dst_va + b_pg_offset; + bcopy(a_cp, b_cp, cnt); + mmu_booke_kremove(mmu, copy_page_dst_va); + mmu_booke_kremove(mmu, copy_page_src_va); + a_offset += cnt; + b_offset += cnt; + xfersize -= cnt; + } + mtx_unlock(©_page_mutex); +#endif } static vm_offset_t mmu_booke_quick_enter_page(mmu_t mmu, vm_page_t m) { +#ifdef __powerpc64__ + return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m))); +#else vm_paddr_t paddr; vm_offset_t qaddr; uint32_t flags; @@ -3093,9 +3110,6 @@ mmu_booke_quick_enter_page(mmu_t mmu, vm_page_t m) paddr = VM_PAGE_TO_PHYS(m); - if (hw_direct_map) - return (PHYS_TO_DMAP(paddr)); - flags = PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; flags |= tlb_calc_wimg(paddr, pmap_page_get_memattr(m)) << PTE_MAS2_SHIFT; flags |= PTE_PS_4KB; @@ -3122,16 +3136,15 @@ mmu_booke_quick_enter_page(mmu_t mmu, vm_page_t m) __syncicache((void *)qaddr, PAGE_SIZE); return (qaddr); +#endif } static void mmu_booke_quick_remove_page(mmu_t mmu, vm_offset_t addr) { +#ifndef __powerpc64__ pte_t *pte; - if (hw_direct_map) - return; - pte = pte_find(mmu, kernel_pmap, addr); KASSERT(PCPU_GET(qmap_addr) == addr, @@ -3141,6 +3154,7 @@ mmu_booke_quick_remove_page(mmu_t mmu, vm_offset_t add *pte = 0; critical_exit(); +#endif } /* From owner-svn-src-all@freebsd.org Mon May 6 00:57:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A980C15996A8; Mon, 6 May 2019 00:57:06 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4280B76FB4; Mon, 6 May 2019 00:57:06 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DFF82753F; Mon, 6 May 2019 00:57:06 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x460v51v022387; Mon, 6 May 2019 00:57:05 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x460v5Xa022386; Mon, 6 May 2019 00:57:05 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201905060057.x460v5Xa022386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Mon, 6 May 2019 00:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347168 - in head/sys: dev/nvdimm x86/iommu X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head/sys: dev/nvdimm x86/iommu X-SVN-Commit-Revision: 347168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4280B76FB4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 00:57:06 -0000 Author: tychon Date: Mon May 6 00:57:05 2019 New Revision: 347168 URL: https://svnweb.freebsd.org/changeset/base/347168 Log: zero inputs to vm_page_initfake() for predictable results Reviewed by: kib Submitted by: Anton Rang Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20162 Modified: head/sys/dev/nvdimm/nvdimm_spa.c head/sys/x86/iommu/busdma_dmar.c Modified: head/sys/dev/nvdimm/nvdimm_spa.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm_spa.c Sun May 5 20:23:43 2019 (r347167) +++ head/sys/dev/nvdimm/nvdimm_spa.c Mon May 6 00:57:05 2019 (r347168) @@ -177,6 +177,7 @@ nvdimm_spa_uio(struct nvdimm_spa_dev *dev, struct uio error = 0; if (dev->spa_kva == NULL) { mattr = nvdimm_spa_memattr(dev); + bzero(&m, sizeof(m)); vm_page_initfake(&m, 0, mattr); ma = &m; while (uio->uio_resid > 0) { @@ -276,7 +277,7 @@ nvdimm_spa_g_all_unmapped(struct nvdimm_spa_dev *dev, mattr = nvdimm_spa_memattr(dev); for (i = 0; i < nitems(ma); i++) { - maa[i].flags = 0; + bzero(&maa[i], sizeof(maa[i])); vm_page_initfake(&maa[i], dev->spa_phys_base + trunc_page(bp->bio_offset) + PAGE_SIZE * i, mattr); ma[i] = &maa[i]; Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Sun May 5 20:23:43 2019 (r347167) +++ head/sys/x86/iommu/busdma_dmar.c Mon May 6 00:57:05 2019 (r347168) @@ -689,7 +689,7 @@ dmar_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmam */ if (fma == NULL) { fma = malloc(sizeof(struct vm_page) * ma_cnt, - M_DEVBUF, mflags); + M_DEVBUF, M_ZERO | mflags); if (fma == NULL) { free(ma, M_DEVBUF); return (ENOMEM); @@ -743,7 +743,7 @@ dmar_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dm */ if (fma == NULL) { fma = malloc(sizeof(struct vm_page) * ma_cnt, - M_DEVBUF, mflags); + M_DEVBUF, M_ZERO | mflags); if (fma == NULL) { free(ma, M_DEVBUF); return (ENOMEM); From owner-svn-src-all@freebsd.org Mon May 6 02:08:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 410E8159AB8A; Mon, 6 May 2019 02:08:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A727580C8C; Mon, 6 May 2019 02:08:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DBFA116; Mon, 6 May 2019 02:08:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4628qrZ059237; Mon, 6 May 2019 02:08:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4628qdI059236; Mon, 6 May 2019 02:08:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905060208.x4628qdI059236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 6 May 2019 02:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347169 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 347169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A727580C8C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 02:08:53 -0000 Author: kevans Date: Mon May 6 02:08:52 2019 New Revision: 347169 URL: https://svnweb.freebsd.org/changeset/base/347169 Log: MFC r347021: fdt: Fix installation of aarch64 dtb r345519 rewrote parts of how we build .dtb, but mistakenly dropped the vendor dir for aarch64. Simply drop the :T for building ${DTB} in the aarch64 case- it'll get applied at install-time as-needed, with :H:T for determining the vendor dir. Modified: stable/12/sys/conf/dtb.build.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/dtb.build.mk ============================================================================== --- stable/12/sys/conf/dtb.build.mk Mon May 6 00:57:05 2019 (r347168) +++ stable/12/sys/conf/dtb.build.mk Mon May 6 02:08:52 2019 (r347169) @@ -24,7 +24,16 @@ SYSDIR= ${_dir:tA} .error "can't find kernel source tree" .endif -DTB=${DTS:T:R:S/$/.dtb/} +.for _dts in ${DTS} +# DTB for aarch64 needs to preserve the immediate parent of the .dts, because +# these DTS are vendored and should be installed into their vendored directory. +.if ${MACHINE_ARCH} == "aarch64" +DTB+= ${_dts:R:S/$/.dtb/} +.else +DTB+= ${_dts:T:R:S/$/.dtb/} +.endif +.endfor + DTBO=${DTSO:T:R:S/$/.dtbo/} .SUFFIXES: .dtb .dts .dtbo .dtso From owner-svn-src-all@freebsd.org Mon May 6 02:10:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06228159AC42; Mon, 6 May 2019 02:10:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A09F980DD3; Mon, 6 May 2019 02:10:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CEB311B; Mon, 6 May 2019 02:10:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x462A5te059388; Mon, 6 May 2019 02:10:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x462A5K5059386; Mon, 6 May 2019 02:10:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905060210.x462A5K5059386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 6 May 2019 02:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347170 - in stable: 11/lib/libbe 12/lib/libbe X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libbe 12/lib/libbe X-SVN-Commit-Revision: 347170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A09F980DD3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 02:10:06 -0000 Author: kevans Date: Mon May 6 02:10:04 2019 New Revision: 347170 URL: https://svnweb.freebsd.org/changeset/base/347170 Log: MFC r347027-r347028: libbe(3) mountpoint handling fixes r347027: libbe(3): Properly mount BEs with mountpoint=none Instead of pretending to successfully mount them while not actually mounting anything, we'll now actually mount them *and* claim we mounted them successfully. Reported by: ler r347028: libbe: set mountpoint=none in be_import If we're going to set a mountpoint at all, mountpoint=none makes more sense than mountpoint=/. Modified: stable/11/lib/libbe/be.c stable/11/lib/libbe/be_access.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libbe/be.c stable/12/lib/libbe/be_access.c Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libbe/be.c ============================================================================== --- stable/11/lib/libbe/be.c Mon May 6 02:08:52 2019 (r347169) +++ stable/11/lib/libbe/be.c Mon May 6 02:10:04 2019 (r347170) @@ -822,7 +822,7 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); - nvlist_add_string(props, "mountpoint", "/"); + nvlist_add_string(props, "mountpoint", "none"); err = zfs_prop_set_list(zfs, props); nvlist_free(props); Modified: stable/11/lib/libbe/be_access.c ============================================================================== --- stable/11/lib/libbe/be_access.c Mon May 6 02:08:52 2019 (r347169) +++ stable/11/lib/libbe/be_access.c Mon May 6 02:10:04 2019 (r347170) @@ -45,6 +45,7 @@ struct be_mount_info { const char *mountpoint; int mntflags; int deepmount; + int depth; }; static int @@ -79,6 +80,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) char *mountpoint; char tmp[BE_MAXPATHLEN], zfs_mnt[BE_MAXPATHLEN]; struct be_mount_info *info; + char opt; info = (struct be_mount_info *)data; @@ -94,37 +96,50 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) NULL, NULL, 0, 1)) return (1); - if (strcmp("none", zfs_mnt) != 0) { - char opt = '\0'; + if (strcmp("none", zfs_mnt) == 0) { + /* + * mountpoint=none; we'll mount it at info->mountpoint assuming + * we're at the root. If we're not at the root... that's less + * than stellar and not entirely sure what to do with that. + * For now, we won't treat it as an error condition -- we just + * won't mount it, and we'll continue on. + */ + if (info->depth > 0) + return (0); + snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); + } else { mountpoint = be_mountpoint_augmented(info->lbh, zfs_mnt); - snprintf(tmp, BE_MAXPATHLEN, "%s%s", info->mountpoint, mountpoint); + } - if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, - __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { - switch (errno) { - case ENAMETOOLONG: - return (set_error(info->lbh, BE_ERR_PATHLEN)); - case ELOOP: - case ENOENT: - case ENOTDIR: - return (set_error(info->lbh, BE_ERR_BADPATH)); - case EPERM: - return (set_error(info->lbh, BE_ERR_PERMS)); - case EBUSY: - return (set_error(info->lbh, BE_ERR_PATHBUSY)); - default: - return (set_error(info->lbh, BE_ERR_UNKNOWN)); - } + opt = '\0'; + if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, + __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { + switch (errno) { + case ENAMETOOLONG: + return (set_error(info->lbh, BE_ERR_PATHLEN)); + case ELOOP: + case ENOENT: + case ENOTDIR: + return (set_error(info->lbh, BE_ERR_BADPATH)); + case EPERM: + return (set_error(info->lbh, BE_ERR_PERMS)); + case EBUSY: + return (set_error(info->lbh, BE_ERR_PATHBUSY)); + default: + return (set_error(info->lbh, BE_ERR_UNKNOWN)); } } if (!info->deepmount) return (0); - return (zfs_iter_filesystems(zfs_hdl, be_mount_iter, info)); + ++info->depth; + err = zfs_iter_filesystems(zfs_hdl, be_mount_iter, info); + --info->depth; + return (err); } @@ -138,9 +153,11 @@ be_umount_iter(zfs_handle_t *zfs_hdl, void *data) info = (struct be_mount_info *)data; + ++info->depth; if((err = zfs_iter_filesystems(zfs_hdl, be_umount_iter, info)) != 0) { return (err); } + --info->depth; if (!zfs_is_mounted(zfs_hdl, &mountpoint)) { return (0); @@ -248,6 +265,7 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou info.mountpoint = (mountpoint == NULL) ? mnt_temp : mountpoint; info.mntflags = mntflags; info.deepmount = mntdeep; + info.depth = 0; if((err = be_mount_iter(zhdl, &info) != 0)) { zfs_close(zhdl); @@ -283,6 +301,7 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla info.be = be; info.mountpoint = NULL; info.mntflags = (flags & BE_MNT_FORCE) ? MS_FORCE : 0; + info.depth = 0; if ((err = be_umount_iter(root_hdl, &info)) != 0) { zfs_close(root_hdl); From owner-svn-src-all@freebsd.org Mon May 6 02:10:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87974159AC48; Mon, 6 May 2019 02:10:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D0A680DD6; Mon, 6 May 2019 02:10:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A46311C; Mon, 6 May 2019 02:10:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x462A56I059396; Mon, 6 May 2019 02:10:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x462A5Nf059394; Mon, 6 May 2019 02:10:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905060210.x462A5Nf059394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 6 May 2019 02:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347170 - in stable: 11/lib/libbe 12/lib/libbe X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libbe 12/lib/libbe X-SVN-Commit-Revision: 347170 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D0A680DD6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 02:10:06 -0000 Author: kevans Date: Mon May 6 02:10:04 2019 New Revision: 347170 URL: https://svnweb.freebsd.org/changeset/base/347170 Log: MFC r347027-r347028: libbe(3) mountpoint handling fixes r347027: libbe(3): Properly mount BEs with mountpoint=none Instead of pretending to successfully mount them while not actually mounting anything, we'll now actually mount them *and* claim we mounted them successfully. Reported by: ler r347028: libbe: set mountpoint=none in be_import If we're going to set a mountpoint at all, mountpoint=none makes more sense than mountpoint=/. Modified: stable/12/lib/libbe/be.c stable/12/lib/libbe/be_access.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libbe/be.c stable/11/lib/libbe/be_access.c Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libbe/be.c ============================================================================== --- stable/12/lib/libbe/be.c Mon May 6 02:08:52 2019 (r347169) +++ stable/12/lib/libbe/be.c Mon May 6 02:10:04 2019 (r347170) @@ -822,7 +822,7 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); - nvlist_add_string(props, "mountpoint", "/"); + nvlist_add_string(props, "mountpoint", "none"); err = zfs_prop_set_list(zfs, props); nvlist_free(props); Modified: stable/12/lib/libbe/be_access.c ============================================================================== --- stable/12/lib/libbe/be_access.c Mon May 6 02:08:52 2019 (r347169) +++ stable/12/lib/libbe/be_access.c Mon May 6 02:10:04 2019 (r347170) @@ -45,6 +45,7 @@ struct be_mount_info { const char *mountpoint; int mntflags; int deepmount; + int depth; }; static int @@ -79,6 +80,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) char *mountpoint; char tmp[BE_MAXPATHLEN], zfs_mnt[BE_MAXPATHLEN]; struct be_mount_info *info; + char opt; info = (struct be_mount_info *)data; @@ -94,37 +96,50 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) NULL, NULL, 0, 1)) return (1); - if (strcmp("none", zfs_mnt) != 0) { - char opt = '\0'; + if (strcmp("none", zfs_mnt) == 0) { + /* + * mountpoint=none; we'll mount it at info->mountpoint assuming + * we're at the root. If we're not at the root... that's less + * than stellar and not entirely sure what to do with that. + * For now, we won't treat it as an error condition -- we just + * won't mount it, and we'll continue on. + */ + if (info->depth > 0) + return (0); + snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); + } else { mountpoint = be_mountpoint_augmented(info->lbh, zfs_mnt); - snprintf(tmp, BE_MAXPATHLEN, "%s%s", info->mountpoint, mountpoint); + } - if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, - __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { - switch (errno) { - case ENAMETOOLONG: - return (set_error(info->lbh, BE_ERR_PATHLEN)); - case ELOOP: - case ENOENT: - case ENOTDIR: - return (set_error(info->lbh, BE_ERR_BADPATH)); - case EPERM: - return (set_error(info->lbh, BE_ERR_PERMS)); - case EBUSY: - return (set_error(info->lbh, BE_ERR_PATHBUSY)); - default: - return (set_error(info->lbh, BE_ERR_UNKNOWN)); - } + opt = '\0'; + if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, + __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { + switch (errno) { + case ENAMETOOLONG: + return (set_error(info->lbh, BE_ERR_PATHLEN)); + case ELOOP: + case ENOENT: + case ENOTDIR: + return (set_error(info->lbh, BE_ERR_BADPATH)); + case EPERM: + return (set_error(info->lbh, BE_ERR_PERMS)); + case EBUSY: + return (set_error(info->lbh, BE_ERR_PATHBUSY)); + default: + return (set_error(info->lbh, BE_ERR_UNKNOWN)); } } if (!info->deepmount) return (0); - return (zfs_iter_filesystems(zfs_hdl, be_mount_iter, info)); + ++info->depth; + err = zfs_iter_filesystems(zfs_hdl, be_mount_iter, info); + --info->depth; + return (err); } @@ -138,9 +153,11 @@ be_umount_iter(zfs_handle_t *zfs_hdl, void *data) info = (struct be_mount_info *)data; + ++info->depth; if((err = zfs_iter_filesystems(zfs_hdl, be_umount_iter, info)) != 0) { return (err); } + --info->depth; if (!zfs_is_mounted(zfs_hdl, &mountpoint)) { return (0); @@ -248,6 +265,7 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou info.mountpoint = (mountpoint == NULL) ? mnt_temp : mountpoint; info.mntflags = mntflags; info.deepmount = mntdeep; + info.depth = 0; if((err = be_mount_iter(zhdl, &info) != 0)) { zfs_close(zhdl); @@ -283,6 +301,7 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla info.be = be; info.mountpoint = NULL; info.mntflags = (flags & BE_MNT_FORCE) ? MS_FORCE : 0; + info.depth = 0; if ((err = be_umount_iter(root_hdl, &info)) != 0) { zfs_close(root_hdl); From owner-svn-src-all@freebsd.org Mon May 6 03:06:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4E54159BD2C; Mon, 6 May 2019 03:06:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 761B382BAA; Mon, 6 May 2019 03:06:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BFD2BB4; Mon, 6 May 2019 03:06:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4636NAw091814; Mon, 6 May 2019 03:06:23 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4636NqM091813; Mon, 6 May 2019 03:06:23 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905060306.x4636NqM091813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 6 May 2019 03:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347171 - stable/12/usr.sbin/nfsdumpstate X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/usr.sbin/nfsdumpstate X-SVN-Commit-Revision: 347171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 761B382BAA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 03:06:24 -0000 Author: rmacklem Date: Mon May 6 03:06:22 2019 New Revision: 347171 URL: https://svnweb.freebsd.org/changeset/base/347171 Log: MFC: r346856 Add #ifdef INET6 around declaration of nbuf. It was reported that without #ifdef INET6 around the declaration of "nbuf", a build would report an unused variable. For some reason, I didn't see that warning when I did a build, but it seems reasonable to add these #ifdef INET6's. Modified: stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c ============================================================================== --- stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c Mon May 6 02:10:04 2019 (r347170) +++ stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c Mon May 6 03:06:22 2019 (r347171) @@ -121,7 +121,9 @@ dump_openstate(void) { struct nfsd_dumplist dumplist; int cnt, i; +#ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; +#endif dumplist.ndl_size = DUMPSIZE; dumplist.ndl_list = (void *)dp; @@ -176,7 +178,9 @@ dump_lockstate(char *fname) { struct nfsd_dumplocklist dumplocklist; int cnt, i; +#ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; +#endif dumplocklist.ndllck_size = DUMPSIZE; dumplocklist.ndllck_list = (void *)lp; From owner-svn-src-all@freebsd.org Mon May 6 03:13:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 576C9159BF2D; Mon, 6 May 2019 03:13:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F147C82FDC; Mon, 6 May 2019 03:13:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF63AD58; Mon, 6 May 2019 03:13:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x463DMGE097123; Mon, 6 May 2019 03:13:22 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x463DM9e097122; Mon, 6 May 2019 03:13:22 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905060313.x463DM9e097122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 6 May 2019 03:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347172 - stable/11/usr.sbin/nfsdumpstate X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/usr.sbin/nfsdumpstate X-SVN-Commit-Revision: 347172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F147C82FDC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 03:13:23 -0000 Author: rmacklem Date: Mon May 6 03:13:22 2019 New Revision: 347172 URL: https://svnweb.freebsd.org/changeset/base/347172 Log: MFC: r346856 Add #ifdef INET6 around declaration of nbuf. It was reported that without #ifdef INET6 around the declaration of "nbuf", a build would report an unused variable. For some reason, I didn't see that warning when I did a build, but it seems reasonable to add these #ifdef INET6's. Modified: stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c ============================================================================== --- stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Mon May 6 03:06:22 2019 (r347171) +++ stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Mon May 6 03:13:22 2019 (r347172) @@ -121,7 +121,9 @@ dump_openstate(void) { struct nfsd_dumplist dumplist; int cnt, i; +#ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; +#endif dumplist.ndl_size = DUMPSIZE; dumplist.ndl_list = (void *)dp; @@ -176,7 +178,9 @@ dump_lockstate(char *fname) { struct nfsd_dumplocklist dumplocklist; int cnt, i; +#ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; +#endif dumplocklist.ndllck_size = DUMPSIZE; dumplocklist.ndllck_list = (void *)lp; From owner-svn-src-all@freebsd.org Mon May 6 03:15:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F3C159C02A; Mon, 6 May 2019 03:15:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DD23832D6; Mon, 6 May 2019 03:15:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BEDAD5D; Mon, 6 May 2019 03:15:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x463F8BU097496; Mon, 6 May 2019 03:15:08 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x463F7HB097494; Mon, 6 May 2019 03:15:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905060315.x463F7HB097494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 6 May 2019 03:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347173 - in stable/12/sys/powerpc: booke include X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in stable/12/sys/powerpc: booke include X-SVN-Commit-Revision: 347173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6DD23832D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 03:15:09 -0000 Author: jhibbits Date: Mon May 6 03:15:07 2019 New Revision: 347173 URL: https://svnweb.freebsd.org/changeset/base/347173 Log: MFC r339559,344083,344202,344203,344204 Bulk merge of Book-E pmap changes r339559: powerpc/booke: Turn tlb*_print_tlbentries() into 'show tlb*' DDB commands r344083: powerpc/booke: Use the 'tlbilx' instruction on newer cores r344202,344204: powerpc/booke: Use DMAP where possible for page copy and zeroing r344203: powerpc/booke: depessimize MAS register updates Modified: stable/12/sys/powerpc/booke/pmap.c stable/12/sys/powerpc/include/tlb.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/booke/pmap.c ============================================================================== --- stable/12/sys/powerpc/booke/pmap.c Mon May 6 03:13:22 2019 (r347172) +++ stable/12/sys/powerpc/booke/pmap.c Mon May 6 03:15:07 2019 (r347173) @@ -77,6 +77,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" #include "opt_kstack_pages.h" #include @@ -123,6 +124,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "mmu_if.h" #define SPARSE_MAPDEV @@ -221,11 +224,13 @@ static vm_offset_t tlb1_map_base = VM_MAXUSER_ADDRESS static tlbtid_t tid_alloc(struct pmap *); static void tid_flush(tlbtid_t tid); +#ifdef DDB #ifdef __powerpc64__ static void tlb_print_entry(int, uint32_t, uint64_t, uint32_t, uint32_t); #else static void tlb_print_entry(int, uint32_t, uint32_t, uint32_t, uint32_t); #endif +#endif static void tlb1_read_entry(tlb_entry_t *, unsigned int); static void tlb1_write_entry(tlb_entry_t *, unsigned int); @@ -2968,14 +2973,19 @@ mmu_booke_zero_page_area(mmu_t mmu, vm_page_t m, int o /* XXX KASSERT off and size are within a single page? */ - mtx_lock(&zero_page_mutex); - va = zero_page_va; + if (hw_direct_map) { + va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); + bzero((caddr_t)va + off, size); + } else { + mtx_lock(&zero_page_mutex); + va = zero_page_va; - mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); - bzero((caddr_t)va + off, size); - mmu_booke_kremove(mmu, va); + mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); + bzero((caddr_t)va + off, size); + mmu_booke_kremove(mmu, va); - mtx_unlock(&zero_page_mutex); + mtx_unlock(&zero_page_mutex); + } } /* @@ -2986,15 +2996,23 @@ mmu_booke_zero_page(mmu_t mmu, vm_page_t m) { vm_offset_t off, va; - mtx_lock(&zero_page_mutex); - va = zero_page_va; + if (hw_direct_map) { + va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); + } else { + va = zero_page_va; + mtx_lock(&zero_page_mutex); - mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); + mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); + } + for (off = 0; off < PAGE_SIZE; off += cacheline_size) __asm __volatile("dcbz 0,%0" :: "r"(va + off)); - mmu_booke_kremove(mmu, va); - mtx_unlock(&zero_page_mutex); + if (!hw_direct_map) { + mmu_booke_kremove(mmu, va); + + mtx_unlock(&zero_page_mutex); + } } /* @@ -3010,13 +3028,20 @@ mmu_booke_copy_page(mmu_t mmu, vm_page_t sm, vm_page_t sva = copy_page_src_va; dva = copy_page_dst_va; - mtx_lock(©_page_mutex); - mmu_booke_kenter(mmu, sva, VM_PAGE_TO_PHYS(sm)); - mmu_booke_kenter(mmu, dva, VM_PAGE_TO_PHYS(dm)); + if (hw_direct_map) { + sva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(sm)); + dva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dm)); + } else { + mtx_lock(©_page_mutex); + mmu_booke_kenter(mmu, sva, VM_PAGE_TO_PHYS(sm)); + mmu_booke_kenter(mmu, dva, VM_PAGE_TO_PHYS(dm)); + } memcpy((caddr_t)dva, (caddr_t)sva, PAGE_SIZE); - mmu_booke_kremove(mmu, dva); - mmu_booke_kremove(mmu, sva); - mtx_unlock(©_page_mutex); + if (!hw_direct_map) { + mmu_booke_kremove(mmu, dva); + mmu_booke_kremove(mmu, sva); + mtx_unlock(©_page_mutex); + } } static inline void @@ -3027,26 +3052,34 @@ mmu_booke_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offs vm_offset_t a_pg_offset, b_pg_offset; int cnt; - mtx_lock(©_page_mutex); - while (xfersize > 0) { - a_pg_offset = a_offset & PAGE_MASK; - cnt = min(xfersize, PAGE_SIZE - a_pg_offset); - mmu_booke_kenter(mmu, copy_page_src_va, - VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT])); - a_cp = (char *)copy_page_src_va + a_pg_offset; - b_pg_offset = b_offset & PAGE_MASK; - cnt = min(cnt, PAGE_SIZE - b_pg_offset); - mmu_booke_kenter(mmu, copy_page_dst_va, - VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT])); - b_cp = (char *)copy_page_dst_va + b_pg_offset; - bcopy(a_cp, b_cp, cnt); - mmu_booke_kremove(mmu, copy_page_dst_va); - mmu_booke_kremove(mmu, copy_page_src_va); - a_offset += cnt; - b_offset += cnt; - xfersize -= cnt; + if (hw_direct_map) { + a_cp = (caddr_t)((uintptr_t)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*ma)) + + a_offset); + b_cp = (caddr_t)((uintptr_t)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*mb)) + + b_offset); + bcopy(a_cp, b_cp, xfersize); + } else { + mtx_lock(©_page_mutex); + while (xfersize > 0) { + a_pg_offset = a_offset & PAGE_MASK; + cnt = min(xfersize, PAGE_SIZE - a_pg_offset); + mmu_booke_kenter(mmu, copy_page_src_va, + VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT])); + a_cp = (char *)copy_page_src_va + a_pg_offset; + b_pg_offset = b_offset & PAGE_MASK; + cnt = min(cnt, PAGE_SIZE - b_pg_offset); + mmu_booke_kenter(mmu, copy_page_dst_va, + VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT])); + b_cp = (char *)copy_page_dst_va + b_pg_offset; + bcopy(a_cp, b_cp, cnt); + mmu_booke_kremove(mmu, copy_page_dst_va); + mmu_booke_kremove(mmu, copy_page_src_va); + a_offset += cnt; + b_offset += cnt; + xfersize -= cnt; + } + mtx_unlock(©_page_mutex); } - mtx_unlock(©_page_mutex); } static vm_offset_t @@ -3059,6 +3092,9 @@ mmu_booke_quick_enter_page(mmu_t mmu, vm_page_t m) paddr = VM_PAGE_TO_PHYS(m); + if (hw_direct_map) + return (PHYS_TO_DMAP(paddr)); + flags = PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; flags |= tlb_calc_wimg(paddr, pmap_page_get_memattr(m)) << PTE_MAS2_SHIFT; flags |= PTE_PS_4KB; @@ -3092,6 +3128,9 @@ mmu_booke_quick_remove_page(mmu_t mmu, vm_offset_t add { pte_t *pte; + if (hw_direct_map) + return; + pte = pte_find(mmu, kernel_pmap, addr); KASSERT(PCPU_GET(qmap_addr) == addr, @@ -3776,45 +3815,6 @@ tid_alloc(pmap_t pmap) /* TLB0 handling */ /**************************************************************************/ -static void -#ifdef __powerpc64__ -tlb_print_entry(int i, uint32_t mas1, uint64_t mas2, uint32_t mas3, -#else -tlb_print_entry(int i, uint32_t mas1, uint32_t mas2, uint32_t mas3, -#endif - uint32_t mas7) -{ - int as; - char desc[3]; - tlbtid_t tid; - vm_size_t size; - unsigned int tsize; - - desc[2] = '\0'; - if (mas1 & MAS1_VALID) - desc[0] = 'V'; - else - desc[0] = ' '; - - if (mas1 & MAS1_IPROT) - desc[1] = 'P'; - else - desc[1] = ' '; - - as = (mas1 & MAS1_TS_MASK) ? 1 : 0; - tid = MAS1_GETTID(mas1); - - tsize = (mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; - size = 0; - if (tsize) - size = tsize2size(tsize); - - debugf("%3d: (%s) [AS=%d] " - "sz = 0x%08x tsz = %d tid = %d mas1 = 0x%08x " - "mas2(va) = 0x%"PRI0ptrX" mas3(pa) = 0x%08x mas7 = 0x%08x\n", - i, desc, as, size, tsize, tid, mas1, mas2, mas3, mas7); -} - /* Convert TLB0 va and way number to tlb0[] table index. */ static inline unsigned int tlb0_tableidx(vm_offset_t va, unsigned int way) @@ -3844,41 +3844,7 @@ tlb0_flush_entry(vm_offset_t va) CTR1(KTR_PMAP, "%s: e", __func__); } -/* Print out contents of the MAS registers for each TLB0 entry */ -void -tlb0_print_tlbentries(void) -{ - uint32_t mas0, mas1, mas3, mas7; -#ifdef __powerpc64__ - uint64_t mas2; -#else - uint32_t mas2; -#endif - int entryidx, way, idx; - debugf("TLB0 entries:\n"); - for (way = 0; way < TLB0_WAYS; way ++) - for (entryidx = 0; entryidx < TLB0_ENTRIES_PER_WAY; entryidx++) { - - mas0 = MAS0_TLBSEL(0) | MAS0_ESEL(way); - mtspr(SPR_MAS0, mas0); - __asm __volatile("isync"); - - mas2 = entryidx << MAS2_TLB0_ENTRY_IDX_SHIFT; - mtspr(SPR_MAS2, mas2); - - __asm __volatile("isync; tlbre"); - - mas1 = mfspr(SPR_MAS1); - mas2 = mfspr(SPR_MAS2); - mas3 = mfspr(SPR_MAS3); - mas7 = mfspr(SPR_MAS7); - - idx = tlb0_tableidx(mas2, way); - tlb_print_entry(idx, mas1, mas2, mas3, mas7); - } -} - /**************************************************************************/ /* TLB1 handling */ /**************************************************************************/ @@ -3948,29 +3914,23 @@ tlb1_write_entry_int(void *arg) mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(args->idx); mtspr(SPR_MAS0, mas0); - __asm __volatile("isync"); mtspr(SPR_MAS1, args->e->mas1); - __asm __volatile("isync"); mtspr(SPR_MAS2, args->e->mas2); - __asm __volatile("isync"); mtspr(SPR_MAS3, args->e->mas3); - __asm __volatile("isync"); switch ((mfpvr() >> 16) & 0xFFFF) { case FSL_E500mc: case FSL_E5500: case FSL_E6500: mtspr(SPR_MAS8, 0); - __asm __volatile("isync"); /* FALLTHROUGH */ case FSL_E500v2: mtspr(SPR_MAS7, args->e->mas7); - __asm __volatile("isync"); break; default: break; } - __asm __volatile("tlbwe; isync; msync"); + __asm __volatile("isync; tlbwe; isync; msync"); } @@ -4322,37 +4282,7 @@ set_mas4_defaults(void) __asm __volatile("isync"); } -/* - * Print out contents of the MAS registers for each TLB1 entry - */ -void -tlb1_print_tlbentries(void) -{ - uint32_t mas0, mas1, mas3, mas7; -#ifdef __powerpc64__ - uint64_t mas2; -#else - uint32_t mas2; -#endif - int i; - debugf("TLB1 entries:\n"); - for (i = 0; i < TLB1_ENTRIES; i++) { - - mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(i); - mtspr(SPR_MAS0, mas0); - - __asm __volatile("isync; tlbre"); - - mas1 = mfspr(SPR_MAS1); - mas2 = mfspr(SPR_MAS2); - mas3 = mfspr(SPR_MAS3); - mas7 = mfspr(SPR_MAS7); - - tlb_print_entry(i, mas1, mas2, mas3, mas7); - } -} - /* * Return 0 if the physical IO range is encompassed by one of the * the TLB1 entries, otherwise return related error code. @@ -4423,12 +4353,26 @@ tid_flush(tlbtid_t tid) msr = mfmsr(); __asm __volatile("wrteei 0"); + /* + * Newer (e500mc and later) have tlbilx, which doesn't broadcast, so use + * it for PID invalidation. + */ + switch ((mfpvr() >> 16) & 0xffff) { + case FSL_E500mc: + case FSL_E5500: + case FSL_E6500: + mtspr(SPR_MAS6, tid << MAS6_SPID0_SHIFT); + /* tlbilxpid */ + __asm __volatile("isync; .long 0x7c000024; isync; msync"); + mtmsr(msr); + return; + } + for (way = 0; way < TLB0_WAYS; way++) for (entry = 0; entry < TLB0_ENTRIES_PER_WAY; entry++) { mas0 = MAS0_TLBSEL(0) | MAS0_ESEL(way); mtspr(SPR_MAS0, mas0); - __asm __volatile("isync"); mas2 = entry << MAS2_TLB0_ENTRY_IDX_SHIFT; mtspr(SPR_MAS2, mas2); @@ -4447,3 +4391,107 @@ tid_flush(tlbtid_t tid) } mtmsr(msr); } + +#ifdef DDB +/* Print out contents of the MAS registers for each TLB0 entry */ +static void +#ifdef __powerpc64__ +tlb_print_entry(int i, uint32_t mas1, uint64_t mas2, uint32_t mas3, +#else +tlb_print_entry(int i, uint32_t mas1, uint32_t mas2, uint32_t mas3, +#endif + uint32_t mas7) +{ + int as; + char desc[3]; + tlbtid_t tid; + vm_size_t size; + unsigned int tsize; + + desc[2] = '\0'; + if (mas1 & MAS1_VALID) + desc[0] = 'V'; + else + desc[0] = ' '; + + if (mas1 & MAS1_IPROT) + desc[1] = 'P'; + else + desc[1] = ' '; + + as = (mas1 & MAS1_TS_MASK) ? 1 : 0; + tid = MAS1_GETTID(mas1); + + tsize = (mas1 & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT; + size = 0; + if (tsize) + size = tsize2size(tsize); + + printf("%3d: (%s) [AS=%d] " + "sz = 0x%08x tsz = %d tid = %d mas1 = 0x%08x " + "mas2(va) = 0x%"PRI0ptrX" mas3(pa) = 0x%08x mas7 = 0x%08x\n", + i, desc, as, size, tsize, tid, mas1, mas2, mas3, mas7); +} + +DB_SHOW_COMMAND(tlb0, tlb0_print_tlbentries) +{ + uint32_t mas0, mas1, mas3, mas7; +#ifdef __powerpc64__ + uint64_t mas2; +#else + uint32_t mas2; +#endif + int entryidx, way, idx; + + printf("TLB0 entries:\n"); + for (way = 0; way < TLB0_WAYS; way ++) + for (entryidx = 0; entryidx < TLB0_ENTRIES_PER_WAY; entryidx++) { + + mas0 = MAS0_TLBSEL(0) | MAS0_ESEL(way); + mtspr(SPR_MAS0, mas0); + + mas2 = entryidx << MAS2_TLB0_ENTRY_IDX_SHIFT; + mtspr(SPR_MAS2, mas2); + + __asm __volatile("isync; tlbre"); + + mas1 = mfspr(SPR_MAS1); + mas2 = mfspr(SPR_MAS2); + mas3 = mfspr(SPR_MAS3); + mas7 = mfspr(SPR_MAS7); + + idx = tlb0_tableidx(mas2, way); + tlb_print_entry(idx, mas1, mas2, mas3, mas7); + } +} + +/* + * Print out contents of the MAS registers for each TLB1 entry + */ +DB_SHOW_COMMAND(tlb1, tlb1_print_tlbentries) +{ + uint32_t mas0, mas1, mas3, mas7; +#ifdef __powerpc64__ + uint64_t mas2; +#else + uint32_t mas2; +#endif + int i; + + printf("TLB1 entries:\n"); + for (i = 0; i < TLB1_ENTRIES; i++) { + + mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(i); + mtspr(SPR_MAS0, mas0); + + __asm __volatile("isync; tlbre"); + + mas1 = mfspr(SPR_MAS1); + mas2 = mfspr(SPR_MAS2); + mas3 = mfspr(SPR_MAS3); + mas7 = mfspr(SPR_MAS7); + + tlb_print_entry(i, mas1, mas2, mas3, mas7); + } +} +#endif Modified: stable/12/sys/powerpc/include/tlb.h ============================================================================== --- stable/12/sys/powerpc/include/tlb.h Mon May 6 03:13:22 2019 (r347172) +++ stable/12/sys/powerpc/include/tlb.h Mon May 6 03:15:07 2019 (r347173) @@ -152,12 +152,8 @@ typedef struct tlb_entry { uint32_t mas7; } tlb_entry_t; -void tlb0_print_tlbentries(void); - void tlb1_inval_entry(unsigned int); void tlb1_init(void); -void tlb1_print_entries(void); -void tlb1_print_tlbentries(void); #endif /* !LOCORE */ #elif defined(BOOKE_PPC4XX) From owner-svn-src-all@freebsd.org Mon May 6 03:20:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 915E7159C0DD; Mon, 6 May 2019 03:20:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FB448345C; Mon, 6 May 2019 03:20:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A026D66; Mon, 6 May 2019 03:20:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x463K2C0097800; Mon, 6 May 2019 03:20:02 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x463K2sM097799; Mon, 6 May 2019 03:20:02 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905060320.x463K2sM097799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 6 May 2019 03:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r347174 - stable/10/usr.sbin/nfsdumpstate X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/usr.sbin/nfsdumpstate X-SVN-Commit-Revision: 347174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FB448345C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 03:20:03 -0000 Author: rmacklem Date: Mon May 6 03:20:02 2019 New Revision: 347174 URL: https://svnweb.freebsd.org/changeset/base/347174 Log: MFC: r346856 Add #ifdef INET6 around declaration of nbuf. It was reported that without #ifdef INET6 around the declaration of "nbuf", a build would report an unused variable. For some reason, I didn't see that warning when I did a build, but it seems reasonable to add these #ifdef INET6's. Modified: stable/10/usr.sbin/nfsdumpstate/nfsdumpstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/nfsdumpstate/nfsdumpstate.c ============================================================================== --- stable/10/usr.sbin/nfsdumpstate/nfsdumpstate.c Mon May 6 03:15:07 2019 (r347173) +++ stable/10/usr.sbin/nfsdumpstate/nfsdumpstate.c Mon May 6 03:20:02 2019 (r347174) @@ -121,7 +121,9 @@ dump_openstate(void) { struct nfsd_dumplist dumplist; int cnt, i; +#ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; +#endif dumplist.ndl_size = DUMPSIZE; dumplist.ndl_list = (void *)dp; @@ -176,7 +178,9 @@ dump_lockstate(char *fname) { struct nfsd_dumplocklist dumplocklist; int cnt, i; +#ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; +#endif dumplocklist.ndllck_size = DUMPSIZE; dumplocklist.ndllck_list = (void *)lp; From owner-svn-src-all@freebsd.org Mon May 6 03:31:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBBB5159C8A6; Mon, 6 May 2019 03:31:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EA4383C36; Mon, 6 May 2019 03:31:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E638107F; Mon, 6 May 2019 03:31:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x463VSYI005009; Mon, 6 May 2019 03:31:28 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x463VSWj005008; Mon, 6 May 2019 03:31:28 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905060331.x463VSWj005008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 6 May 2019 03:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347175 - stable/12/sys/powerpc/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/powerpc/powerpc X-SVN-Commit-Revision: 347175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5EA4383C36 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 03:31:28 -0000 Author: jhibbits Date: Mon May 6 03:31:27 2019 New Revision: 347175 URL: https://svnweb.freebsd.org/changeset/base/347175 Log: MFC r340262,344730 r340262: powerpc64: Fix "show spr" command on ELFv2 kernels r344730: powerpc: fix 'show spr' for ELFv1 powerpc64 Modified: stable/12/sys/powerpc/powerpc/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/powerpc/machdep.c ============================================================================== --- stable/12/sys/powerpc/powerpc/machdep.c Mon May 6 03:20:02 2019 (r347174) +++ stable/12/sys/powerpc/powerpc/machdep.c Mon May 6 03:31:27 2019 (r347175) @@ -541,8 +541,16 @@ DB_SHOW_COMMAND(spr, db_show_spr) saved_sprno = sprno = (intptr_t) addr; sprno = ((sprno & 0x3e0) >> 5) | ((sprno & 0x1f) << 5); p = (uint32_t *)(void *)&get_spr; +#ifdef __powerpc64__ +#if defined(_CALL_ELF) && _CALL_ELF == 2 + /* Account for ELFv2 function prologue. */ + p += 2; +#else + p = *(volatile uint32_t * volatile *)p; +#endif +#endif *p = (*p & ~0x001ff800) | (sprno << 11); - __syncicache(get_spr, cacheline_size); + __syncicache(__DEVOLATILE(uint32_t *, p), cacheline_size); spr = get_spr(sprno); db_printf("SPR %d(%x): %lx\n", saved_sprno, saved_sprno, From owner-svn-src-all@freebsd.org Mon May 6 03:35:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4586159C959; Mon, 6 May 2019 03:35:45 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8697083E5E; Mon, 6 May 2019 03:35:45 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CD3810CC; Mon, 6 May 2019 03:35:45 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x463ZjDS008258; Mon, 6 May 2019 03:35:45 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x463ZjTM008257; Mon, 6 May 2019 03:35:45 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905060335.x463ZjTM008257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 6 May 2019 03:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347176 - stable/12/sys/powerpc/mpc85xx X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 347176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8697083E5E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 03:35:46 -0000 Author: jhibbits Date: Mon May 6 03:35:44 2019 New Revision: 347176 URL: https://svnweb.freebsd.org/changeset/base/347176 Log: MFC r344613: powerpc/mpc85xx: Synchronize timebase the platform correct way Summary: To safely synchronize timebase we need to disable the timebase on all cores, set timebase, and resynchronize. This adds two new devices, mutually exclusive, which attach on the SoC simplebus, to freeze and unfreeze the timebase. The devices are singletons, and platform-specific, so no reason to make them optional and in separate files. This was found to be necessary for top(1) to work correctly on an AmigaOne X5000 (P5020 SoC). It also fixes bufdaemon and bufspacedaemon hangs at shutdown. Modified: stable/12/sys/powerpc/mpc85xx/platform_mpc85xx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- stable/12/sys/powerpc/mpc85xx/platform_mpc85xx.c Mon May 6 03:31:27 2019 (r347175) +++ stable/12/sys/powerpc/mpc85xx/platform_mpc85xx.c Mon May 6 03:35:44 2019 (r347176) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -87,6 +88,11 @@ vm_size_t ccsrbar_size; static int cpu, maxcpu; +static device_t rcpm_dev; +static void dummy_freeze(device_t, bool); + +static void (*freeze_timebase)(device_t, bool) = dummy_freeze; + static int mpc85xx_probe(platform_t); static void mpc85xx_mem_regions(platform_t, struct mem_region *phys, int *physsz, struct mem_region *avail, int *availsz); @@ -529,7 +535,174 @@ mpc85xx_reset(platform_t plat) static void mpc85xx_smp_timebase_sync(platform_t plat, u_long tb, int ap) { + static volatile bool tb_ready; + static volatile int cpu_done; - mttb(tb); + if (ap) { + /* APs. Hold off until we get a stable timebase. */ + while (!tb_ready) + atomic_thread_fence_seq_cst(); + mttb(tb); + atomic_add_int(&cpu_done, 1); + while (cpu_done < mp_ncpus) + atomic_thread_fence_seq_cst(); + } else { + /* BSP */ + freeze_timebase(rcpm_dev, true); + tb_ready = true; + mttb(tb); + atomic_add_int(&cpu_done, 1); + while (cpu_done < mp_ncpus) + atomic_thread_fence_seq_cst(); + freeze_timebase(rcpm_dev, false); + } } +/* Fallback freeze. In case no real handler is found in the device tree. */ +static void +dummy_freeze(device_t dev, bool freeze) +{ + /* Nothing to do here, move along. */ +} + + +/* QorIQ Run control/power management timebase management. */ + +#define RCPM_CTBENR 0x00000084 +struct mpc85xx_rcpm_softc { + struct resource *sc_mem; +}; + +static void +mpc85xx_rcpm_freeze_timebase(device_t dev, bool freeze) +{ + struct mpc85xx_rcpm_softc *sc; + + sc = device_get_softc(dev); + + if (freeze) + bus_write_4(sc->sc_mem, RCPM_CTBENR, 0); + else + bus_write_4(sc->sc_mem, RCPM_CTBENR, (1 << maxcpu) - 1); +} + +static int +mpc85xx_rcpm_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "fsl,qoriq-rcpm-1.0")) + return (ENXIO); + + device_set_desc(dev, "QorIQ Run control and power management"); + return (BUS_PROBE_GENERIC); +} + +static int +mpc85xx_rcpm_attach(device_t dev) +{ + struct mpc85xx_rcpm_softc *sc; + int rid; + + sc = device_get_softc(dev); + freeze_timebase = mpc85xx_rcpm_freeze_timebase; + rcpm_dev = dev; + + rid = 0; + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE | RF_SHAREABLE); + + return (0); +} + +static device_method_t mpc85xx_rcpm_methods[] = { + DEVMETHOD(device_probe, mpc85xx_rcpm_probe), + DEVMETHOD(device_attach, mpc85xx_rcpm_attach), + DEVMETHOD_END +}; + +static devclass_t mpc85xx_rcpm_devclass; + +static driver_t mpc85xx_rcpm_driver = { + "rcpm", + mpc85xx_rcpm_methods, + sizeof(struct mpc85xx_rcpm_softc) +}; + +EARLY_DRIVER_MODULE(mpc85xx_rcpm, simplebus, mpc85xx_rcpm_driver, + mpc85xx_rcpm_devclass, 0, 0, BUS_PASS_BUS); + + +/* "Global utilities" power management/Timebase management. */ + +#define GUTS_DEVDISR 0x00000070 +#define DEVDISR_TB0 0x00004000 +#define DEVDISR_TB1 0x00001000 + +struct mpc85xx_guts_softc { + struct resource *sc_mem; +}; + +static void +mpc85xx_guts_freeze_timebase(device_t dev, bool freeze) +{ + struct mpc85xx_guts_softc *sc; + uint32_t devdisr; + + sc = device_get_softc(dev); + + devdisr = bus_read_4(sc->sc_mem, GUTS_DEVDISR); + if (freeze) + bus_write_4(sc->sc_mem, GUTS_DEVDISR, + devdisr | (DEVDISR_TB0 | DEVDISR_TB1)); + else + bus_write_4(sc->sc_mem, GUTS_DEVDISR, + devdisr & ~(DEVDISR_TB0 | DEVDISR_TB1)); +} + +static int +mpc85xx_guts_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "fsl,mpc8572-guts") && + !ofw_bus_is_compatible(dev, "fsl,p1020-guts") && + !ofw_bus_is_compatible(dev, "fsl,p1021-guts") && + !ofw_bus_is_compatible(dev, "fsl,p1022-guts") && + !ofw_bus_is_compatible(dev, "fsl,p1023-guts") && + !ofw_bus_is_compatible(dev, "fsl,p2020-guts")) + return (ENXIO); + + device_set_desc(dev, "MPC85xx Global Utilities"); + return (BUS_PROBE_GENERIC); +} + +static int +mpc85xx_guts_attach(device_t dev) +{ + struct mpc85xx_rcpm_softc *sc; + int rid; + + sc = device_get_softc(dev); + freeze_timebase = mpc85xx_guts_freeze_timebase; + rcpm_dev = dev; + + rid = 0; + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE | RF_SHAREABLE); + + return (0); +} + +static device_method_t mpc85xx_guts_methods[] = { + DEVMETHOD(device_probe, mpc85xx_guts_probe), + DEVMETHOD(device_attach, mpc85xx_guts_attach), + DEVMETHOD_END +}; + +static driver_t mpc85xx_guts_driver = { + "guts", + mpc85xx_guts_methods, + sizeof(struct mpc85xx_guts_softc) +}; + +static devclass_t mpc85xx_guts_devclass; + +EARLY_DRIVER_MODULE(mpc85xx_guts, simplebus, mpc85xx_guts_driver, + mpc85xx_guts_devclass, 0, 0, BUS_PASS_BUS); From owner-svn-src-all@freebsd.org Mon May 6 03:39:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF4B3159C9F4; Mon, 6 May 2019 03:39:26 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 644EF83FD4; Mon, 6 May 2019 03:39:26 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B3E510D3; Mon, 6 May 2019 03:39:26 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x463dQ6C008483; Mon, 6 May 2019 03:39:26 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x463dPJN008482; Mon, 6 May 2019 03:39:25 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905060339.x463dPJN008482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 6 May 2019 03:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347177 - stable/12/sys/powerpc/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/powerpc/powerpc X-SVN-Commit-Revision: 347177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 644EF83FD4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 03:39:26 -0000 Author: jhibbits Date: Mon May 6 03:39:25 2019 New Revision: 347177 URL: https://svnweb.freebsd.org/changeset/base/347177 Log: MFC r344871: powerpc: Save stack pointer in savectx This allows 'show acttrace' to show backtrace on processes currently running on CPUs. Reported by: Brandon Bergren Modified: stable/12/sys/powerpc/powerpc/swtch32.S stable/12/sys/powerpc/powerpc/swtch64.S Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/powerpc/swtch32.S ============================================================================== --- stable/12/sys/powerpc/powerpc/swtch32.S Mon May 6 03:35:44 2019 (r347176) +++ stable/12/sys/powerpc/powerpc/swtch32.S Mon May 6 03:39:25 2019 (r347177) @@ -195,6 +195,7 @@ ENTRY(savectx) stmw %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs */ mfcr %r4 /* Save the condition register */ stw %r4,PCB_CR(%r3) + stw %r1,PCB_SP(%r3) /* Save the stack pointer */ mflr %r4 /* Save the link register */ stw %r4,PCB_LR(%r3) blr Modified: stable/12/sys/powerpc/powerpc/swtch64.S ============================================================================== --- stable/12/sys/powerpc/powerpc/swtch64.S Mon May 6 03:35:44 2019 (r347176) +++ stable/12/sys/powerpc/powerpc/swtch64.S Mon May 6 03:39:25 2019 (r347177) @@ -276,6 +276,7 @@ ENTRY(savectx) mfcr %r4 /* Save the condition register */ std %r4,PCB_CR(%r3) + std %r1,PCB_SP(%r3) /* Save the stack pointer */ std %r2,PCB_TOC(%r3) /* Save the TOC pointer */ mflr %r4 /* Save the link register */ std %r4,PCB_LR(%r3) From owner-svn-src-all@freebsd.org Mon May 6 08:30:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36C3B1582403; Mon, 6 May 2019 08:30:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB2F28D43F; Mon, 6 May 2019 08:30:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7C8C448B; Mon, 6 May 2019 08:30:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x468Ur96061652; Mon, 6 May 2019 08:30:53 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x468Url7061651; Mon, 6 May 2019 08:30:53 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905060830.x468Url7061651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 6 May 2019 08:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347178 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 347178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CB2F28D43F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 08:30:54 -0000 Author: ae Date: Mon May 6 08:30:53 2019 New Revision: 347178 URL: https://svnweb.freebsd.org/changeset/base/347178 Log: Add ipsec.ko to required_modules for rc.d/ipsec script. Thus it can be automatically loaded if ipsec_enable="YES" and option IPSEC is not in the kernel config. MFC after: 1 week Modified: head/libexec/rc/rc.d/ipsec Modified: head/libexec/rc/rc.d/ipsec ============================================================================== --- head/libexec/rc/rc.d/ipsec Mon May 6 03:39:25 2019 (r347177) +++ head/libexec/rc/rc.d/ipsec Mon May 6 08:30:53 2019 (r347178) @@ -20,6 +20,7 @@ stop_cmd="ipsec_stop" reload_cmd="ipsec_reload" extra_commands="reload" ipsec_program="/sbin/setkey" +required_modules="ipsec" # ipsec_file is set by rc.conf ipsec_prestart() From owner-svn-src-all@freebsd.org Mon May 6 08:32:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA1571582624; Mon, 6 May 2019 08:32:50 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E8F28D7D6; Mon, 6 May 2019 08:32:50 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 593024621; Mon, 6 May 2019 08:32:50 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x468WoRJ066497; Mon, 6 May 2019 08:32:50 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x468WoMk066496; Mon, 6 May 2019 08:32:50 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905060832.x468WoMk066496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 6 May 2019 08:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347179 - stable/12/stand/common X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/common X-SVN-Commit-Revision: 347179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E8F28D7D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 08:32:51 -0000 Author: tsoome Date: Mon May 6 08:32:49 2019 New Revision: 347179 URL: https://svnweb.freebsd.org/changeset/base/347179 Log: MFC r347142: loader: validate sectorsize argument in disk_open() The bug and patch is reported against 11.2, but it is good idea to have the check in place for all versions. PR: 236585 Submitted by: john@feith.com Reported by: john@feith.com Modified: stable/12/stand/common/disk.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/common/disk.c ============================================================================== --- stable/12/stand/common/disk.c Mon May 6 08:30:53 2019 (r347178) +++ stable/12/stand/common/disk.c Mon May 6 08:32:49 2019 (r347179) @@ -228,6 +228,10 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize struct ptable_entry part; int rc, slice, partition; + if (sectorsize == 0) { + DEBUG("unknown sector size"); + return (ENXIO); + } rc = 0; od = (struct open_disk *)malloc(sizeof(struct open_disk)); if (od == NULL) { From owner-svn-src-all@freebsd.org Mon May 6 08:46:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C65CD1582A4A; Mon, 6 May 2019 08:46:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63A708DE1C; Mon, 6 May 2019 08:46:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EA8D47C1; Mon, 6 May 2019 08:46:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x468kCea072277; Mon, 6 May 2019 08:46:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x468kCuf072276; Mon, 6 May 2019 08:46:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905060846.x468kCuf072276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 6 May 2019 08:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347180 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 347180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 63A708DE1C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 08:46:13 -0000 Author: kib Date: Mon May 6 08:46:11 2019 New Revision: 347180 URL: https://svnweb.freebsd.org/changeset/base/347180 Log: Noted by: alc Reviewed by: alc, markj (previous version) Sponsored by: The FreeBSD Foundation MFC after: 6 days Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon May 6 08:32:49 2019 (r347179) +++ head/sys/vm/vm_object.c Mon May 6 08:46:11 2019 (r347180) @@ -1726,9 +1726,8 @@ vm_object_collapse(vm_object_t object) VM_OBJECT_WLOCK(backing_object); if (backing_object->handle != NULL || (backing_object->type != OBJT_DEFAULT && - (backing_object->type != OBJT_SWAP || - (backing_object->flags & OBJ_NOSPLIT) != 0)) || - (backing_object->flags & OBJ_DEAD) || + backing_object->type != OBJT_SWAP) || + (backing_object->flags & (OBJ_DEAD | OBJ_NOSPLIT)) != 0 || object->handle != NULL || (object->type != OBJT_DEFAULT && object->type != OBJT_SWAP) || From owner-svn-src-all@freebsd.org Mon May 6 08:49:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 343D11582B25; Mon, 6 May 2019 08:49:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C43978E07E; Mon, 6 May 2019 08:49:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9977547C8; Mon, 6 May 2019 08:49:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x468nhGq072565; Mon, 6 May 2019 08:49:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x468nhq5072564; Mon, 6 May 2019 08:49:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905060849.x468nhq5072564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 6 May 2019 08:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347181 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 347181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C43978E07E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 08:49:44 -0000 Author: kib Date: Mon May 6 08:49:43 2019 New Revision: 347181 URL: https://svnweb.freebsd.org/changeset/base/347181 Log: Do not flush NFS node from NFS VOP_SET_TEXT(). The more appropriate place to do the flushing is VOP_OPEN(). This was uncovered because VOP_SET_TEXT() is now called with the vnode' vm_object rlocked, which is incompatible with the flush operations. After the move, there is no need for NFS-specific VOP_SET_TEXT overload. Sponsored by: The FreeBSD Foundation MFC after: 30 days Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Mon May 6 08:46:11 2019 (r347180) +++ head/sys/fs/nfsclient/nfs_clvnops.c Mon May 6 08:49:43 2019 (r347181) @@ -142,7 +142,6 @@ static vop_advlock_t nfs_advlock; static vop_advlockasync_t nfs_advlockasync; static vop_getacl_t nfs_getacl; static vop_setacl_t nfs_setacl; -static vop_set_text_t nfs_set_text; /* * Global vfs data structures for nfs @@ -180,7 +179,6 @@ static struct vop_vector newnfs_vnodeops_nosig = { .vop_write = ncl_write, .vop_getacl = nfs_getacl, .vop_setacl = nfs_setacl, - .vop_set_text = nfs_set_text, }; static int @@ -523,6 +521,7 @@ nfs_open(struct vop_open_args *ap) int error; int fmode = ap->a_mode; struct ucred *cred; + vm_object_t obj; if (vp->v_type != VREG && vp->v_type != VDIR && vp->v_type != VLNK) return (EOPNOTSUPP); @@ -636,6 +635,32 @@ nfs_open(struct vop_open_args *ap) if (cred != NULL) crfree(cred); vnode_create_vobject(vp, vattr.va_size, ap->a_td); + + /* + * If the text file has been mmap'd, flush any dirty pages to the + * buffer cache and then... + * Make sure all writes are pushed to the NFS server. If this is not + * done, the modify time of the file can change while the text + * file is being executed. This will cause the process that is + * executing the text file to be terminated. + */ + if (vp->v_writecount <= -1) { + if ((obj = vp->v_object) != NULL && + (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { + VM_OBJECT_WLOCK(obj); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(obj); + } + + /* Now, flush the buffer cache. */ + ncl_flush(vp, MNT_WAIT, curthread, 0, 0); + + /* And, finally, make sure that n_mtime is up to date. */ + np = VTONFS(vp); + mtx_lock(&np->n_mtx); + np->n_mtime = np->n_vattr.na_mtime; + mtx_unlock(&np->n_mtx); + } return (0); } @@ -3411,38 +3436,6 @@ nfs_setacl(struct vop_setacl_args *ap) error = EPERM; } return (error); -} - -static int -nfs_set_text(struct vop_set_text_args *ap) -{ - struct vnode *vp = ap->a_vp; - struct nfsnode *np; - - /* - * If the text file has been mmap'd, flush any dirty pages to the - * buffer cache and then... - * Make sure all writes are pushed to the NFS server. If this is not - * done, the modify time of the file can change while the text - * file is being executed. This will cause the process that is - * executing the text file to be terminated. - */ - if (vp->v_object != NULL) { - VM_OBJECT_WLOCK(vp->v_object); - vm_object_page_clean(vp->v_object, 0, 0, OBJPC_SYNC); - VM_OBJECT_WUNLOCK(vp->v_object); - } - - /* Now, flush the buffer cache. */ - ncl_flush(vp, MNT_WAIT, curthread, 0, 0); - - /* And, finally, make sure that n_mtime is up to date. */ - np = VTONFS(vp); - mtx_lock(&np->n_mtx); - np->n_mtime = np->n_vattr.na_mtime; - mtx_unlock(&np->n_mtx); - - return (vop_stdset_text(ap)); } /* From owner-svn-src-all@freebsd.org Mon May 6 08:55:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 855641582E20; Mon, 6 May 2019 08:55:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 095BB8E5C1; Mon, 6 May 2019 08:55:24 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3534496B; Mon, 6 May 2019 08:55:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x468tNea077658; Mon, 6 May 2019 08:55:23 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x468tNDK077657; Mon, 6 May 2019 08:55:23 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905060855.x468tNDK077657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 6 May 2019 08:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347182 - stable/11/stand/common X-SVN-Group: stable-11 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/11/stand/common X-SVN-Commit-Revision: 347182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 095BB8E5C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 08:55:24 -0000 Author: tsoome Date: Mon May 6 08:55:23 2019 New Revision: 347182 URL: https://svnweb.freebsd.org/changeset/base/347182 Log: MFC r347142: loader: validate sectorsize argument in disk_open() The bug and patch is reported against 11.2, but it is good idea to have the check in place for all versions. PR: 236585 Submitted by: john@feith.com Reported by: john@feith.com Modified: stable/11/stand/common/disk.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/disk.c ============================================================================== --- stable/11/stand/common/disk.c Mon May 6 08:49:43 2019 (r347181) +++ stable/11/stand/common/disk.c Mon May 6 08:55:23 2019 (r347182) @@ -228,6 +228,10 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize struct ptable_entry part; int rc, slice, partition; + if (sectorsize == 0) { + DPRINTF("unknown sector size"); + return (ENXIO); + } rc = 0; od = (struct open_disk *)malloc(sizeof(struct open_disk)); if (od == NULL) { From owner-svn-src-all@freebsd.org Mon May 6 08:57:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 961021582EAA; Mon, 6 May 2019 08:57:01 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DC78E707; Mon, 6 May 2019 08:56:59 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id x468uluS094510 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 May 2019 18:56:53 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id x468ugMR038371 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 6 May 2019 18:56:42 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x468ugrV038370; Mon, 6 May 2019 18:56:42 +1000 (AEST) (envelope-from peter) Date: Mon, 6 May 2019 18:56:41 +1000 From: Peter Jeremy To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347151 - in head: libexec/rtld-elf sys/compat/linux sys/fs/deadfs sys/fs/nfsclient sys/fs/nullfs sys/fs/unionfs sys/kern sys/sys sys/ufs/ufs sys/vm Message-ID: <20190506085641.GA38182@server.rulingia.com> References: <201905051120.x45BKi23092719@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline In-Reply-To: <201905051120.x45BKi23092719@repo.freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.11.4 (2019-03-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 08:57:01 -0000 --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-May-05 11:20:44 +0000, Konstantin Belousov wrote: >Log: > Switch to use shared vnode locks for text files during image activation. This seems to have broken diskless booting on my Rock64 (aarch64). Reverting just this commit fixes the problem. I haven't dug into it yet. dwc0: link state changed to DOWN NFS ROOT: 192.168.12.200:/tank/rock64 dwc0: link state changed to UP Warning: no time-of-day clock registered, system time will not be set accur= ately Warning: no time-of-day clock registered, system time will not be set accur= ately exclusive lock of (rw) vm object @ /usr/src/sys/fs/nfsclient/nfs_clvnops.c:= 3431 while share locked from /usr/src/sys/vm/vm_map.c:521 panic: share->excl cpuid =3D 3 time =3D 5 KDB: stack backtrace: db_trace_self() at db_trace_self_wrapper+0x28 pc =3D 0xffff000000530cd4 lr =3D 0xffff0000000dedb8 sp =3D 0xffff000056b1d360 fp =3D 0xffff000056b1d570 db_trace_self_wrapper() at vpanic+0x18c pc =3D 0xffff0000000dedb8 lr =3D 0xffff000000275b58 sp =3D 0xffff000056b1d580 fp =3D 0xffff000056b1d620 vpanic() at panic+0x44 pc =3D 0xffff000000275b58 lr =3D 0xffff000000275920 sp =3D 0xffff000056b1d630 fp =3D 0xffff000056b1d6b0 panic() at witness_checkorder+0x1c0 pc =3D 0xffff000000275920 lr =3D 0xffff0000002d8b1c sp =3D 0xffff000056b1d6c0 fp =3D 0xffff000056b1d730 witness_checkorder() at _rw_wlock_cookie+0x74 pc =3D 0xffff0000002d8b1c lr =3D 0xffff000000270aac sp =3D 0xffff000056b1d740 fp =3D 0xffff000056b1d760 _rw_wlock_cookie() at nfs_set_text+0x34 pc =3D 0xffff000000270aac lr =3D 0xffff0000001dee30 sp =3D 0xffff000056b1d770 fp =3D 0xffff000056b1d790 nfs_set_text() at vop_sigdefer+0x68 pc =3D 0xffff0000001dee30 lr =3D 0xffff00000032b5c0 sp =3D 0xffff000056b1d7a0 fp =3D 0xffff000056b1d7c0 vop_sigdefer() at VOP_SET_TEXT_APV+0xd4 pc =3D 0xffff00000032b5c0 lr =3D 0xffff0000005665ac sp =3D 0xffff000056b1d7d0 fp =3D 0xffff000056b1d7f0 VOP_SET_TEXT_APV() at vm_map_entry_set_vnode_text+0x104 pc =3D 0xffff0000005665ac lr =3D 0xffff00000050044c sp =3D 0xffff000056b1d800 fp =3D 0xffff000056b1d850 vm_map_entry_set_vnode_text() at vmspace_fork+0x998 pc =3D 0xffff00000050044c lr =3D 0xffff000000506a94 sp =3D 0xffff000056b1d860 fp =3D 0xffff000056b1d8b0 vmspace_fork() at fork1+0x498 pc =3D 0xffff000000506a94 lr =3D 0xffff0000002362cc sp =3D 0xffff000056b1d8c0 fp =3D 0xffff000056b1d960 fork1() at sys_fork+0x30 pc =3D 0xffff0000002362cc lr =3D 0xffff000000235e10 sp =3D 0xffff000056b1d970 fp =3D 0xffff000056b1d9b0 sys_fork() at do_el0_sync+0x508 pc =3D 0xffff000000235e10 lr =3D 0xffff00000054b694 sp =3D 0xffff000056b1d9c0 fp =3D 0xffff000056b1da70 do_el0_sync() at handle_el0_sync+0x84 pc =3D 0xffff00000054b694 lr =3D 0xffff000000533200 sp =3D 0xffff000056b1da80 fp =3D 0xffff000056b1db90 handle_el0_sync() at 0x221420 pc =3D 0xffff000000533200 lr =3D 0x0000000000221420 sp =3D 0xffff000056b1dba0 fp =3D 0x0000ffffffffe760 KDB: enter: panic [ thread pid 1 tid 100002 ] Stopped at 0x28d598: undefined 54000042 db>=20 --=20 Peter Jeremy --6c2NcOVqGQ03X4Wi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAlzP9slfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzTbqRAAnVG/mmoXI+nYClIVQIXrLmvLz/nWd5sUow1o+J8uYhOBHBjlZdbWM1V0 hJSvNW9ey0Hn6bbxuYHUjgeTETbUGF0eHVVGaalMxFjsC502BQbCqK9orl05ns6D Mb3iNIQLEf2pti/6qMOPtFn7YAqjv6Q4RkliMb3KcPvDn56Qvzaji0tWEi/HWI4Z f/8mw6wRGdxvRW1YOIWOjdKP9WDyAw32EeEv9ajsS7CkjovbUc1RS7dsbDojpvYp mPA0IM81gZC7MuPRbh3yTA+mDCRz6+VvXpi92TgFPwRdX5l/OUIWNJSqsaeALdoX 8UqjrZW5mIvYtXO0lVhr03IzTN4AsYw+8LE3yKs5ca/SlKdJslI2Wjph+tndO7E3 tA21yRW6xpxZtU1+CI+nZ2fGCGiihvsIwSq70RmGNiczI/XiZtFetBcuIc2DU3AG A4ePChMWBYZiEmQlGPTjHsPhpFtqJWeR2n0iPQCZOQaTLhsUqQgemA4TFEtW1+ox SFc+16Eei2SDYni2ToxkV1G0mYyftotJgSpx+0DtxeGM4xxTlgt5mIVOo/4EBW18 5YJokA2bauKGr0Sk3b2oiRt4Q3Y5tWd6ODwjwKtQ2c2Q44W5ZBpBFr3Cm/D5bEod pGob71FY1C/CJFmtZfmQGte9m+xFB9ZGdRHpOAAP/s+KzDS5SnY= =JOTf -----END PGP SIGNATURE----- --6c2NcOVqGQ03X4Wi-- From owner-svn-src-all@freebsd.org Mon May 6 09:09:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32BB81583508; Mon, 6 May 2019 09:09:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CEAF8ECF7; Mon, 6 May 2019 09:09:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x4699KMW023956 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 6 May 2019 12:09:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4699KMW023956 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4699K8f023955; Mon, 6 May 2019 12:09:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 6 May 2019 12:09:20 +0300 From: Konstantin Belousov To: Peter Jeremy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347151 - in head: libexec/rtld-elf sys/compat/linux sys/fs/deadfs sys/fs/nfsclient sys/fs/nullfs sys/fs/unionfs sys/kern sys/sys sys/ufs/ufs sys/vm Message-ID: <20190506090920.GC2748@kib.kiev.ua> References: <201905051120.x45BKi23092719@repo.freebsd.org> <20190506085641.GA38182@server.rulingia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190506085641.GA38182@server.rulingia.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 09:09:29 -0000 On Mon, May 06, 2019 at 06:56:41PM +1000, Peter Jeremy wrote: > On 2019-May-05 11:20:44 +0000, Konstantin Belousov wrote: > >Log: > > Switch to use shared vnode locks for text files during image activation. > > This seems to have broken diskless booting on my Rock64 (aarch64). > Reverting just this commit fixes the problem. I haven't dug into it yet. > > dwc0: link state changed to DOWN > NFS ROOT: 192.168.12.200:/tank/rock64 > dwc0: link state changed to UP > Warning: no time-of-day clock registered, system time will not be set accurately > Warning: no time-of-day clock registered, system time will not be set accurately > exclusive lock of (rw) vm object @ /usr/src/sys/fs/nfsclient/nfs_clvnops.c:3431 > while share locked from /usr/src/sys/vm/vm_map.c:521 > panic: share->excl > cpuid = 3 > time = 5 > KDB: stack backtrace: > db_trace_self() at db_trace_self_wrapper+0x28 > pc = 0xffff000000530cd4 lr = 0xffff0000000dedb8 > sp = 0xffff000056b1d360 fp = 0xffff000056b1d570 > > db_trace_self_wrapper() at vpanic+0x18c > pc = 0xffff0000000dedb8 lr = 0xffff000000275b58 > sp = 0xffff000056b1d580 fp = 0xffff000056b1d620 > > vpanic() at panic+0x44 > pc = 0xffff000000275b58 lr = 0xffff000000275920 > sp = 0xffff000056b1d630 fp = 0xffff000056b1d6b0 > > panic() at witness_checkorder+0x1c0 > pc = 0xffff000000275920 lr = 0xffff0000002d8b1c > sp = 0xffff000056b1d6c0 fp = 0xffff000056b1d730 > > witness_checkorder() at _rw_wlock_cookie+0x74 > pc = 0xffff0000002d8b1c lr = 0xffff000000270aac > sp = 0xffff000056b1d740 fp = 0xffff000056b1d760 > > _rw_wlock_cookie() at nfs_set_text+0x34 > pc = 0xffff000000270aac lr = 0xffff0000001dee30 > sp = 0xffff000056b1d770 fp = 0xffff000056b1d790 > > nfs_set_text() at vop_sigdefer+0x68 > pc = 0xffff0000001dee30 lr = 0xffff00000032b5c0 > sp = 0xffff000056b1d7a0 fp = 0xffff000056b1d7c0 > > vop_sigdefer() at VOP_SET_TEXT_APV+0xd4 > pc = 0xffff00000032b5c0 lr = 0xffff0000005665ac > sp = 0xffff000056b1d7d0 fp = 0xffff000056b1d7f0 > > VOP_SET_TEXT_APV() at vm_map_entry_set_vnode_text+0x104 > pc = 0xffff0000005665ac lr = 0xffff00000050044c > sp = 0xffff000056b1d800 fp = 0xffff000056b1d850 > > vm_map_entry_set_vnode_text() at vmspace_fork+0x998 > pc = 0xffff00000050044c lr = 0xffff000000506a94 > sp = 0xffff000056b1d860 fp = 0xffff000056b1d8b0 > > vmspace_fork() at fork1+0x498 > pc = 0xffff000000506a94 lr = 0xffff0000002362cc > sp = 0xffff000056b1d8c0 fp = 0xffff000056b1d960 > > fork1() at sys_fork+0x30 > pc = 0xffff0000002362cc lr = 0xffff000000235e10 > sp = 0xffff000056b1d970 fp = 0xffff000056b1d9b0 > > sys_fork() at do_el0_sync+0x508 > pc = 0xffff000000235e10 lr = 0xffff00000054b694 > sp = 0xffff000056b1d9c0 fp = 0xffff000056b1da70 > > do_el0_sync() at handle_el0_sync+0x84 > pc = 0xffff00000054b694 lr = 0xffff000000533200 > sp = 0xffff000056b1da80 fp = 0xffff000056b1db90 > > handle_el0_sync() at 0x221420 > pc = 0xffff000000533200 lr = 0x0000000000221420 > sp = 0xffff000056b1dba0 fp = 0x0000ffffffffe760 > > KDB: enter: panic > [ thread pid 1 tid 100002 ] > Stopped at 0x28d598: undefined 54000042 > db> This should be fixed by r347181. From owner-svn-src-all@freebsd.org Mon May 6 09:44:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D6DC15844CA; Mon, 6 May 2019 09:44:53 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E0756827D; Mon, 6 May 2019 09:44:51 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id x469ig3p094713 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 May 2019 19:44:48 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id x469iaOW038794 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 6 May 2019 19:44:36 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x469iauk038793; Mon, 6 May 2019 19:44:36 +1000 (AEST) (envelope-from peter) Date: Mon, 6 May 2019 19:44:36 +1000 From: Peter Jeremy To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347151 - in head: libexec/rtld-elf sys/compat/linux sys/fs/deadfs sys/fs/nfsclient sys/fs/nullfs sys/fs/unionfs sys/kern sys/sys sys/ufs/ufs sys/vm Message-ID: <20190506094436.GB31124@server.rulingia.com> References: <201905051120.x45BKi23092719@repo.freebsd.org> <20190506085641.GA38182@server.rulingia.com> <20190506090920.GC2748@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VrqPEDrXMn8OVzN4" Content-Disposition: inline In-Reply-To: <20190506090920.GC2748@kib.kiev.ua> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.11.4 (2019-03-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 09:44:53 -0000 --VrqPEDrXMn8OVzN4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-May-06 12:09:20 +0300, Konstantin Belousov wr= ote: >On Mon, May 06, 2019 at 06:56:41PM +1000, Peter Jeremy wrote: >> On 2019-May-05 11:20:44 +0000, Konstantin Belousov wro= te: >> >Log: >> > Switch to use shared vnode locks for text files during image activati= on. >>=20 >> This seems to have broken diskless booting on my Rock64 (aarch64). >> Reverting just this commit fixes the problem. I haven't dug into it yet. =2E.. >This should be fixed by r347181. I saw r347181 just after I sent my mail. Upgrading to r347182 does fix the problem, thank you. --=20 Peter Jeremy --VrqPEDrXMn8OVzN4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAlzQAgRfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzQN8BAAn27rOuZUxYQ9zkNUVPi9C46bdbxsxe6oHguBIgIyP331gSlGxcLltDi0 9zwJLIN2iqCXeqa7fy7d7uPs6j5P8wxp5PvsUBkXS7A8trqd516hMURMZDmeEOz7 5Yb5Dp6qvc/+XoatakLkYnOhulD/k63Kb0eER8hhWccA9IH2PLlkBDS2N4yCHYs4 eoFDui8F0vy7hd0rkPOEDSkTxPqqvoDLgdTn1Oz6p/57r+fViGoR+SsKNzQQrr5O Vdqz+FpI8OVXW93ZDJFeOYsWqxdTADglAtHPjROv0wE0u5R0813AWf8sDUncCHF5 Uxix1o9uBDEKNYoSa4+Bi87Jnh0hfOzxQqg6WMUTnnTKyhAae2brl48amcLLTrC9 AvUENhXp7TlWdgoI/aDZtuf6tUZWduPjW84Sb/JD9/IX19bt+G/mIgiJxuPQyUsI cZh4hl3xRP3UA4SWu8gA8fDMXQdZHDyhY2VcNmCFMXIrDUE9PKNax2+egttF0Epm kY+vFj6rEyzegzMy+5qKCCCVztFb0Fy6TGAnw0iBx+7FtZZpbnX/dfxHHBQjzapD 3CS9fDuzdDz4HbgEK+sv3t9/E2iHD/H5rhnJe9gbESK0FmlochnmxshoevBhP3rT SSLfPdhmuQExq9txkOd0/obzp6c+H57klQ7edJLAQlEtEO/TjWA= =l5vi -----END PGP SIGNATURE----- --VrqPEDrXMn8OVzN4-- From owner-svn-src-all@freebsd.org Mon May 6 09:48:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE06715845FC; Mon, 6 May 2019 09:48:35 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3B2684E5; Mon, 6 May 2019 09:48:35 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 276E651C0; Mon, 6 May 2019 09:48:35 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x469mZ5v004588; Mon, 6 May 2019 09:48:35 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x469mZiw004587; Mon, 6 May 2019 09:48:35 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201905060948.x469mZiw004587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 6 May 2019 09:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347183 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 347183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D3B2684E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 09:48:35 -0000 Author: royger Date: Mon May 6 09:48:34 2019 New Revision: 347183 URL: https://svnweb.freebsd.org/changeset/base/347183 Log: geom: fix initialization order There's a race between the initialization of devsoftc.mtx (by devinit) and the creation of the geom worker thread g_run_events, which calls devctl_queue_data_f. Both of those are initialized at SI_SUB_DRIVERS and SI_ORDER_FIRST, which means the geom worked thread can be created before the mutex has been initialized, leading to the panic below: wpanic: mtx_lock() of spin mutex (null) @ /usr/home/osstest/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 cpuid = 3 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe003b968710 vpanic() at vpanic+0x19d/frame 0xfffffe003b968760 panic() at panic+0x43/frame 0xfffffe003b9687c0 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xfffffe003b968810 devctl_queue_data_f() at devctl_queue_data_f+0x6a/frame 0xfffffe003b968840 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003b968a00 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003b968a30 g_run_events() at g_run_events+0x197/frame 0xfffffe003b968a70 fork_exit() at fork_exit+0x84/frame 0xfffffe003b968ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe003b968ab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- KDB: enter: panic [ thread pid 13 tid 100029 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why Fix this by initializing geom at SI_ORDER_SECOND instead of SI_ORDER_FIRST. Sponsored by: Citrix Systems R&D Reviewed by: kevans, markj Differential revision: https://reviews.freebsd.org/D20148 Modified: head/sys/geom/geom.h Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Mon May 6 08:55:23 2019 (r347182) +++ head/sys/geom/geom.h Mon May 6 09:48:34 2019 (r347183) @@ -415,7 +415,7 @@ g_free(void *ptr) static moduledata_t name##_mod = { \ #name, g_modevent, &class \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); + DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); int g_is_geom_thread(struct thread *td); From owner-svn-src-all@freebsd.org Mon May 6 14:42:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47593158CBEB; Mon, 6 May 2019 14:42:04 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCE4672A3E; Mon, 6 May 2019 14:42:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 89DA514B0A; Mon, 6 May 2019 14:42:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f169.google.com with SMTP id q10so11315557ljc.6; Mon, 06 May 2019 07:42:03 -0700 (PDT) X-Gm-Message-State: APjAAAXLpa0nvQwc+k5GSeqpyvS5aB7IrZ/OigUVY685v/Y+nuY6B1HF fugDSoM/Uf+uOg337M3Q5GPf+Ql+mdXRvbbq6Aw= X-Google-Smtp-Source: APXvYqxv/n3sbKxZeByFoKDSxfo9Ih9vn95TETa78KzXp13xCcdKriG3rQC5sCroKht4S9MvwUSGFitg+Yu+VJBZEdA= X-Received: by 2002:a2e:9a17:: with SMTP id o23mr4303621lji.108.1557153721956; Mon, 06 May 2019 07:42:01 -0700 (PDT) MIME-Version: 1.0 References: <201905060948.x469mZiw004587@repo.freebsd.org> In-Reply-To: <201905060948.x469mZiw004587@repo.freebsd.org> From: Kyle Evans Date: Mon, 6 May 2019 09:41:23 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347183 - head/sys/geom To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: CCE4672A3E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 14:42:04 -0000 On Mon, May 6, 2019 at 4:48 AM Roger Pau Monn=C3=A9 wr= ote: > > Author: royger > Date: Mon May 6 09:48:34 2019 > New Revision: 347183 > URL: https://svnweb.freebsd.org/changeset/base/347183 > > Log: > geom: fix initialization order > > There's a race between the initialization of devsoftc.mtx (by devinit) > and the creation of the geom worker thread g_run_events, which calls > devctl_queue_data_f. Both of those are initialized at SI_SUB_DRIVERS > and SI_ORDER_FIRST, which means the geom worked thread can be created > before the mutex has been initialized, leading to the panic below: > > wpanic: mtx_lock() of spin mutex (null) @ /usr/home/osstest/build.1353= 17.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 > cpuid =3D 3 > time =3D 1 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00= 3b968710 > vpanic() at vpanic+0x19d/frame 0xfffffe003b968760 > panic() at panic+0x43/frame 0xfffffe003b9687c0 > __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xfffffe003b968810 > devctl_queue_data_f() at devctl_queue_data_f+0x6a/frame 0xfffffe003b96= 8840 > g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003b968a00 > g_load_class() at g_load_class+0x1bc/frame 0xfffffe003b968a30 > g_run_events() at g_run_events+0x197/frame 0xfffffe003b968a70 > fork_exit() at fork_exit+0x84/frame 0xfffffe003b968ab0 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe003b968ab0 > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- > KDB: enter: panic > [ thread pid 13 tid 100029 ] > Stopped at kdb_enter+0x3b: movq $0,kdb_why > > Fix this by initializing geom at SI_ORDER_SECOND instead of > SI_ORDER_FIRST. > > Sponsored by: Citrix Systems R&D > Reviewed by: kevans, markj > Differential revision: https://reviews.freebsd.org/D20148 > Hi, Any objections to my MFC'ing this on ~Thursday with the tun change that sparked it? Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Mon May 6 16:00:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACA88158E47E; Mon, 6 May 2019 16:00:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5012575594; Mon, 6 May 2019 16:00:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27F2E8FAB; Mon, 6 May 2019 16:00:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46G0Kh3098616; Mon, 6 May 2019 16:00:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46G0Kas098614; Mon, 6 May 2019 16:00:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905061600.x46G0Kas098614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 May 2019 16:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347185 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 347185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5012575594 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.916,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 16:00:22 -0000 Author: hselasky Date: Mon May 6 16:00:20 2019 New Revision: 347185 URL: https://svnweb.freebsd.org/changeset/base/347185 Log: Allow controlling pr_debug at runtime in the LinuxKPI. Turning on pr_debug at compile time make it non-optional at runtime. This often means that the amount of the debugging is unbearable. Allow developer to turn on pr_debug output only when needed. Build tested drm-current-kmod prior to commit. MFC after: 1 week Submitted by: kib@ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 6 15:20:18 2019 (r347184) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 6 16:00:20 2019 (r347185) @@ -177,8 +177,12 @@ scnprintf(char *buf, size_t size, const char *fmt, ... * unless DEBUG is defined: */ #ifdef DEBUG -#define pr_debug(fmt, ...) \ - log(LOG_DEBUG, fmt, ##__VA_ARGS__) +extern int linuxkpi_debug; +#define pr_debug(fmt, ...) \ + do { \ + if (linuxkpi_debug) \ + log(LOG_DEBUG, fmt, ##__VA_ARGS__); \ + } while (0) #define pr_devel(fmt, ...) \ log(LOG_DEBUG, pr_fmt(fmt), ##__VA_ARGS__) #else Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 6 15:20:18 2019 (r347184) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 6 16:00:20 2019 (r347185) @@ -92,6 +92,10 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(_compat, OID_AUTO, linuxkpi, CTLFLAG_RW, 0, "LinuxKPI parameters"); +int linuxkpi_debug; +SYSCTL_INT(_compat_linuxkpi, OID_AUTO, debug, CTLFLAG_RWTUN, + &linuxkpi_debug, 0, "Set to enable pr_debug() prints. Clear to disable."); + MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat"); #include From owner-svn-src-all@freebsd.org Mon May 6 16:07:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12CF8158E7AA; Mon, 6 May 2019 16:07:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B60F075B96; Mon, 6 May 2019 16:07:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77877916E; Mon, 6 May 2019 16:07:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46G7E5G003615; Mon, 6 May 2019 16:07:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46G7E5n003614; Mon, 6 May 2019 16:07:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905061607.x46G7E5n003614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 6 May 2019 16:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347186 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 347186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B60F075B96 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.93)[-0.927,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 16:07:15 -0000 Author: emaste Date: Mon May 6 16:07:14 2019 New Revision: 347186 URL: https://svnweb.freebsd.org/changeset/base/347186 Log: Reformat arm64 linux syscalls.master per current style Equivalent to r339958 for sys/kern/syscalls.master. MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14858 Modified: head/sys/arm64/linux/syscalls.master Modified: head/sys/arm64/linux/syscalls.master ============================================================================== --- head/sys/arm64/linux/syscalls.master Mon May 6 16:00:20 2019 (r347185) +++ head/sys/arm64/linux/syscalls.master Mon May 6 16:07:14 2019 (r347186) @@ -18,499 +18,1557 @@ 2 AUE_NULL UNIMPL linux_io_submit 3 AUE_NULL UNIMPL linux_io_cancel 4 AUE_NULL UNIMPL linux_io_getevents -5 AUE_NULL STD { int linux_setxattr(void); } -6 AUE_NULL STD { int linux_lsetxattr(void); } -7 AUE_NULL STD { int linux_fsetxattr(void); } -8 AUE_NULL STD { int linux_getxattr(void); } -9 AUE_NULL STD { int linux_lgetxattr(void); } -10 AUE_NULL STD { int linux_fgetxattr(void); } -11 AUE_NULL STD { int linux_listxattr(void); } -12 AUE_NULL STD { int linux_llistxattr(void); } -13 AUE_NULL STD { int linux_flistxattr(void); } -14 AUE_NULL STD { int linux_removexattr(void); } -15 AUE_NULL STD { int linux_lremovexattr(void); } -16 AUE_NULL STD { int linux_fremovexattr(void); } -17 AUE_GETCWD STD { int linux_getcwd(char *buf, \ - l_ulong bufsize); } -18 AUE_NULL STD { int linux_lookup_dcookie(void); } -19 AUE_NULL STD { int linux_eventfd2(l_uint initval, \ - l_int flags); } -20 AUE_NULL STD { int linux_epoll_create1(l_int flags); } -21 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, \ - l_int fd, struct epoll_event *event); } -22 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, \ - struct epoll_event *events, \ - l_int maxevents, l_int timeout, \ - l_sigset_t *mask, l_size_t sigsetsize); } -23 AUE_DUP NOPROTO { int dup(u_int fd); } -24 AUE_NULL STD { int linux_dup3(l_int oldfd, l_int newfd, \ - l_int flags); } -25 AUE_FCNTL STD { int linux_fcntl(l_uint fd, l_uint cmd, \ - l_ulong arg); } -26 AUE_NULL STD { int linux_inotify_init1(l_int flags); } -27 AUE_NULL STD { int linux_inotify_add_watch(void); } -28 AUE_NULL STD { int linux_inotify_rm_watch(void); } -29 AUE_IOCTL STD { int linux_ioctl(l_uint fd, l_uint cmd, \ - uintptr_t arg); } -30 AUE_NULL STD { int linux_ioprio_set(void); } -31 AUE_NULL STD { int linux_ioprio_get(void); } -32 AUE_FLOCK NOPROTO { int flock(int fd, int how); } -33 AUE_MKNODAT STD { int linux_mknodat(l_int dfd, \ - const char *filename, l_int mode, \ - l_uint dev); } -34 AUE_MKDIRAT STD { int linux_mkdirat(l_int dfd, \ - const char *pathname, l_int mode); } -35 AUE_UNLINKAT STD { int linux_unlinkat(l_int dfd, \ - const char *pathname, l_int flag); } -36 AUE_SYMLINKAT STD { int linux_symlinkat(const char *oldname, \ - l_int newdfd, const char *newname); } -37 AUE_LINKAT STD { int linux_linkat(l_int olddfd, \ - const char *oldname, l_int newdfd, \ - const char *newname, l_int flag); } -38 AUE_RENAMEAT STD { int linux_renameat(l_int olddfd, \ - const char *oldname, l_int newdfd, \ - const char *newname); } +5 AUE_NULL STD { + int linux_setxattr(void); + } +6 AUE_NULL STD { + int linux_lsetxattr(void); + } +7 AUE_NULL STD { + int linux_fsetxattr(void); + } +8 AUE_NULL STD { + int linux_getxattr(void); + } +9 AUE_NULL STD { + int linux_lgetxattr(void); + } +10 AUE_NULL STD { + int linux_fgetxattr(void); + } +11 AUE_NULL STD { + int linux_listxattr(void); + } +12 AUE_NULL STD { + int linux_llistxattr(void); + } +13 AUE_NULL STD { + int linux_flistxattr(void); + } +14 AUE_NULL STD { + int linux_removexattr(void); + } +15 AUE_NULL STD { + int linux_lremovexattr(void); + } +16 AUE_NULL STD { + int linux_fremovexattr(void); + } +17 AUE_GETCWD STD { + int linux_getcwd( + char *buf, + l_ulong bufsize + ); + } +18 AUE_NULL STD { + int linux_lookup_dcookie(void); + } +19 AUE_NULL STD { + int linux_eventfd2( + l_uint initval, + l_int flags + ); + } +20 AUE_NULL STD { + int linux_epoll_create1( + l_int flags + ); + } +21 AUE_NULL STD { + int linux_epoll_ctl( + l_int epfd, + l_int op, + l_int fd, + struct epoll_event *event + ); + } +22 AUE_NULL STD { + int linux_epoll_pwait( + l_int epfd, + struct epoll_event *events, + l_int maxevents, + l_int timeout, + l_sigset_t *mask, + l_size_t sigsetsize + ); + } +23 AUE_DUP NOPROTO { + int dup( + u_int fd); + } +24 AUE_NULL STD { + int linux_dup3( + l_int oldfd, + l_int newfd, + l_int flags + ); + } +25 AUE_FCNTL STD { + int linux_fcntl( + l_uint fd, + l_uint cmd, + l_ulong arg + ); + } +26 AUE_NULL STD { + int linux_inotify_init1( + l_int flags + ); + } +27 AUE_NULL STD { + int linux_inotify_add_watch(void); + } +28 AUE_NULL STD { + int linux_inotify_rm_watch(void); + } +29 AUE_IOCTL STD { + int linux_ioctl( + l_uint fd, + l_uint cmd, + uintptr_t arg + ); + } +30 AUE_NULL STD { + int linux_ioprio_set(void); + } +31 AUE_NULL STD { + int linux_ioprio_get(void); + } +32 AUE_FLOCK NOPROTO { + int flock( + int fd, + int how + ); + } +33 AUE_MKNODAT STD { + int linux_mknodat( + l_int dfd, + const char *filename, + l_int mode, + l_uint dev + ); + } +34 AUE_MKDIRAT STD { + int linux_mkdirat( + l_int dfd, + const char *pathname, + l_int mode + ); + } +35 AUE_UNLINKAT STD { + int linux_unlinkat( + l_int dfd, + const char *pathname, + l_int flag + ); + } +36 AUE_SYMLINKAT STD { + int linux_symlinkat( + const char *oldname, + l_int newdfd, + const char *newname + ); + } +37 AUE_LINKAT STD { + int linux_linkat( + l_int olddfd, + const char *oldname, + l_int newdfd, + const char *newname, + l_int flag + ); + } +38 AUE_RENAMEAT STD { + int linux_renameat( + l_int olddfd, + const char *oldname, + l_int newdfd, + const char *newname + ); + } 39 AUE_NULL UNIMPL linux_umount2 -40 AUE_MOUNT STD { int linux_mount(char *specialfile, \ - char *dir, char *filesystemtype, \ - l_ulong rwflag, void *data); } -41 AUE_PIVOT_ROOT STD { int linux_pivot_root(void); } +40 AUE_MOUNT STD { + int linux_mount( + char *specialfile, + char *dir, + char *filesystemtype, + l_ulong rwflag, + void *data + ); + } +41 AUE_PIVOT_ROOT STD { + int linux_pivot_root(void); + } 42 AUE_NULL UNIMPL nfsservctl -43 AUE_STATFS STD { int linux_statfs(char *path, \ - struct l_statfs_buf *buf); } -44 AUE_FSTATFS STD { int linux_fstatfs(l_uint fd, \ - struct l_statfs_buf *buf); } -45 AUE_TRUNCATE STD { int linux_truncate(char *path, \ - l_ulong length); } -46 AUE_FTRUNCATE STD { int linux_ftruncate(l_int fd, \ - l_long length); } -47 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ - l_loff_t offset, l_loff_t len); } -48 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, \ - const char *filename, l_int amode); } -49 AUE_CHDIR STD { int linux_chdir(char *path); } -50 AUE_FCHDIR NOPROTO { int fchdir(int fd); } -51 AUE_CHROOT NOPROTO { int chroot(char *path); } -52 AUE_FCHMOD NOPROTO { int fchmod(int fd, int mode); } -53 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, \ - const char *filename, l_mode_t mode); } -54 AUE_FCHOWNAT STD { int linux_fchownat(l_int dfd, \ - const char *filename, l_uid_t uid, \ - l_gid_t gid, l_int flag); } -55 AUE_FCHOWN NOPROTO { int fchown(int fd, int uid, int gid); } -56 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, \ - const char *filename, l_int flags, \ - l_int mode); } -57 AUE_CLOSE NOPROTO { int close(int fd); } -58 AUE_NULL STD { int linux_vhangup(void); } -59 AUE_NULL STD { int linux_pipe2(l_int *pipefds, \ - l_int flags); } +43 AUE_STATFS STD { + int linux_statfs( + char *path, + struct l_statfs_buf *buf + ); + } +44 AUE_FSTATFS STD { + int linux_fstatfs( + l_uint fd, + struct l_statfs_buf *buf + ); + } +45 AUE_TRUNCATE STD { + int linux_truncate( + char *path, + l_ulong length + ); + } +46 AUE_FTRUNCATE STD { + int linux_ftruncate( + l_int fd, + l_long length + ); + } +47 AUE_NULL STD { + int linux_fallocate( + l_int fd, + l_int mode, + l_loff_t offset, + l_loff_t len + ); + } +48 AUE_FACCESSAT STD { + int linux_faccessat( + l_int dfd, + const char *filename, + l_int amode + ); + } +49 AUE_CHDIR STD { + int linux_chdir( + char *path + ); + } +50 AUE_FCHDIR NOPROTO { + int fchdir( + int fd); + } +51 AUE_CHROOT NOPROTO { + int chroot( + char *path + ); + } +52 AUE_FCHMOD NOPROTO { + int fchmod( + int fd, + int mode + ); + } +53 AUE_FCHMODAT STD { + int linux_fchmodat( + l_int dfd, + const char *filename, + l_mode_t mode + ); + } +54 AUE_FCHOWNAT STD { + int linux_fchownat( + l_int dfd, + const char *filename, + l_uid_t uid, + l_gid_t gid, + l_int flag + ); + } +55 AUE_FCHOWN NOPROTO { + int fchown( + int fd, + int uid, + int gid); + } +56 AUE_OPEN_RWTC STD { + int linux_openat( + l_int dfd, + const char *filename, + l_int flags, + l_int mode + ); + } +57 AUE_CLOSE NOPROTO { + int close( + int fd); + } +58 AUE_NULL STD { + int linux_vhangup(void); + } +59 AUE_NULL STD { + int linux_pipe2( + l_int *pipefds, + l_int flags + ); + } 60 AUE_NULL UNIMPL linux_quotactl -61 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ - void *dirent, l_uint count); } -62 AUE_LSEEK STD { int linux_lseek(l_uint fdes, l_off_t off, \ - l_int whence); } -63 AUE_NULL NOPROTO { int read(int fd, char *buf, \ - u_int nbyte); } -64 AUE_NULL NOPROTO { int write(int fd, char *buf, \ - u_int nbyte); } -65 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ - u_int iovcnt); } -66 AUE_WRITEV NOPROTO { int writev(int fd, struct iovec *iovp, \ - u_int iovcnt); } -67 AUE_PREAD STD { int linux_pread(l_uint fd, char *buf, \ - l_size_t nbyte, l_loff_t offset); } -68 AUE_PWRITE STD { int linux_pwrite(l_uint fd, char *buf, \ - l_size_t nbyte, l_loff_t offset); } -69 AUE_NULL STD { int linux_preadv(l_ulong fd, \ - struct iovec *vec, l_ulong vlen, \ - l_ulong pos_l, l_ulong pos_h); } -70 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ - struct iovec *vec, l_ulong vlen, \ - l_ulong pos_l, l_ulong pos_h); } -71 AUE_SENDFILE STD { int linux_sendfile(l_int out, l_int in, \ - l_long *offset, l_size_t count); } -72 AUE_SELECT STD { int linux_pselect6(l_int nfds, \ - l_fd_set *readfds, l_fd_set *writefds, \ - l_fd_set *exceptfds, \ - struct l_timespec *tsp, l_uintptr_t *sig); } -73 AUE_POLL STD { int linux_ppoll(struct pollfd *fds, \ - uint32_t nfds, struct l_timespec *tsp, \ - l_sigset_t *sset, l_size_t ssize); } -74 AUE_NULL STD { int linux_signalfd4(void); } -75 AUE_NULL STD { int linux_vmsplice(void); } -76 AUE_NULL STD { int linux_splice(void); } -77 AUE_NULL STD { int linux_tee(void); } -78 AUE_READLINKAT STD { int linux_readlinkat(l_int dfd, \ - const char *path, char *buf, \ - l_int bufsiz); } -79 AUE_FSTATAT STD { int linux_newfstatat(l_int dfd, \ - char *pathname, struct l_stat64 *statbuf, \ - l_int flag); } -80 AUE_FSTAT STD { int linux_newfstat(l_uint fd, \ - struct l_newstat *buf); } +61 AUE_GETDIRENTRIES STD { + int linux_getdents64( + l_uint fd, + void *dirent, + l_uint count + ); + } +62 AUE_LSEEK STD { + int linux_lseek( + l_uint fdes, + l_off_t off, + l_int whence + ); + } +63 AUE_NULL NOPROTO { + int read( + int fd, + char *buf, + u_int nbyte + ); + } +64 AUE_NULL NOPROTO { + int write( + int fd, + char *buf, + u_int nbyte + ); + } +65 AUE_READV NOPROTO { + int readv( + int fd, + struct iovec *iovp, + u_int iovcnt + ); + } +66 AUE_WRITEV NOPROTO { + int writev( + int fd, + struct iovec *iovp, + u_int iovcnt + ); + } +67 AUE_PREAD STD { + int linux_pread( + l_uint fd, + char *buf, + l_size_t nbyte, + l_loff_t offset + ); + } +68 AUE_PWRITE STD { + int linux_pwrite( + l_uint fd, + char *buf, + l_size_t nbyte, + l_loff_t offset + ); + } +69 AUE_NULL STD { + int linux_preadv( + l_ulong fd, + struct iovec *vec, + l_ulong vlen, + l_ulong pos_l, + l_ulong pos_h + ); + } +70 AUE_NULL STD { + int linux_pwritev( + l_ulong fd, + struct iovec *vec, + l_ulong vlen, + l_ulong pos_l, + l_ulong pos_h + ); + } +71 AUE_SENDFILE STD { + int linux_sendfile( + l_int out, + l_int in, + l_long *offset, + l_size_t count + ); + } +72 AUE_SELECT STD { + int linux_pselect6( + l_int nfds, + l_fd_set *readfds, + l_fd_set *writefds, + l_fd_set *exceptfds, + struct l_timespec *tsp, + l_uintptr_t *sig + ); + } +73 AUE_POLL STD { + int linux_ppoll( + struct pollfd *fds, + uint32_t nfds, + struct l_timespec *tsp, + l_sigset_t *sset, + l_size_t ssize + ); + } +74 AUE_NULL STD { + int linux_signalfd4(void); + } +75 AUE_NULL STD { + int linux_vmsplice(void); + } +76 AUE_NULL STD { + int linux_splice(void); + } +77 AUE_NULL STD { + int linux_tee(void); + } +78 AUE_READLINKAT STD { + int linux_readlinkat( + l_int dfd, + const char *path, + char *buf, + l_int bufsiz + ); + } +79 AUE_FSTATAT STD { + int linux_newfstatat( + l_int dfd, + char *pathname, + struct l_stat64 *statbuf, + l_int flag + ); + } +80 AUE_FSTAT STD { + int linux_newfstat( + l_uint fd, + struct l_newstat *buf + ); + } 81 AUE_NULL UNIMPL linux_sync -82 AUE_FSYNC NOPROTO { int fsync(int fd); } -83 AUE_NULL STD { int linux_fdatasync(l_uint fd); } -84 AUE_NULL STD { int linux_sync_file_range(void); } -85 AUE_NULL STD { int linux_timerfd_create(l_int clockid, \ - l_int flags); } -86 AUE_NULL STD { int linux_timerfd_settime(l_int fd, \ - l_int flags, \ - const struct l_itimerspec *new_value, \ - struct l_itimerspec *old_value); } -87 AUE_NULL STD { int linux_timerfd_gettime(l_int fd, \ - struct l_itimerspec *old_value); } -88 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, \ - const char *pathname, \ - const struct l_timespec *times, \ - l_int flags); } -89 AUE_ACCT NOPROTO { int acct(char *path); } -90 AUE_CAPGET STD { int linux_capget( \ - struct l_user_cap_header *hdrp, \ - struct l_user_cap_data *datap); } -91 AUE_CAPSET STD { int linux_capset( \ - struct l_user_cap_header *hdrp, \ - struct l_user_cap_data *datap); } -92 AUE_PERSONALITY STD { int linux_personality(l_uint per); } -93 AUE_EXIT STD { int linux_exit(int rval); } -94 AUE_EXIT STD { int linux_exit_group(int error_code); } -95 AUE_WAIT6 STD { int linux_waitid(l_int idtype, l_pid_t id, \ - l_siginfo_t *info, l_int options, \ - struct rusage *rusage); } -96 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } -97 AUE_NULL STD { int linux_unshare(void); } -98 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, \ - int val, struct l_timespec *timeout, \ - void *uaddr2, int val3); } -99 AUE_NULL STD { int linux_set_robust_list( \ - struct linux_robust_list_head *head, \ - l_size_t len); } -100 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ - struct linux_robust_list_head **head, \ - l_size_t *len); } -101 AUE_NULL STD { int linux_nanosleep( \ - const struct l_timespec *rqtp, \ - struct l_timespec *rmtp); } -102 AUE_GETITIMER STD { int linux_getitimer(l_int which, \ - struct l_itimerval *itv); } -103 AUE_SETITIMER STD { int linux_setitimer(l_int which, \ - struct l_itimerval *itv, \ - struct l_itimerval *oitv); } -104 AUE_NULL STD { int linux_kexec_load(void); } -105 AUE_NULL STD { int linux_init_module(void); } -106 AUE_NULL STD { int linux_delete_module(void); } -107 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ - struct sigevent *evp, l_timer_t *timerid); } -108 AUE_NULL STD { int linux_timer_gettime(l_timer_t timerid, \ - struct itimerspec *setting); } -109 AUE_NULL STD { int linux_timer_getoverrun( \ - l_timer_t timerid); } -110 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, \ - l_int flags, const struct itimerspec *new, \ - struct itimerspec *old); } -111 AUE_NULL STD { int linux_timer_delete(l_timer_t timerid); } -112 AUE_CLOCK_SETTIME STD { int linux_clock_settime( \ - clockid_t which, struct l_timespec *tp); } -113 AUE_NULL STD { int linux_clock_gettime(clockid_t which, \ - struct l_timespec *tp); } -114 AUE_NULL STD { int linux_clock_getres(clockid_t which, \ - struct l_timespec *tp); } -115 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, \ - int flags, struct l_timespec *rqtp, \ - struct l_timespec *rmtp); } -116 AUE_NULL STD { int linux_syslog(l_int type, char *buf, \ - l_int len); } -117 AUE_PTRACE STD { int linux_ptrace(l_long req, l_long pid, \ - l_ulong addr, l_ulong data); } -118 AUE_SCHED_SETPARAM STD { int linux_sched_setparam( \ - l_pid_t pid, struct sched_param *param); } -119 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ - l_pid_t pid, l_int policy, \ - struct sched_param *param); } -120 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ - l_pid_t pid); } -121 AUE_SCHED_GETPARAM STD { int linux_sched_getparam( \ - l_pid_t pid, struct sched_param *param); } -122 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid, \ - l_uint len, l_ulong *user_mask_ptr); } -123 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid, \ - l_uint len, l_ulong *user_mask_ptr); } -124 AUE_NULL NOPROTO { int sched_yield(void); } -125 AUE_SCHED_GET_PRIORITY_MAX STD { int linux_sched_get_priority_max(\ - l_int policy); } -126 AUE_SCHED_GET_PRIORITY_MIN STD { int linux_sched_get_priority_min(\ - l_int policy); } -127 AUE_SCHED_RR_GET_INTERVAL STD { int linux_sched_rr_get_interval( \ - l_pid_t pid, struct l_timespec *interval); } +82 AUE_FSYNC NOPROTO { + int fsync( + int fd); + } +83 AUE_NULL STD { + int linux_fdatasync( + l_uint fd); + } +84 AUE_NULL STD { + int linux_sync_file_range(void); + } +85 AUE_NULL STD { + int linux_timerfd_create( + l_int clockid, + l_int flags + ); + } +86 AUE_NULL STD { + int linux_timerfd_settime( + l_int fd, + l_int flags, + const struct l_itimerspec *new_value, + struct l_itimerspec *old_value + ); + } +87 AUE_NULL STD { + int linux_timerfd_gettime( + l_int fd, + struct l_itimerspec *old_value + ); + } +88 AUE_FUTIMESAT STD { + int linux_utimensat( + l_int dfd, + const char *pathname, + const struct l_timespec *times, + l_int flags + ); + } +89 AUE_ACCT NOPROTO { + int acct( + char *path + ); + } +90 AUE_CAPGET STD { + int linux_capget( + struct l_user_cap_header *hdrp, + struct l_user_cap_data *datap + ); + } +91 AUE_CAPSET STD { + int linux_capset( + struct l_user_cap_header *hdrp, + struct l_user_cap_data *datap + ); + } +92 AUE_PERSONALITY STD { + int linux_personality( + l_uint per + ); + } +93 AUE_EXIT STD { + int linux_exit( + int rval + ); + } +94 AUE_EXIT STD { + int linux_exit_group( + int error_code + ); + } +95 AUE_WAIT6 STD { + int linux_waitid( + l_int idtype, + l_pid_t id, + l_siginfo_t *info, + l_int options, + struct rusage *rusage + ); + } +96 AUE_NULL STD { + int linux_set_tid_address( + int *tidptr + ); + } +97 AUE_NULL STD { + int linux_unshare(void); + } +98 AUE_NULL STD { + int linux_sys_futex(void *uaddr, + int op, + int val, + struct l_timespec *timeout, + void *uaddr2, + int val3 + ); + } +99 AUE_NULL STD { + int linux_set_robust_list( + struct linux_robust_list_head *head, + l_size_t len + ); + } +100 AUE_NULL STD { + int linux_get_robust_list( + l_int pid, + struct linux_robust_list_head **head, + l_size_t *len + ); + } +101 AUE_NULL STD { + int linux_nanosleep( + const struct l_timespec *rqtp, + struct l_timespec *rmtp + ); + } +102 AUE_GETITIMER STD { + int linux_getitimer( + l_int which, + struct l_itimerval *itv + ); + } +103 AUE_SETITIMER STD { + int linux_setitimer( + l_int which, + struct l_itimerval *itv, + struct l_itimerval *oitv + ); + } +104 AUE_NULL STD { + int linux_kexec_load(void); + } +105 AUE_NULL STD { + int linux_init_module(void); + } +106 AUE_NULL STD { + int linux_delete_module(void); + } +107 AUE_NULL STD { + int linux_timer_create( + clockid_t clock_id, + struct sigevent *evp, + l_timer_t *timerid); + } +108 AUE_NULL STD { + int linux_timer_gettime( + l_timer_t timerid, + struct itimerspec *setting + ); + } +109 AUE_NULL STD { + int linux_timer_getoverrun( + l_timer_t timerid); + } +110 AUE_NULL STD { + int linux_timer_settime( + l_timer_t timerid, + l_int flags, + const struct itimerspec *new, + struct itimerspec *old); + } +111 AUE_NULL STD { + int linux_timer_delete( + l_timer_t timerid); + } +112 AUE_CLOCK_SETTIME STD { + int linux_clock_settime( + clockid_t which, + struct l_timespec *tp + ); + } +113 AUE_NULL STD { + int linux_clock_gettime( + clockid_t which, + struct l_timespec *tp + ); + } +114 AUE_NULL STD { + int linux_clock_getres( + clockid_t which, + struct l_timespec *tp + ); + } +115 AUE_NULL STD { + int linux_clock_nanosleep( + clockid_t which, + int flags, + struct l_timespec *rqtp, + struct l_timespec *rmtp + ); + } +116 AUE_NULL STD { + int linux_syslog( + l_int type, + char *buf, + l_int len + ); + } +117 AUE_PTRACE STD { + int linux_ptrace( + l_long req, + l_long pid, + l_ulong addr, + l_ulong data + ); + } +118 AUE_SCHED_SETPARAM STD { + int linux_sched_setparam( + l_pid_t pid, + struct sched_param *param + ); + } +119 AUE_SCHED_SETSCHEDULER STD { + int linux_sched_setscheduler( + l_pid_t pid, + l_int policy, + struct sched_param *param + ); + } +120 AUE_SCHED_GETSCHEDULER STD { + int linux_sched_getscheduler( + l_pid_t pid); + } +121 AUE_SCHED_GETPARAM STD { + int linux_sched_getparam( + l_pid_t pid, + struct sched_param *param + ); + } +122 AUE_NULL STD { + int linux_sched_setaffinity( + l_pid_t pid, + l_uint len, + l_ulong *user_mask_ptr + ); + } +123 AUE_NULL STD { + int linux_sched_getaffinity( + l_pid_t pid, + l_uint len, + l_ulong *user_mask_ptr + ); + } +124 AUE_NULL NOPROTO { + int sched_yield(void); + } +125 AUE_SCHED_GET_PRIORITY_MAX STD { + int linux_sched_get_priority_max( + \ + l_int policy + ); + } +126 AUE_SCHED_GET_PRIORITY_MIN STD { + int linux_sched_get_priority_min( + \ + l_int policy + ); + } +127 AUE_SCHED_RR_GET_INTERVAL STD { + int linux_sched_rr_get_interval( + l_pid_t pid, + struct l_timespec *interval + ); + } 128 AUE_NULL UNIMPL restart_syscall -129 AUE_KILL STD { int linux_kill(l_int pid, l_int signum); } -130 AUE_NULL STD { int linux_tkill(l_int tid, l_int sig); } -131 AUE_NULL STD { int linux_tgkill(l_int tgid, l_int pid, \ - l_int sig); } -132 AUE_NULL STD { int linux_sigaltstack(l_stack_t *uss, \ - l_stack_t *uoss); } -133 AUE_NULL STD { int linux_rt_sigsuspend( \ - l_sigset_t *newset, \ - l_size_t sigsetsize); } -134 AUE_NULL STD { int linux_rt_sigaction(l_int sig, \ - l_sigaction_t *act, l_sigaction_t *oact, \ - l_size_t sigsetsize); } -135 AUE_NULL STD { int linux_rt_sigprocmask(l_int how, \ - l_sigset_t *mask, l_sigset_t *omask, \ - l_size_t sigsetsize); } -136 AUE_NULL STD { int linux_rt_sigpending(l_sigset_t *set, \ - l_size_t sigsetsize); } -137 AUE_NULL STD { int linux_rt_sigtimedwait(l_sigset_t *mask, \ - l_siginfo_t *ptr, \ - struct l_timeval *timeout, \ - l_size_t sigsetsize); } -138 AUE_NULL STD { int linux_rt_sigqueueinfo(l_pid_t pid, \ - l_int sig, l_siginfo_t *info); } -139 AUE_NULL STD { int linux_rt_sigreturn( \ - struct l_ucontext *ucp); } -140 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ - int prio); } -141 AUE_GETPRIORITY STD { int linux_getpriority(l_int which, \ - l_int who); } -142 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ - l_int magic2, l_uint cmd, void *arg); } -143 AUE_SETREGID NOPROTO { int setregid(gid_t rgid, gid_t egid); } -144 AUE_SETGID NOPROTO { int setgid(gid_t gid); } -145 AUE_SETREUID NOPROTO { int setreuid(uid_t ruid, uid_t euid); } -146 AUE_SETUID NOPROTO { int setuid(uid_t uid); } -147 AUE_SETRESUID NOPROTO { int setresuid(uid_t ruid, uid_t euid, \ - uid_t suid); } -148 AUE_GETRESUID NOPROTO { int getresuid(uid_t *ruid, uid_t *euid, \ - uid_t *suid); } -149 AUE_SETRESGID NOPROTO { int setresgid(gid_t rgid, gid_t egid, \ - gid_t sgid); } -150 AUE_GETRESGID NOPROTO { int getresgid(gid_t *rgid, gid_t *egid, \ - gid_t *sgid); } -151 AUE_SETFSUID STD { int linux_setfsuid(l_uid_t uid); } -152 AUE_SETFSGID STD { int linux_setfsgid(l_gid_t gid); } -153 AUE_NULL STD { int linux_times(struct l_times_argv *buf); } -154 AUE_SETPGRP NOPROTO { int setpgid(int pid, int pgid); } -155 AUE_GETPGID NOPROTO { int getpgid(int pid); } -156 AUE_GETSID STD { int linux_getsid(l_pid_t pid); } -157 AUE_SETSID NOPROTO { int setsid(void); } -158 AUE_GETGROUPS STD { int linux_getgroups(l_int gidsetsize, \ - l_gid_t *grouplist); } -159 AUE_SETGROUPS STD { int linux_setgroups(l_int gidsetsize, \ - l_gid_t *grouplist); } -160 AUE_NULL STD { int linux_newuname( \ - struct l_new_utsname *buf); } -161 AUE_SYSCTL STD { int linux_sethostname(char *hostname, \ - l_uint len); } -162 AUE_SYSCTL STD { int linux_setdomainname(char *name, \ - l_int len); } -163 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \ - struct l_rlimit *rlim); } -164 AUE_SETRLIMIT STD { int linux_setrlimit(l_uint resource, \ - struct l_rlimit *rlim); } -165 AUE_GETRUSAGE NOPROTO { int getrusage(int who, \ - struct rusage *rusage); } -166 AUE_UMASK NOPROTO { int umask(int newmask); } -167 AUE_PRCTL STD { int linux_prctl(l_int option, \ - l_uintptr_t arg2, l_uintptr_t arg3, \ - l_uintptr_t arg4, l_uintptr_t arg5); } -168 AUE_NULL STD { int linux_getcpu(l_uint *cpu, l_uint *node, \ - void *cache); } -169 AUE_NULL NOPROTO { int gettimeofday(struct l_timeval *tp, \ - struct timezone *tzp); } -170 AUE_SETTIMEOFDAY NOPROTO { int settimeofday( \ - struct l_timeval *tv, \ - struct timezone *tzp); } -171 AUE_ADJTIME STD { int linux_adjtimex(void); } -172 AUE_GETPID STD { int linux_getpid(void); } -173 AUE_GETPPID STD { int linux_getppid(void); } -174 AUE_GETUID STD { int linux_getuid(void); } -175 AUE_GETEUID NOPROTO { int geteuid(void); } -176 AUE_GETGID STD { int linux_getgid(void); } -177 AUE_GETEGID NOPROTO { int getegid(void); } -178 AUE_NULL STD { int linux_gettid(void); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 6 16:10:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BCA3158E8C5; Mon, 6 May 2019 16:10:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43D4475E21; Mon, 6 May 2019 16:10:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21843917D; Mon, 6 May 2019 16:10:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46GARb3003838; Mon, 6 May 2019 16:10:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46GAR3b003837; Mon, 6 May 2019 16:10:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905061610.x46GAR3b003837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 May 2019 16:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347187 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 347187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 43D4475E21 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.916,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 16:10:27 -0000 Author: hselasky Date: Mon May 6 16:10:26 2019 New Revision: 347187 URL: https://svnweb.freebsd.org/changeset/base/347187 Log: Implement print_hex_dump_debug() function macro in the LinuxKPI. Build tested drm-current-kmod prior to commit. MFC after: 1 week Submitted by: slavash@ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/printk.h Modified: head/sys/compat/linuxkpi/common/include/linux/printk.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/printk.h Mon May 6 16:07:14 2019 (r347186) +++ head/sys/compat/linuxkpi/common/include/linux/printk.h Mon May 6 16:10:26 2019 (r347187) @@ -121,6 +121,9 @@ print_hex_dump_bytes(const char *prefix_str, const int #define pr_err_ratelimited(fmt, ...) \ printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) +#define print_hex_dump_debug(...) \ + print_hex_dump(KERN_DEBUG, ##__VA_ARGS__) + #define pr_info_ratelimited(fmt, ...) \ printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) From owner-svn-src-all@freebsd.org Mon May 6 16:17:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0124158EB0C; Mon, 6 May 2019 16:17:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DD1E7632D; Mon, 6 May 2019 16:17:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f42.google.com with SMTP id m7so9322219ioa.6; Mon, 06 May 2019 09:17:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=h7+6W6lOJwQKo7XLx9uRGTFWJNW2jDBaX3aJA+cOZG0=; b=UoC5yW69byHgr8+TMmJIHLQdhGIhnCQD754Aff3EwfJlumwLgW3/MSuA9hdajmPDuB TqU+RbEmNbD8OHHlVJiER9qGBkrMFlvxM+7qtRogXPUDQxfO/cRC2O15srxbl+jUPdSo xTz9frtN3Sn5R7x0s2akON3ARhtJ56FSfm8hNZ0cWVpom3MPrEH9wVnsdy4dVyZ0fZ7/ JsXxkU9CVYphTZw1ySjoiszlBIw9R7NNRuEXwPEmMxmW41h6zic75ubJsNsPNuxmM5lW 7Um/Sp95jG717pkRIGS7fSEKlmwig3uxWVRwemVlyt5kJDXH4kXiYp3alYfkN8biq6G0 ZATg== X-Gm-Message-State: APjAAAWg7YQWxazcBFWjFT1DOQlstKmQwdStLkI+R+RUriHY9G2AD6pm ZsXxTQy307APE20AcAYDvCkk3sZjPrLWihY5J8gZIw== X-Google-Smtp-Source: APXvYqylFRCglHDWiWyeuTrzhnxtSwtYVPTSP65Ehde3X30Aw5pKQBGJ7c2IH1nbpx/b+xlCi02peUV7Hjka8SMvPJ8= X-Received: by 2002:a05:6602:21d7:: with SMTP id c23mr6886840ioc.66.1557158972110; Mon, 06 May 2019 09:09:32 -0700 (PDT) MIME-Version: 1.0 References: <201905061607.x46G7E5n003614@repo.freebsd.org> In-Reply-To: <201905061607.x46G7E5n003614@repo.freebsd.org> From: Ed Maste Date: Sun, 5 May 2019 23:58:18 -0400 Message-ID: Subject: Re: svn commit: r347186 - head/sys/arm64/linux To: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7DD1E7632D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.91)[-0.908,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 16:17:27 -0000 On Mon, 6 May 2019 at 12:07, Ed Maste wrote: > > Author: emaste > Date: Mon May 6 16:07:14 2019 > New Revision: 347186 > URL: https://svnweb.freebsd.org/changeset/base/347186 > > Log: > Reformat arm64 linux syscalls.master per current style > > Equivalent to r339958 for sys/kern/syscalls.master. Reviewed by: dchagin From owner-svn-src-all@freebsd.org Mon May 6 16:17:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CF1B158EB35; Mon, 6 May 2019 16:17:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4AAD76433; Mon, 6 May 2019 16:17:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E3719322; Mon, 6 May 2019 16:17:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46GHcx8009092; Mon, 6 May 2019 16:17:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46GHcT0009091; Mon, 6 May 2019 16:17:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905061617.x46GHcT0009091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 May 2019 16:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347188 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 347188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4AAD76433 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 16:17:39 -0000 Author: hselasky Date: Mon May 6 16:17:38 2019 New Revision: 347188 URL: https://svnweb.freebsd.org/changeset/base/347188 Log: Disabling a PCI device should only disable busmaster in the LinuxKPI. As Linux comment for this function point: Signal to the system that the PCI device is not in use by the system anymore. This only involves disabling PCI bus-mastering, if active. Build tested drm-current-kmod prior to commit. MFC after: 1 week Submitted by: slavash@ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 6 16:10:26 2019 (r347187) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 6 16:17:38 2019 (r347188) @@ -353,8 +353,6 @@ static inline void pci_disable_device(struct pci_dev *pdev) { - pci_disable_io(pdev->dev.bsddev, SYS_RES_IOPORT); - pci_disable_io(pdev->dev.bsddev, SYS_RES_MEMORY); pci_disable_busmaster(pdev->dev.bsddev); } From owner-svn-src-all@freebsd.org Mon May 6 16:22:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CA99158F0DD; Mon, 6 May 2019 16:22:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39E0676B64; Mon, 6 May 2019 16:22:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FEC894E0; Mon, 6 May 2019 16:22:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46GMj7I014189; Mon, 6 May 2019 16:22:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46GMjHt014188; Mon, 6 May 2019 16:22:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905061622.x46GMjHt014188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 May 2019 16:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347190 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 347190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 39E0676B64 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 16:22:46 -0000 Author: hselasky Date: Mon May 6 16:22:45 2019 New Revision: 347190 URL: https://svnweb.freebsd.org/changeset/base/347190 Log: Use PCIV_INVALID in pci_channel_offline() in the LinuxKPI. Build tested drm-current-kmod prior to commit. MFC after: 1 week Submitted by: slavash@ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 6 16:17:55 2019 (r347189) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 6 16:22:45 2019 (r347190) @@ -614,7 +614,7 @@ static inline int pci_channel_offline(struct pci_dev *pdev) { - return (pci_get_vendor(pdev->dev.bsddev) == 0xffff); + return (pci_get_vendor(pdev->dev.bsddev) == PCIV_INVALID); } static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) From owner-svn-src-all@freebsd.org Mon May 6 18:05:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CB021590FEC; Mon, 6 May 2019 18:05:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32D6081BC5; Mon, 6 May 2019 18:05:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 9362B1611A; Mon, 6 May 2019 18:05:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r347180 - head/sys/vm To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905060846.x468kCuf072276@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <31741ddb-710e-c6b9-c244-fad6725f4ed6@FreeBSD.org> Date: Mon, 6 May 2019 11:05:11 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905060846.x468kCuf072276@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 32D6081BC5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.926,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 18:05:14 -0000 On 5/6/19 1:46 AM, Konstantin Belousov wrote: > Author: kib > Date: Mon May 6 08:46:11 2019 > New Revision: 347180 > URL: https://svnweb.freebsd.org/changeset/base/347180 > > Log: > Noted by: alc > Reviewed by: alc, markj (previous version) > Sponsored by: The FreeBSD Foundation > MFC after: 6 days Did the log message get lost? -- John Baldwin From owner-svn-src-all@freebsd.org Mon May 6 18:07:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AA111591154; Mon, 6 May 2019 18:07:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA14F81F1F; Mon, 6 May 2019 18:07:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 1D4F21611B; Mon, 6 May 2019 18:07:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r347063 - head/sys/kern To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905032126.x43LQilu092655@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> Date: Mon, 6 May 2019 11:07:18 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905032126.x43LQilu092655@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: CA14F81F1F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 18:07:21 -0000 On 5/3/19 2:26 PM, Mark Johnston wrote: > Author: markj > Date: Fri May 3 21:26:44 2019 > New Revision: 347063 > URL: https://svnweb.freebsd.org/changeset/base/347063 > > Log: > Disallow excessively small times of day in clock_settime(2). > > Reported by: syzkaller > Reviewed by: cem, kib > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D20151 > > Modified: > head/sys/kern/kern_time.c > > Modified: head/sys/kern/kern_time.c > ============================================================================== > --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 (r347062) > +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 (r347063) > @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t clock_ > if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || > ats->tv_sec < 0) > return (EINVAL); > - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60) > + if (!allow_insane_settime && > + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || > + ats->tv_sec < utc_offset())) > return (EINVAL); > /* XXX Don't convert nsec->usec and back */ > TIMESPEC_TO_TIMEVAL(&atv, ats); Pardon my ignorance, but I can't see why you are checking against utc_offset() vs some small constant? None of the discussion in the review mentioned the reason for using this particular value, and I didn't see any comparisons against utc_offset or kernadjtz in kern_clock_setttime() or settime() that would have underflowed or panicked. Can you give a bit more detail on why utc_offset() is the lower bound? Thanks. -- John Baldwin From owner-svn-src-all@freebsd.org Mon May 6 18:24:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D397915918A5; Mon, 6 May 2019 18:24:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8022B82DB3; Mon, 6 May 2019 18:24:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41F3CA978; Mon, 6 May 2019 18:24:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46IO9Cu077013; Mon, 6 May 2019 18:24:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46IO7uQ077004; Mon, 6 May 2019 18:24:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905061824.x46IO7uQ077004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 6 May 2019 18:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347192 - in head: sbin/dumpon sys/dev/null sys/geom sys/geom/raid sys/kern sys/netinet/netdump sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sbin/dumpon sys/dev/null sys/geom sys/geom/raid sys/kern sys/netinet/netdump sys/sys X-SVN-Commit-Revision: 347192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8022B82DB3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 18:24:10 -0000 Author: cem Date: Mon May 6 18:24:07 2019 New Revision: 347192 URL: https://svnweb.freebsd.org/changeset/base/347192 Log: List-ify kernel dump device configuration Allow users to specify multiple dump configurations in a prioritized list. This enables fallback to secondary device(s) if primary dump fails. E.g., one might configure a preference for netdump, but fallback to disk dump as a second choice if netdump is unavailable. This change does not list-ify netdump configuration, which is tracked separately from ordinary disk dumps internally; only one netdump configuration can be made at a time, for now. It also does not implement IPv6 netdump. savecore(8) is already capable of scanning and iterating multiple devices from /etc/fstab or passed on the command line. This change doesn't update the rc or loader variables 'dumpdev' in any way; it can still be set to configure a single dump device, and rc.d/savecore still uses it as a single device. Only dumpon(8) is updated to be able to configure the more complicated configurations for now. As part of revving the ABI, unify netdump and disk dump configuration ioctl / structure, and leave room for ipv6 netdump as a future possibility. Backwards-compatibility ioctls are added to smooth ABI transition, especially for developers who may not keep kernel and userspace perfectly synced. Reviewed by: markj, scottl (earlier version) Relnotes: maybe Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19996 Modified: head/sbin/dumpon/dumpon.8 head/sbin/dumpon/dumpon.c head/sys/dev/null/null.c head/sys/geom/geom_dev.c head/sys/geom/raid/g_raid.h head/sys/kern/kern_shutdown.c head/sys/netinet/netdump/netdump.h head/sys/netinet/netdump/netdump_client.c head/sys/sys/conf.h head/sys/sys/disk.h head/sys/sys/param.h Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Mon May 6 16:54:35 2019 (r347191) +++ head/sbin/dumpon/dumpon.8 Mon May 6 18:24:07 2019 (r347192) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd November 17, 2018 +.Dd May 6, 2019 .Dt DUMPON 8 .Os .Sh NAME @@ -36,12 +36,16 @@ .Nd "specify a device for crash dumps" .Sh SYNOPSIS .Nm +.Op Fl i Ar index +.Op Fl r .Op Fl v .Op Fl k Ar pubkey .Op Fl Z .Op Fl z .Ar device .Nm +.Op Fl i Ar index +.Op Fl r .Op Fl v .Op Fl k Ar pubkey .Op Fl Z @@ -72,8 +76,38 @@ and .Va dumpon_flags . For more information on this usage, see .Xr rc.conf 5 . +.Pp +Starting in +.Fx 13.0 , +.Nm +can configure a series of fallback dump devices. +For example, an administrator may prefer +.Xr netdump 4 +by default, but if the +.Xr netdump 4 +service cannot be reached or some other failure occurs, they might choose a +local disk dump as a second choice option. .Ss General options .Bl -tag -width _k_pubkey +.It Fl i Ar index +Insert the specified dump configuration into the prioritized fallback dump +device list at the specified index, starting at zero. +.Pp +If +.Fl i +is not specified, the configured dump device is appended to the prioritized +list. +.It Fl r +Remove the specified dump device configuration or configurations from the +fallback dump device list rather than inserting or appending it. +In contrast, +.Do +.Nm +off +.Dc +removes all configured devices. +Conflicts with +.Fl i . .It Fl k Ar pubkey Configure encrypted kernel dumps. .Pp @@ -96,7 +130,7 @@ The .Va pubkey file should be a PEM-formatted RSA key of at least 1024 bits. .It Fl l -List the currently configured dump device, or /dev/null if no device is +List the currently configured dump device(s), or /dev/null if no devices are configured. .It Fl v Enable verbose mode. Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Mon May 6 16:54:35 2019 (r347191) +++ head/sbin/dumpon/dumpon.c Mon May 6 18:24:07 2019 (r347192) @@ -86,8 +86,8 @@ static void _Noreturn usage(void) { fprintf(stderr, - "usage: dumpon [-v] [-k ] [-Zz] \n" - " dumpon [-v] [-k ] [-Zz]\n" + "usage: dumpon [-i index] [-r] [-v] [-k ] [-Zz] \n" + " dumpon [-i index] [-r] [-v] [-k ] [-Zz]\n" " [-g ] -s -c \n" " dumpon [-v] off\n" " dumpon [-v] -l\n"); @@ -290,8 +290,10 @@ genkey(const char *pubkeyfile, struct diocskerneldump_ static void listdumpdev(void) { + static char ip[200]; + char dumpdev[PATH_MAX]; - struct netdump_conf ndconf; + struct diocskerneldump_arg ndconf; size_t len; const char *sysctlname = "kern.shutdown.dumpdevname"; int fd; @@ -308,10 +310,18 @@ listdumpdev(void) if (strlen(dumpdev) == 0) (void)strlcpy(dumpdev, _PATH_DEVNULL, sizeof(dumpdev)); - if (verbose) - printf("kernel dumps on "); - printf("%s\n", dumpdev); + if (verbose) { + char *ctx, *dd; + unsigned idx; + printf("kernel dumps on priority: device\n"); + idx = 0; + ctx = dumpdev; + while ((dd = strsep(&ctx, ",")) != NULL) + printf("%u: %s\n", idx++, dd); + } else + printf("%s\n", dumpdev); + /* If netdump is enabled, print the configuration parameters. */ if (verbose) { fd = open(_PATH_NETDUMP, O_RDONLY); @@ -320,16 +330,22 @@ listdumpdev(void) err(EX_OSERR, "opening %s", _PATH_NETDUMP); return; } - if (ioctl(fd, NETDUMPGCONF, &ndconf) != 0) { + if (ioctl(fd, DIOCGKERNELDUMP, &ndconf) != 0) { if (errno != ENXIO) - err(EX_OSERR, "ioctl(NETDUMPGCONF)"); + err(EX_OSERR, "ioctl(DIOCGKERNELDUMP)"); (void)close(fd); return; } - printf("server address: %s\n", inet_ntoa(ndconf.ndc_server)); - printf("client address: %s\n", inet_ntoa(ndconf.ndc_client)); - printf("gateway address: %s\n", inet_ntoa(ndconf.ndc_gateway)); + printf("server address: %s\n", + inet_ntop(ndconf.kda_af, &ndconf.kda_server, ip, + sizeof(ip))); + printf("client address: %s\n", + inet_ntop(ndconf.kda_af, &ndconf.kda_client, ip, + sizeof(ip))); + printf("gateway address: %s\n", + inet_ntop(ndconf.kda_af, &ndconf.kda_gateway, ip, + sizeof(ip))); (void)close(fd); } } @@ -359,19 +375,20 @@ int main(int argc, char *argv[]) { char dumpdev[PATH_MAX]; - struct diocskerneldump_arg _kda, *kdap; - struct netdump_conf ndconf; + struct diocskerneldump_arg ndconf, *kdap; struct addrinfo hints, *res; const char *dev, *pubkeyfile, *server, *client, *gateway; int ch, error, fd; - bool enable, gzip, list, netdump, zstd; + bool gzip, list, netdump, zstd, insert, rflag; + uint8_t ins_idx; - gzip = list = netdump = zstd = false; + gzip = list = netdump = zstd = insert = rflag = false; kdap = NULL; pubkeyfile = NULL; server = client = gateway = NULL; + ins_idx = KDA_APPEND; - while ((ch = getopt(argc, argv, "c:g:k:ls:vZz")) != -1) + while ((ch = getopt(argc, argv, "c:g:i:k:lrs:vZz")) != -1) switch ((char)ch) { case 'c': client = optarg; @@ -379,12 +396,28 @@ main(int argc, char *argv[]) case 'g': gateway = optarg; break; + case 'i': + { + int i; + + i = atoi(optarg); + if (i < 0 || i >= KDA_APPEND - 1) + errx(EX_USAGE, + "-i index must be between zero and %d.", + (int)KDA_APPEND - 2); + insert = true; + ins_idx = i; + } + break; case 'k': pubkeyfile = optarg; break; case 'l': list = true; break; + case 'r': + rflag = true; + break; case 's': server = optarg; break; @@ -404,6 +437,9 @@ main(int argc, char *argv[]) if (gzip && zstd) errx(EX_USAGE, "The -z and -Z options are mutually exclusive."); + if (insert && rflag) + errx(EX_USAGE, "The -i and -r options are mutually exclusive."); + argc -= optind; argv += optind; @@ -422,31 +458,30 @@ main(int argc, char *argv[]) #endif if (server != NULL && client != NULL) { - enable = true; dev = _PATH_NETDUMP; netdump = true; - kdap = &ndconf.ndc_kda; } else if (server == NULL && client == NULL && argc > 0) { - enable = strcmp(argv[0], "off") != 0; - dev = enable ? argv[0] : _PATH_DEVNULL; + if (strcmp(argv[0], "off") == 0) { + rflag = true; + dev = _PATH_DEVNULL; + } else + dev = argv[0]; netdump = false; - kdap = &_kda; } else usage(); fd = opendumpdev(dev, dumpdev); - if (!netdump && !gzip) + if (!netdump && !gzip && !rflag) check_size(fd, dumpdev); + kdap = &ndconf; bzero(kdap, sizeof(*kdap)); - kdap->kda_enable = 0; - if (ioctl(fd, DIOCSKERNELDUMP, kdap) != 0) - err(EX_OSERR, "ioctl(DIOCSKERNELDUMP)"); - if (!enable) - exit(EX_OK); - explicit_bzero(kdap, sizeof(*kdap)); - kdap->kda_enable = 1; + if (rflag) + kdap->kda_index = KDA_REMOVE; + else + kdap->kda_index = ins_idx; + kdap->kda_compression = KERNELDUMP_COMP_NONE; if (zstd) kdap->kda_compression = KERNELDUMP_COMP_ZSTD; @@ -467,12 +502,12 @@ main(int argc, char *argv[]) ((struct sockaddr_in *)(void *)res->ai_addr)->sin_addr); freeaddrinfo(res); - if (strlcpy(ndconf.ndc_iface, argv[0], - sizeof(ndconf.ndc_iface)) >= sizeof(ndconf.ndc_iface)) + if (strlcpy(ndconf.kda_iface, argv[0], + sizeof(ndconf.kda_iface)) >= sizeof(ndconf.kda_iface)) errx(EX_USAGE, "invalid interface name '%s'", argv[0]); - if (inet_aton(server, &ndconf.ndc_server) == 0) + if (inet_aton(server, &ndconf.kda_server.in4) == 0) errx(EX_USAGE, "invalid server address '%s'", server); - if (inet_aton(client, &ndconf.ndc_client) == 0) + if (inet_aton(client, &ndconf.kda_client.in4) == 0) errx(EX_USAGE, "invalid client address '%s'", client); if (gateway == NULL) { @@ -485,39 +520,41 @@ main(int argc, char *argv[]) gateway = server; } } - if (inet_aton(gateway, &ndconf.ndc_gateway) == 0) + if (inet_aton(gateway, &ndconf.kda_gateway.in4) == 0) errx(EX_USAGE, "invalid gateway address '%s'", gateway); + ndconf.kda_af = AF_INET; + } #ifdef HAVE_CRYPTO - if (pubkeyfile != NULL) - genkey(pubkeyfile, kdap); + if (pubkeyfile != NULL) + genkey(pubkeyfile, kdap); #endif - error = ioctl(fd, NETDUMPSCONF, &ndconf); - if (error != 0) - error = errno; - explicit_bzero(kdap->kda_encryptedkey, - kdap->kda_encryptedkeysize); - free(kdap->kda_encryptedkey); - explicit_bzero(kdap, sizeof(*kdap)); - if (error != 0) - errc(EX_OSERR, error, "ioctl(NETDUMPSCONF)"); - } else { -#ifdef HAVE_CRYPTO - if (pubkeyfile != NULL) - genkey(pubkeyfile, kdap); -#endif - error = ioctl(fd, DIOCSKERNELDUMP, kdap); - if (error != 0) - error = errno; - explicit_bzero(kdap->kda_encryptedkey, - kdap->kda_encryptedkeysize); - free(kdap->kda_encryptedkey); - explicit_bzero(kdap, sizeof(*kdap)); - if (error != 0) - errc(EX_OSERR, error, "ioctl(DIOCSKERNELDUMP)"); + error = ioctl(fd, DIOCSKERNELDUMP, kdap); + if (error != 0) + error = errno; + explicit_bzero(kdap->kda_encryptedkey, kdap->kda_encryptedkeysize); + free(kdap->kda_encryptedkey); + explicit_bzero(kdap, sizeof(*kdap)); + if (error != 0) { + if (netdump) { + /* + * Be slightly less user-hostile for some common + * errors, especially as users don't have any great + * discoverability into which NICs support netdump. + */ + if (error == ENXIO) + errx(EX_OSERR, "Unable to configure netdump " + "because the interface's link is down."); + else if (error == ENODEV) + errx(EX_OSERR, "Unable to configure netdump " + "because the interface driver does not yet " + "support netdump."); + } + errc(EX_OSERR, error, "ioctl(DIOCSKERNELDUMP)"); } + if (verbose) - printf("kernel dumps on %s\n", dumpdev); + listdumpdev(); exit(EX_OK); } Modified: head/sys/dev/null/null.c ============================================================================== --- head/sys/dev/null/null.c Mon May 6 16:54:35 2019 (r347191) +++ head/sys/dev/null/null.c Mon May 6 18:24:07 2019 (r347192) @@ -106,15 +106,26 @@ static int null_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data __unused, int flags __unused, struct thread *td) { + struct diocskerneldump_arg kda; int error; error = 0; switch (cmd) { #ifdef COMPAT_FREEBSD11 case DIOCSKERNELDUMP_FREEBSD11: + gone_in(13, "FreeBSD 11.x ABI compat"); + /* FALLTHROUGH */ #endif +#ifdef COMPAT_FREEBSD12 + case DIOCSKERNELDUMP_FREEBSD12: + if (cmd == DIOCSKERNELDUMP_FREEBSD12) + gone_in(14, "FreeBSD 12.x ABI compat"); + /* FALLTHROUGH */ +#endif case DIOCSKERNELDUMP: - error = clear_dumper(td); + bzero(&kda, sizeof(kda)); + kda.kda_index = KDA_REMOVE_ALL; + error = dumper_remove(NULL, &kda); break; case FIONBIO: break; Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Mon May 6 16:54:35 2019 (r347191) +++ head/sys/geom/geom_dev.c Mon May 6 18:24:07 2019 (r347192) @@ -135,15 +135,14 @@ g_dev_fini(struct g_class *mp) } static int -g_dev_setdumpdev(struct cdev *dev, struct diocskerneldump_arg *kda, - struct thread *td) +g_dev_setdumpdev(struct cdev *dev, struct diocskerneldump_arg *kda) { struct g_kerneldump kd; struct g_consumer *cp; int error, len; - if (dev == NULL || kda == NULL) - return (clear_dumper(td)); + MPASS(dev != NULL && kda != NULL); + MPASS(kda->kda_index != KDA_REMOVE); cp = dev->si_drv2; len = sizeof(kd); @@ -154,9 +153,7 @@ g_dev_setdumpdev(struct cdev *dev, struct diocskerneld if (error != 0) return (error); - error = set_dumper(&kd.di, devtoname(dev), td, kda->kda_compression, - kda->kda_encryption, kda->kda_key, kda->kda_encryptedkeysize, - kda->kda_encryptedkey); + error = dumper_insert(&kd.di, devtoname(dev), kda); if (error == 0) dev->si_flags |= SI_DUMPDEV; @@ -173,7 +170,7 @@ init_dumpdev(struct cdev *dev) size_t len; bzero(&kda, sizeof(kda)); - kda.kda_enable = 1; + kda.kda_index = KDA_APPEND; if (dumpdev == NULL) return (0); @@ -190,7 +187,7 @@ init_dumpdev(struct cdev *dev) if (error != 0) return (error); - error = g_dev_setdumpdev(dev, &kda, curthread); + error = g_dev_setdumpdev(dev, &kda); if (error == 0) { freeenv(dumpdev); dumpdev = NULL; @@ -509,6 +506,9 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data struct g_provider *pp; off_t offset, length, chunk, odd; int i, error; +#ifdef COMPAT_FREEBSD12 + struct diocskerneldump_arg kda_copy; +#endif cp = dev->si_drv2; pp = cp->provider; @@ -547,31 +547,55 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data { struct diocskerneldump_arg kda; + gone_in(13, "FreeBSD 11.x ABI compat"); + bzero(&kda, sizeof(kda)); kda.kda_encryption = KERNELDUMP_ENC_NONE; - kda.kda_enable = (uint8_t)*(u_int *)data; - if (kda.kda_enable == 0) - error = g_dev_setdumpdev(NULL, NULL, td); + kda.kda_index = (*(u_int *)data ? 0 : KDA_REMOVE_ALL); + if (kda.kda_index == KDA_REMOVE_ALL) + error = dumper_remove(devtoname(dev), &kda); else - error = g_dev_setdumpdev(dev, &kda, td); + error = g_dev_setdumpdev(dev, &kda); break; } #endif +#ifdef COMPAT_FREEBSD12 + case DIOCSKERNELDUMP_FREEBSD12: + { + struct diocskerneldump_arg_freebsd12 *kda12; + + gone_in(14, "FreeBSD 12.x ABI compat"); + + kda12 = (void *)data; + memcpy(&kda_copy, kda12, sizeof(kda_copy)); + kda_copy.kda_index = (kda12->kda12_enable ? + 0 : KDA_REMOVE_ALL); + + explicit_bzero(kda12, sizeof(*kda12)); + /* Kludge to pass kda_copy to kda in fallthrough. */ + data = (void *)&kda_copy; + } + /* FALLTHROUGH */ +#endif case DIOCSKERNELDUMP: { struct diocskerneldump_arg *kda; uint8_t *encryptedkey; kda = (struct diocskerneldump_arg *)data; - if (kda->kda_enable == 0) { - error = g_dev_setdumpdev(NULL, NULL, td); + if (kda->kda_index == KDA_REMOVE_ALL || + kda->kda_index == KDA_REMOVE_DEV || + kda->kda_index == KDA_REMOVE) { + error = dumper_remove(devtoname(dev), kda); + explicit_bzero(kda, sizeof(*kda)); break; } if (kda->kda_encryption != KERNELDUMP_ENC_NONE) { - if (kda->kda_encryptedkeysize <= 0 || + if (kda->kda_encryptedkeysize == 0 || kda->kda_encryptedkeysize > KERNELDUMP_ENCKEY_MAX_SIZE) { + explicit_bzero(kda, sizeof(*kda)); return (EINVAL); } encryptedkey = malloc(kda->kda_encryptedkeysize, M_TEMP, @@ -583,7 +607,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data } if (error == 0) { kda->kda_encryptedkey = encryptedkey; - error = g_dev_setdumpdev(dev, kda, td); + error = g_dev_setdumpdev(dev, kda); } if (encryptedkey != NULL) { explicit_bzero(encryptedkey, kda->kda_encryptedkeysize); @@ -859,8 +883,13 @@ g_dev_orphan(struct g_consumer *cp) g_trace(G_T_TOPOLOGY, "g_dev_orphan(%p(%s))", cp, cp->geom->name); /* Reset any dump-area set on this device */ - if (dev->si_flags & SI_DUMPDEV) - (void)clear_dumper(curthread); + if (dev->si_flags & SI_DUMPDEV) { + struct diocskerneldump_arg kda; + + bzero(&kda, sizeof(kda)); + kda.kda_index = KDA_REMOVE_DEV; + (void)dumper_remove(devtoname(dev), &kda); + } /* Destroy the struct cdev *so we get no more requests */ delist_dev(dev); Modified: head/sys/geom/raid/g_raid.h ============================================================================== --- head/sys/geom/raid/g_raid.h Mon May 6 16:54:35 2019 (r347191) +++ head/sys/geom/raid/g_raid.h Mon May 6 18:24:07 2019 (r347192) @@ -155,7 +155,6 @@ struct g_raid_disk { struct g_raid_softc *d_softc; /* Back-pointer to softc. */ struct g_consumer *d_consumer; /* GEOM disk consumer. */ void *d_md_data; /* Disk's metadata storage. */ - struct g_kerneldump d_kd; /* Kernel dumping method/args. */ int d_candelete; /* BIO_DELETE supported. */ uint64_t d_flags; /* Additional flags. */ u_int d_state; /* Disk state. */ @@ -164,6 +163,7 @@ struct g_raid_disk { int d_read_errs; /* Count of the read errors */ TAILQ_HEAD(, g_raid_subdisk) d_subdisks; /* List of subdisks. */ TAILQ_ENTRY(g_raid_disk) d_next; /* Next disk in the node. */ + struct g_kerneldump d_kd; /* Kernel dumping method/args. */ }; #define G_RAID_SUBDISK_S_NONE 0x00 /* Absent. */ Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Mon May 6 16:54:35 2019 (r347191) +++ head/sys/kern/kern_shutdown.c Mon May 6 18:24:07 2019 (r347192) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ekcd.h" #include "opt_kdb.h" #include "opt_panic.h" +#include "opt_printf.h" #include "opt_sched.h" #include "opt_watchdog.h" @@ -53,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -69,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -209,8 +212,17 @@ const char *panicstr; int dumping; /* system is dumping */ int rebooting; /* system is rebooting */ -static struct dumperinfo dumper; /* our selected dumper */ +/* + * Used to serialize between sysctl kern.shutdown.dumpdevname and list + * modifications via ioctl. + */ +static struct mtx dumpconf_list_lk; +MTX_SYSINIT(dumper_configs, &dumpconf_list_lk, "dumper config list", MTX_DEF); +/* Our selected dumper(s). */ +static TAILQ_HEAD(dumpconflist, dumperinfo) dumper_configs = + TAILQ_HEAD_INITIALIZER(dumper_configs); + /* Context information for dump-debuggers. */ static struct pcb dumppcb; /* Registers. */ lwpid_t dumptid; /* Thread ID. */ @@ -364,7 +376,7 @@ doadump(boolean_t textdump) error = 0; if (dumping) return (EBUSY); - if (dumper.dumper == NULL) + if (TAILQ_EMPTY(&dumper_configs)) return (ENXIO); savectx(&dumppcb); @@ -375,12 +387,19 @@ doadump(boolean_t textdump) #ifdef DDB if (textdump && textdump_pending) { coredump = FALSE; - textdump_dumpsys(&dumper); + textdump_dumpsys(TAILQ_FIRST(&dumper_configs)); } #endif - if (coredump) - error = dumpsys(&dumper); + if (coredump) { + struct dumperinfo *di; + TAILQ_FOREACH(di, &dumper_configs, di_next) { + error = dumpsys(di); + if (error == 0) + break; + } + } + dumping--; return (error); } @@ -952,10 +971,36 @@ kthread_shutdown(void *arg, int howto) printf("done\n"); } -static char dumpdevname[sizeof(((struct cdev*)NULL)->si_name)]; -SYSCTL_STRING(_kern_shutdown, OID_AUTO, dumpdevname, CTLFLAG_RD, - dumpdevname, 0, "Device for kernel dumps"); +static int +dumpdevname_sysctl_handler(SYSCTL_HANDLER_ARGS) +{ + char buf[256]; + struct dumperinfo *di; + struct sbuf sb; + int error; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sbuf_new_for_sysctl(&sb, buf, sizeof(buf), req); + + mtx_lock(&dumpconf_list_lk); + TAILQ_FOREACH(di, &dumper_configs, di_next) { + if (di != TAILQ_FIRST(&dumper_configs)) + sbuf_putc(&sb, ','); + sbuf_cat(&sb, di->di_devname); + } + mtx_unlock(&dumpconf_list_lk); + + error = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error); +} +SYSCTL_PROC(_kern_shutdown, OID_AUTO, dumpdevname, CTLTYPE_STRING | CTLFLAG_RD, + &dumper_configs, 0, dumpdevname_sysctl_handler, "A", + "Device(s) for kernel dumps"); + static int _dump_append(struct dumperinfo *di, void *virtual, vm_offset_t physical, size_t length); @@ -1092,31 +1137,67 @@ kerneldumpcomp_destroy(struct dumperinfo *di) free(kdcomp, M_DUMPER); } +/* + * Must not be present on global list. + */ +static void +free_single_dumper(struct dumperinfo *di) +{ + + if (di == NULL) + return; + + if (di->blockbuf != NULL) { + explicit_bzero(di->blockbuf, di->blocksize); + free(di->blockbuf, M_DUMPER); + } + + kerneldumpcomp_destroy(di); + +#ifdef EKCD + if (di->kdcrypto != NULL) { + explicit_bzero(di->kdcrypto, sizeof(*di->kdcrypto) + + di->kdcrypto->kdc_dumpkeysize); + free(di->kdcrypto, M_EKCD); + } +#endif + + explicit_bzero(di, sizeof(*di)); + free(di, M_DUMPER); +} + /* Registration of dumpers */ int -set_dumper(struct dumperinfo *di, const char *devname, struct thread *td, - uint8_t compression, uint8_t encryption, const uint8_t *key, - uint32_t encryptedkeysize, const uint8_t *encryptedkey) +dumper_insert(const struct dumperinfo *di_template, const char *devname, + const struct diocskerneldump_arg *kda) { - size_t wantcopy; + struct dumperinfo *newdi, *listdi; + bool inserted; + uint8_t index; int error; - error = priv_check(td, PRIV_SETDUMPER); + index = kda->kda_index; + MPASS(index != KDA_REMOVE && index != KDA_REMOVE_DEV && + index != KDA_REMOVE_ALL); + + error = priv_check(curthread, PRIV_SETDUMPER); if (error != 0) return (error); - if (dumper.dumper != NULL) - return (EBUSY); - dumper = *di; - dumper.blockbuf = NULL; - dumper.kdcrypto = NULL; - dumper.kdcomp = NULL; + newdi = malloc(sizeof(*newdi) + strlen(devname) + 1, M_DUMPER, M_WAITOK + | M_ZERO); + memcpy(newdi, di_template, sizeof(*newdi)); + newdi->blockbuf = NULL; + newdi->kdcrypto = NULL; + newdi->kdcomp = NULL; + strcpy(newdi->di_devname, devname); - if (encryption != KERNELDUMP_ENC_NONE) { + if (kda->kda_encryption != KERNELDUMP_ENC_NONE) { #ifdef EKCD - dumper.kdcrypto = kerneldumpcrypto_create(di->blocksize, - encryption, key, encryptedkeysize, encryptedkey); - if (dumper.kdcrypto == NULL) { + newdi->kdcrypto = kerneldumpcrypto_create(di_template->blocksize, + kda->kda_encryption, kda->kda_key, + kda->kda_encryptedkeysize, kda->kda_encryptedkey); + if (newdi->kdcrypto == NULL) { error = EINVAL; goto cleanup; } @@ -1125,66 +1206,117 @@ set_dumper(struct dumperinfo *di, const char *devname, goto cleanup; #endif } - - wantcopy = strlcpy(dumpdevname, devname, sizeof(dumpdevname)); - if (wantcopy >= sizeof(dumpdevname)) { - printf("set_dumper: device name truncated from '%s' -> '%s'\n", - devname, dumpdevname); - } - - if (compression != KERNELDUMP_COMP_NONE) { + if (kda->kda_compression != KERNELDUMP_COMP_NONE) { /* * We currently can't support simultaneous encryption and - * compression. + * compression because our only encryption mode is an unpadded + * block cipher, go figure. This is low hanging fruit to fix. */ - if (encryption != KERNELDUMP_ENC_NONE) { + if (kda->kda_encryption != KERNELDUMP_ENC_NONE) { error = EOPNOTSUPP; goto cleanup; } - dumper.kdcomp = kerneldumpcomp_create(&dumper, compression); - if (dumper.kdcomp == NULL) { + newdi->kdcomp = kerneldumpcomp_create(newdi, + kda->kda_compression); + if (newdi->kdcomp == NULL) { error = EINVAL; goto cleanup; } } - dumper.blockbuf = malloc(di->blocksize, M_DUMPER, M_WAITOK | M_ZERO); + newdi->blockbuf = malloc(newdi->blocksize, M_DUMPER, M_WAITOK | M_ZERO); + + /* Add the new configuration to the queue */ + mtx_lock(&dumpconf_list_lk); + inserted = false; + TAILQ_FOREACH(listdi, &dumper_configs, di_next) { + if (index == 0) { + TAILQ_INSERT_BEFORE(listdi, newdi, di_next); + inserted = true; + break; + } + index--; + } + if (!inserted) + TAILQ_INSERT_TAIL(&dumper_configs, newdi, di_next); + mtx_unlock(&dumpconf_list_lk); + return (0); cleanup: - (void)clear_dumper(td); + free_single_dumper(newdi); return (error); } -int -clear_dumper(struct thread *td) +static bool +dumper_config_match(const struct dumperinfo *di, const char *devname, + const struct diocskerneldump_arg *kda) { - int error; + if (kda->kda_index == KDA_REMOVE_ALL) + return (true); - error = priv_check(td, PRIV_SETDUMPER); - if (error != 0) - return (error); + if (strcmp(di->di_devname, devname) != 0) + return (false); -#ifdef NETDUMP - netdump_mbuf_drain(); -#endif + /* + * Allow wildcard removal of configs matching a device on g_dev_orphan. + */ + if (kda->kda_index == KDA_REMOVE_DEV) + return (true); + if (di->kdcomp != NULL) { + if (di->kdcomp->kdc_format != kda->kda_compression) + return (false); + } else if (kda->kda_compression != KERNELDUMP_COMP_NONE) + return (false); #ifdef EKCD - if (dumper.kdcrypto != NULL) { - explicit_bzero(dumper.kdcrypto, sizeof(*dumper.kdcrypto) + - dumper.kdcrypto->kdc_dumpkeysize); - free(dumper.kdcrypto, M_EKCD); - } + if (di->kdcrypto != NULL) { + if (di->kdcrypto->kdc_encryption != kda->kda_encryption) + return (false); + /* + * Do we care to verify keys match to delete? It seems weird + * to expect multiple fallback dump configurations on the same + * device that only differ in crypto key. + */ + } else #endif + if (kda->kda_encryption != KERNELDUMP_ENC_NONE) + return (false); - kerneldumpcomp_destroy(&dumper); + return (true); +} - if (dumper.blockbuf != NULL) { - explicit_bzero(dumper.blockbuf, dumper.blocksize); - free(dumper.blockbuf, M_DUMPER); +int +dumper_remove(const char *devname, const struct diocskerneldump_arg *kda) +{ + struct dumperinfo *di, *sdi; + bool found; + int error; + + error = priv_check(curthread, PRIV_SETDUMPER); + if (error != 0) + return (error); + + /* + * Try to find a matching configuration, and kill it. + * + * NULL 'kda' indicates remove any configuration matching 'devname', + * which may remove multiple configurations in atypical configurations. + */ + found = false; + mtx_lock(&dumpconf_list_lk); + TAILQ_FOREACH_SAFE(di, &dumper_configs, di_next, sdi) { + if (dumper_config_match(di, devname, kda)) { + found = true; + TAILQ_REMOVE(&dumper_configs, di, di_next); + free_single_dumper(di); + } } - explicit_bzero(&dumper, sizeof(dumper)); - dumpdevname[0] = '\0'; + mtx_unlock(&dumpconf_list_lk); + + /* Only produce ENOENT if a more targeted match didn't match. */ + if (!found && kda->kda_index == KDA_REMOVE) + return (ENOENT); return (0); } Modified: head/sys/netinet/netdump/netdump.h ============================================================================== --- head/sys/netinet/netdump/netdump.h Mon May 6 16:54:35 2019 (r347191) +++ head/sys/netinet/netdump/netdump.h Mon May 6 18:24:07 2019 (r347192) @@ -60,18 +60,18 @@ struct netdump_ack { uint32_t na_seqno; /* Match acks with msgs. */ } __packed; -struct netdump_conf { - struct diocskerneldump_arg ndc_kda; - char ndc_iface[IFNAMSIZ]; - struct in_addr ndc_server; - struct in_addr ndc_client; - struct in_addr ndc_gateway; +struct netdump_conf_freebsd12 { + struct diocskerneldump_arg_freebsd12 ndc12_kda; + char ndc12_iface[IFNAMSIZ]; + struct in_addr ndc12_server; + struct in_addr ndc12_client; + struct in_addr ndc12_gateway; }; -#define _PATH_NETDUMP "/dev/netdump" +#define NETDUMPGCONF_FREEBSD12 _IOR('n', 1, struct netdump_conf_freebsd12) +#define NETDUMPSCONF_FREEBSD12 _IOW('n', 2, struct netdump_conf_freebsd12) -#define NETDUMPGCONF _IOR('n', 1, struct netdump_conf) -#define NETDUMPSCONF _IOW('n', 2, struct netdump_conf) +#define _PATH_NETDUMP "/dev/netdump" #ifdef _KERNEL #ifdef NETDUMP Modified: head/sys/netinet/netdump/netdump_client.c ============================================================================== --- head/sys/netinet/netdump/netdump_client.c Mon May 6 16:54:35 2019 (r347191) +++ head/sys/netinet/netdump/netdump_client.c Mon May 6 18:24:07 2019 (r347192) @@ -89,7 +89,8 @@ __FBSDID("$FreeBSD$"); static int netdump_arp_gw(void); static void netdump_cleanup(void); -static int netdump_configure(struct netdump_conf *, struct thread *); +static int netdump_configure(struct diocskerneldump_arg *, + struct thread *); static int netdump_dumper(void *priv __unused, void *virtual, vm_offset_t physical __unused, off_t offset, size_t length); static int netdump_ether_output(struct mbuf *m, struct ifnet *ifp, @@ -118,10 +119,10 @@ static uint64_t rcvd_acks; CTASSERT(sizeof(rcvd_acks) * NBBY == NETDUMP_MAX_IN_FLIGHT); /* Configuration parameters. */ -static struct netdump_conf nd_conf; -#define nd_server nd_conf.ndc_server -#define nd_client nd_conf.ndc_client -#define nd_gateway nd_conf.ndc_gateway +static struct diocskerneldump_arg nd_conf; +#define nd_server nd_conf.kda_server.in4 +#define nd_client nd_conf.kda_client.in4 +#define nd_gateway nd_conf.kda_gateway.in4 /* General dynamic settings. */ static struct ether_addr nd_gw_mac; @@ -1059,7 +1060,7 @@ static struct cdevsw netdump_cdevsw = { static struct cdev *netdump_cdev; static int -netdump_configure(struct netdump_conf *conf, struct thread *td) +netdump_configure(struct diocskerneldump_arg *conf, struct thread *td) { struct epoch_tracker et; struct ifnet *ifp; @@ -1071,7 +1072,7 @@ netdump_configure(struct netdump_conf *conf, struct th } NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (strcmp(ifp->if_xname, conf->ndc_iface) == 0) + if (strcmp(ifp->if_xname, conf->kda_iface) == 0) break; } /* XXX ref */ @@ -1083,7 +1084,7 @@ netdump_configure(struct netdump_conf *conf, struct th if ((if_getflags(ifp) & IFF_UP) == 0) return (ENXIO); if (!netdump_supported_nic(ifp) || ifp->if_type != IFT_ETHER) - return (EINVAL); + return (ENODEV); nd_ifp = ifp; netdump_reinit(ifp); @@ -1135,19 +1136,24 @@ static int netdump_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr, int flags __unused, struct thread *td) { - struct diocskerneldump_arg *kda; + struct diocskerneldump_arg kda_copy, *conf; struct dumperinfo dumper; - struct netdump_conf *conf; uint8_t *encryptedkey; int error; #ifdef COMPAT_FREEBSD11 u_int u; #endif +#ifdef COMPAT_FREEBSD12 + struct diocskerneldump_arg_freebsd12 *kda12; + struct netdump_conf_freebsd12 *conf12; +#endif + conf = NULL; error = 0; switch (cmd) { #ifdef COMPAT_FREEBSD11 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 6 18:38:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A6015920F3; Mon, 6 May 2019 18:38:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7387F83C17; Mon, 6 May 2019 18:38:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FFBCAB44; Mon, 6 May 2019 18:38:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46IclVw082670; Mon, 6 May 2019 18:38:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46IckrZ082668; Mon, 6 May 2019 18:38:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905061838.x46IckrZ082668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 May 2019 18:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347193 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 347193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7387F83C17 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 18:38:48 -0000 Author: imp Date: Mon May 6 18:38:46 2019 New Revision: 347193 URL: https://svnweb.freebsd.org/changeset/base/347193 Log: Reach over and pull in devpath.c from libefi This allows us to remove three nearly identical functions because the differences don't matter, and the size difference is trivial. Modified: head/stand/efi/boot1/Makefile head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Mon May 6 18:24:07 2019 (r347192) +++ head/stand/efi/boot1/Makefile Mon May 6 18:38:46 2019 (r347193) @@ -25,7 +25,7 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-parameter CWARNFLAGS.zfs_module.c += -Wno-unused-function # architecture-specific loader code -SRCS+= boot1.c self_reloc.c start.S ufs_module.c +SRCS+= boot1.c self_reloc.c start.S ufs_module.c devpath.c .if ${MK_LOADER_ZFS} != "no" SRCS+= zfs_module.c CFLAGS.zfs_module.c+= -I${ZFSSRC} @@ -50,6 +50,7 @@ CFLAGS+= -DEFI_DEBUG .PATH: ${EFISRC}/loader/arch/${MACHINE} .PATH: ${EFISRC}/loader .PATH: ${LDRSRC} +.PATH: ${EFISRC}/libefi CFLAGS+= -I${LDRSRC} FILES= ${BOOT1}.efi ${BOOT1}.efifat Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Mon May 6 18:24:07 2019 (r347192) +++ head/stand/efi/boot1/boot1.c Mon May 6 18:38:46 2019 (r347193) @@ -79,66 +79,6 @@ Free(void *buf, const char *file __unused, int line __ } /* - * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match, - * FALSE otherwise. - */ -static BOOLEAN -nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) -{ - size_t len; - - if (imgpath == NULL || imgpath->Type != devpath->Type || - imgpath->SubType != devpath->SubType) - return (FALSE); - - len = DevicePathNodeLength(imgpath); - if (len != DevicePathNodeLength(devpath)) - return (FALSE); - - return (memcmp(imgpath, devpath, (size_t)len) == 0); -} - -/* - * device_paths_match returns TRUE if the imgpath isn't NULL and all nodes - * in imgpath and devpath match up to their respective occurrences of a - * media node, FALSE otherwise. - */ -static BOOLEAN -device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) -{ - - if (imgpath == NULL) - return (FALSE); - - while (!IsDevicePathEnd(imgpath) && !IsDevicePathEnd(devpath)) { - if (IsDevicePathType(imgpath, MEDIA_DEVICE_PATH) && - IsDevicePathType(devpath, MEDIA_DEVICE_PATH)) - return (TRUE); - - if (!nodes_match(imgpath, devpath)) - return (FALSE); - - imgpath = NextDevicePathNode(imgpath); - devpath = NextDevicePathNode(devpath); - } - - return (FALSE); -} - -/* - * devpath_last returns the last non-path end node in devpath. - */ -static EFI_DEVICE_PATH * -devpath_last(EFI_DEVICE_PATH *devpath) -{ - - while (!IsDevicePathEnd(NextDevicePathNode(devpath))) - devpath = NextDevicePathNode(devpath); - - return (devpath); -} - -/* * load_loader attempts to load the loader image data. * * It tries each module and its respective devices, identified by mod->probe, @@ -225,7 +165,7 @@ try_boot(void) buf = NULL; } - if ((status = BS->LoadImage(TRUE, IH, devpath_last(dev->devpath), + if ((status = BS->LoadImage(TRUE, IH, efi_devpath_last_node(dev->devpath), loaderbuf, loadersize, &loaderhandle)) != EFI_SUCCESS) { printf("Failed to load image provided by %s, size: %zu, (%lu)\n", mod->name, loadersize, EFI_ERROR_CODE(status)); @@ -321,7 +261,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B if (!blkio->Media->LogicalPartition) return (EFI_UNSUPPORTED); - *preferred = device_paths_match(imgpath, devpath); + *preferred = efi_devpath_match(imgpath, devpath); /* Run through each module, see if it can load this partition */ for (i = 0; i < NUM_BOOT_MODULES; i++) { From owner-svn-src-all@freebsd.org Mon May 6 18:39:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 348651592188; Mon, 6 May 2019 18:39:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCF0683D59; Mon, 6 May 2019 18:39:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA196AB45; Mon, 6 May 2019 18:39:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46IdM6U082754; Mon, 6 May 2019 18:39:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46IdM7W082753; Mon, 6 May 2019 18:39:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905061839.x46IdM7W082753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 May 2019 18:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347194 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 347194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCF0683D59 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 18:39:23 -0000 Author: imp Date: Mon May 6 18:39:22 2019 New Revision: 347194 URL: https://svnweb.freebsd.org/changeset/base/347194 Log: We only ever need one devinfo per handle. So allocate it outside of looping over the filesystem modules rather than doing a malloc + free each time through the loop. In addition, nothing changes from loop to loop, so setup the new devinfo outside the loop as well. Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Mon May 6 18:38:46 2019 (r347193) +++ head/stand/efi/boot1/boot1.c Mon May 6 18:39:22 2019 (r347194) @@ -264,24 +264,24 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B *preferred = efi_devpath_match(imgpath, devpath); /* Run through each module, see if it can load this partition */ + devinfo = malloc(sizeof(*devinfo)); + if (devinfo == NULL) { + DPRINTF("\nFailed to allocate devinfo\n"); + return (EFI_UNSUPPORTED); + } + devinfo->dev = blkio; + devinfo->devpath = devpath; + devinfo->devhandle = h; + devinfo->preferred = *preferred; + devinfo->next = NULL; + for (i = 0; i < NUM_BOOT_MODULES; i++) { - devinfo = malloc(sizeof(*devinfo)); - if (devinfo == NULL) { - DPRINTF("\nFailed to allocate devinfo\n"); - break; - } - devinfo->dev = blkio; - devinfo->devpath = devpath; - devinfo->devhandle = h; devinfo->devdata = NULL; - devinfo->preferred = *preferred; - devinfo->next = NULL; - status = boot_modules[i]->probe(devinfo); if (status == EFI_SUCCESS) return (EFI_SUCCESS); - free(devinfo); } + free(devinfo); return (EFI_UNSUPPORTED); } From owner-svn-src-all@freebsd.org Mon May 6 18:39:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 974B815921B5; Mon, 6 May 2019 18:39:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3985A83DB6; Mon, 6 May 2019 18:39:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25BA1AB46; Mon, 6 May 2019 18:39:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46IdSlB082810; Mon, 6 May 2019 18:39:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46IdRW6082808; Mon, 6 May 2019 18:39:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905061839.x46IdRW6082808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 May 2019 18:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347195 - in head/stand/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/efi: include libefi X-SVN-Commit-Revision: 347195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3985A83DB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 18:39:29 -0000 Author: imp Date: Mon May 6 18:39:27 2019 New Revision: 347195 URL: https://svnweb.freebsd.org/changeset/base/347195 Log: Abstract out efi_devpath_to_handle to search for a handle that matches the desired devpath. Modified: head/stand/efi/include/efilib.h head/stand/efi/libefi/devpath.c head/stand/efi/libefi/efipart.c Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Mon May 6 18:39:22 2019 (r347194) +++ head/stand/efi/include/efilib.h Mon May 6 18:39:27 2019 (r347195) @@ -95,6 +95,7 @@ UINTN efi_devpath_length(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_name_to_devpath(const char *path); EFI_DEVICE_PATH *efi_name_to_devpath16(CHAR16 *path); void efi_devpath_free(EFI_DEVICE_PATH *dp); +EFI_HANDLE efi_devpath_to_handle(EFI_DEVICE_PATH *path, EFI_HANDLE *handles, unsigned nhandles); int efi_status_to_errno(EFI_STATUS); EFI_STATUS errno_to_efi_status(int errno); Modified: head/stand/efi/libefi/devpath.c ============================================================================== --- head/stand/efi/libefi/devpath.c Mon May 6 18:39:22 2019 (r347194) +++ head/stand/efi/libefi/devpath.c Mon May 6 18:39:27 2019 (r347195) @@ -269,3 +269,25 @@ efi_devpath_length(EFI_DEVICE_PATH *path) path = NextDevicePathNode(path); return ((UINTN)path - (UINTN)start) + DevicePathNodeLength(path); } + +EFI_HANDLE +efi_devpath_to_handle(EFI_DEVICE_PATH *path, EFI_HANDLE *handles, unsigned nhandles) +{ + unsigned i; + EFI_DEVICE_PATH *media, *devpath; + EFI_HANDLE h; + + media = efi_devpath_to_media_path(path); + if (media == NULL) + return (NULL); + for (i = 0; i < nhandles; i++) { + h = handles[i]; + devpath = efi_lookup_devpath(h); + if (devpath == NULL) + continue; + if (!efi_devpath_match_node(media, efi_devpath_to_media_path(devpath))) + continue; + return (h); + } + return (NULL); +} Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Mon May 6 18:39:22 2019 (r347194) +++ head/stand/efi/libefi/efipart.c Mon May 6 18:39:27 2019 (r347195) @@ -140,23 +140,12 @@ efiblk_get_pdinfo(struct devdesc *dev) pdinfo_t * efiblk_get_pdinfo_by_device_path(EFI_DEVICE_PATH *path) { - unsigned i; - EFI_DEVICE_PATH *media, *devpath; EFI_HANDLE h; - media = efi_devpath_to_media_path(path); - if (media == NULL) + h = efi_devpath_to_handle(path, efipart_handles, efipart_nhandles); + if (h == NULL) return (NULL); - for (i = 0; i < efipart_nhandles; i++) { - h = efipart_handles[i]; - devpath = efi_lookup_devpath(h); - if (devpath == NULL) - continue; - if (!efi_devpath_match_node(media, efi_devpath_to_media_path(devpath))) - continue; - return (efiblk_get_pdinfo_by_handle(h)); - } - return (NULL); + return (efiblk_get_pdinfo_by_handle(h)); } static bool From owner-svn-src-all@freebsd.org Mon May 6 18:45:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 282C01592535; Mon, 6 May 2019 18:45:09 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x129.google.com (mail-it1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA02B84392; Mon, 6 May 2019 18:45:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x129.google.com with SMTP id r85so21549922itc.2; Mon, 06 May 2019 11:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AQLwyW+jYhkdTHuSIiwmnpleMM9+jmVEL1V47fMGJ2U=; b=cc5R4yCHmyAy8vXKWyxGUrR/gSjkXXe6V+R5eJYJBF6U3iGPaKrZ+3vKaG4+AFC5Xd Z2AqEtIVaZ8PAR7is0iqTD5gcequvBTeVcoru1SycGW79WTkaKVvPnyHxOglvR0j1CFk V8ykcWflkI8LHWRLZ5lHU6q+iG+4AL0c41p4TPGexTB9XUhhs7CURPGu1qlSd5Ft/Gp4 hzk3cO3wR/H3yO/U+U2+EHouB+7q2VU+3MqRZT2BQQEFFtFGbjpcu9KpZwyCqm5DOcd3 YAkkr8V9rWSZArnFpDQQ1GdWR1S6a49utPfUD+GBm7DcZ22lFY++pDuRmPM/iJYSJN+J J8SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=AQLwyW+jYhkdTHuSIiwmnpleMM9+jmVEL1V47fMGJ2U=; b=nmPQ2c0v5UP/qrCP0y2jkwujrff9Q3Nxoha6YFxWTM3GwI+Up7FLaUlxZzqj49d4o8 orTu+Y9gMqiT2gIE8QnFCu/q8JLX6f0FGU5trubfhkT9C5Scb/muptwYzL4/WG0fW7yy pnWqjZ6knkHoLdj+TTIXyxxWJfJRVIyarTI+Al4ppPtJpCy5FbADzjrMFHh5ewUzPWYw It8EG49npUpswtEE5UETRLer7S+efao74b9OZbLqVK7ejW0Vb5xFPZm8r6V4OdWrNrcs n0S7tbkrwSM27+GBdKiLFSuM6NYgnnLxmjawo/iPxaORM8v1p5C71/PbHO2ImlgnQN+6 sjtg== X-Gm-Message-State: APjAAAVM3eZjc1Ijtmgw4e3oNpMuU9ZzoAGhghfHI6Zn8AvIr71f1Q1V LBrmeEe6d0uRHlj4b4/rkFZSE5D9 X-Google-Smtp-Source: APXvYqy8a+7Bs2R65myYYvvvz97S+cdIFN9T+xmnFIY8a1wBuYO2xfTTrBF19yrqUKwXGL1Dk4/fhw== X-Received: by 2002:a24:df84:: with SMTP id r126mr19661510itg.113.1557168307619; Mon, 06 May 2019 11:45:07 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-36-31.dsl.bell.ca. [69.159.36.31]) by smtp.gmail.com with ESMTPSA id t67sm5292502ita.35.2019.05.06.11.45.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2019 11:45:06 -0700 (PDT) Sender: Mark Johnston Date: Mon, 6 May 2019 14:45:02 -0400 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347063 - head/sys/kern Message-ID: <20190506184502.GA35464@raichu> References: <201905032126.x43LQilu092655@repo.freebsd.org> <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: AA02B84392 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 18:45:09 -0000 On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: > On 5/3/19 2:26 PM, Mark Johnston wrote: > > Author: markj > > Date: Fri May 3 21:26:44 2019 > > New Revision: 347063 > > URL: https://svnweb.freebsd.org/changeset/base/347063 > > > > Log: > > Disallow excessively small times of day in clock_settime(2). > > > > Reported by: syzkaller > > Reviewed by: cem, kib > > MFC after: 1 week > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D20151 > > > > Modified: > > head/sys/kern/kern_time.c > > > > Modified: head/sys/kern/kern_time.c > > ============================================================================== > > --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 (r347062) > > +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 (r347063) > > @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t clock_ > > if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || > > ats->tv_sec < 0) > > return (EINVAL); > > - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60) > > + if (!allow_insane_settime && > > + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || > > + ats->tv_sec < utc_offset())) > > return (EINVAL); > > /* XXX Don't convert nsec->usec and back */ > > TIMESPEC_TO_TIMEVAL(&atv, ats); > > Pardon my ignorance, but I can't see why you are checking against utc_offset() > vs some small constant? None of the discussion in the review mentioned the > reason for using this particular value, and I didn't see any comparisons > against utc_offset or kernadjtz in kern_clock_setttime() or settime() that > would have underflowed or panicked. Can you give a bit more detail on why > utc_offset() is the lower bound? Thanks. I chose it because we subtract utc_offset() from the time passed in to clock_settime(); see settime_task_func(). That subtraction caused the underflow that later caused the observed panics. From owner-svn-src-all@freebsd.org Mon May 6 18:46:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 805DB15925E5; Mon, 6 May 2019 18:46:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27DFC84566; Mon, 6 May 2019 18:46:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 024C4ACE7; Mon, 6 May 2019 18:46:43 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46IkghX088329; Mon, 6 May 2019 18:46:42 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46Ikgco088328; Mon, 6 May 2019 18:46:42 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905061846.x46Ikgco088328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 6 May 2019 18:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347196 - in head/sys/modules: linux linux64 X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in head/sys/modules: linux linux64 X-SVN-Commit-Revision: 347196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27DFC84566 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 18:46:43 -0000 Author: dchagin Date: Mon May 6 18:46:42 2019 New Revision: 347196 URL: https://svnweb.freebsd.org/changeset/base/347196 Log: The build process generates assym.inc from genassym.o, so don't forget to clean genassym.o MFC after: 2 weeks Modified: head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Mon May 6 18:39:27 2019 (r347195) +++ head/sys/modules/linux/Makefile Mon May 6 18:46:42 2019 (r347196) @@ -47,7 +47,8 @@ EXPORT_SYMS+= linux_ioctl_register_handler EXPORT_SYMS+= linux_ioctl_unregister_handler .endif -CLEANFILES= linux${SFX}_assym.h linux${SFX}_genassym.o linux${SFX}_locore.o +CLEANFILES= linux${SFX}_assym.h linux${SFX}_genassym.o linux${SFX}_locore.o \ + genassym.o linux${SFX}_assym.h: linux${SFX}_genassym.o sh ${SYSDIR}/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET} Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Mon May 6 18:39:27 2019 (r347195) +++ head/sys/modules/linux64/Makefile Mon May 6 18:46:42 2019 (r347196) @@ -21,7 +21,8 @@ SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h SRCS+= opt_apic.h .endif -CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o +CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o \ + genassym.o OBJS= ${VDSO}.so From owner-svn-src-all@freebsd.org Mon May 6 18:50:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53D6D1592735; Mon, 6 May 2019 18:50:09 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03D008473D; Mon, 6 May 2019 18:50:09 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4339ACF5; Mon, 6 May 2019 18:50:08 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46Io8BB088558; Mon, 6 May 2019 18:50:08 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46Io8OH088556; Mon, 6 May 2019 18:50:08 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201905061850.x46Io8OH088556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 6 May 2019 18:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347197 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 347197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03D008473D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 18:50:09 -0000 Author: erj Date: Mon May 6 18:50:08 2019 New Revision: 347197 URL: https://svnweb.freebsd.org/changeset/base/347197 Log: MFC r332389, r3342331, r334343, and partially r339338 This commit backports some new features from iflib in 12 back to stable/11: r332389 - Split out flag manipulation from general context manipulation in iflib r334231 - Add IFLIB_ADMIN_ALWAYS_RUN flag r334343 - hold context lock across detach r339338 - (Other updates to iflib that were included in this revision) This commit doesn't include mergeinfo for r339338 since this only includes part of it. I'm reminded of advice given to keep MFC-ability in mind when committing large changes in the future. Reviewed by: marius@ (change content) Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D19949 Modified: stable/11/sys/net/iflib.c stable/11/sys/net/iflib.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Mon May 6 18:46:42 2019 (r347196) +++ stable/11/sys/net/iflib.c Mon May 6 18:50:08 2019 (r347197) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2017, Matthew Macy + * Copyright (c) 2014-2018, Matthew Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -97,6 +97,11 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef PCI_IOV +#include +#endif + + #include /* * enable accounting of every mbuf as it comes in to and goes out of @@ -150,9 +155,9 @@ typedef struct iflib_filter_info { struct iflib_ctx { KOBJ_FIELDS; - /* - * Pointer to hardware driver's softc - */ + /* + * Pointer to hardware driver's softc + */ void *ifc_softc; device_t ifc_dev; if_t ifc_ifp; @@ -161,7 +166,8 @@ struct iflib_ctx { if_shared_ctx_t ifc_sctx; struct if_softc_ctx ifc_softc_ctx; - struct mtx ifc_mtx; + struct mtx ifc_ctx_mtx; + struct mtx ifc_state_mtx; uint16_t ifc_nhwtxqs; @@ -170,7 +176,6 @@ struct iflib_ctx { uint32_t ifc_if_flags; uint32_t ifc_flags; uint32_t ifc_max_fl_buf_size; - int ifc_in_detach; int ifc_link_state; int ifc_link_irq; @@ -315,8 +320,11 @@ typedef struct iflib_sw_tx_desc_array { #define IFC_INIT_DONE 0x020 #define IFC_PREFETCH 0x040 #define IFC_DO_RESET 0x080 -#define IFC_CHECK_HUNG 0x100 +#define IFC_DO_WATCHDOG 0x100 +#define IFC_CHECK_HUNG 0x200 +#define IFC_IN_DETACH 0x800 + #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) @@ -532,17 +540,22 @@ rxd_info_zero(if_rxd_info_t ri) #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING)) -#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx lock", MTX_DEF) +#define CTX_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_ctx_mtx, _name, "iflib ctx lock", MTX_DEF) +#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_ctx_mtx) +#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_ctx_mtx) +#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_ctx_mtx) -#define CTX_LOCK(ctx) mtx_lock(&(ctx)->ifc_mtx) -#define CTX_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_mtx) -#define CTX_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_mtx) +#define STATE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_state_mtx, _name, "iflib state lock", MTX_DEF) +#define STATE_LOCK(ctx) mtx_lock(&(ctx)->ifc_state_mtx) +#define STATE_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_state_mtx) +#define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) + + #define CALLOUT_LOCK(txq) mtx_lock(&txq->ift_mtx) #define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) - /* Our boot-time initialization hook */ static int iflib_module_event_handler(module_t, int, void *); @@ -720,6 +733,7 @@ static void iflib_ifmp_purge(iflib_txq_t txq); static void _iflib_pre_assert(if_softc_ctx_t scctx); static void iflib_stop(if_ctx_t ctx); static void iflib_if_init_locked(if_ctx_t ctx); +static void iflib_free_intr_mem(if_ctx_t ctx); #ifndef __NO_STRICT_ALIGNMENT static struct mbuf * iflib_fixup_rx(struct mbuf *m); #endif @@ -1948,6 +1962,16 @@ __iflib_fl_refill_lt(if_ctx_t ctx, iflib_fl_t fl, int _iflib_fl_refill(ctx, fl, min(max, reclaimable)); } +uint8_t +iflib_in_detach(if_ctx_t ctx) +{ + bool in_detach; + STATE_LOCK(ctx); + in_detach = !!(ctx->ifc_flags & IFC_IN_DETACH); + STATE_UNLOCK(ctx); + return (in_detach); +} + static void iflib_fl_bufs_free(iflib_fl_t fl) { @@ -1963,7 +1987,8 @@ iflib_fl_bufs_free(iflib_fl_t fl) if (fl->ifl_sds.ifsd_map != NULL) { bus_dmamap_t sd_map = fl->ifl_sds.ifsd_map[i]; bus_dmamap_unload(fl->ifl_desc_tag, sd_map); - if (fl->ifl_rxq->ifr_ctx->ifc_in_detach) + // XXX: Should this get moved out? + if (iflib_in_detach(fl->ifl_rxq->ifr_ctx)) bus_dmamap_destroy(fl->ifl_desc_tag, sd_map); } if (*sd_m != NULL) { @@ -2124,18 +2149,14 @@ iflib_timer(void *arg) if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); return; -hung: - CTX_LOCK(ctx); - if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); + hung: device_printf(ctx->ifc_dev, "TX(%d) desc avail = %d, pidx = %d\n", txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx); - - IFDI_WATCHDOG_RESET(ctx); - ctx->ifc_watchdog_events++; - - ctx->ifc_flags |= IFC_DO_RESET; + STATE_LOCK(ctx); + if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); + ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET); iflib_admin_intr_deferred(ctx); - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); } static void @@ -2653,10 +2674,10 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) return true; return (iflib_rxd_avail(ctx, rxq, *cidxp, 1)); err: - CTX_LOCK(ctx); + STATE_LOCK(ctx); ctx->ifc_flags |= IFC_DO_RESET; iflib_admin_intr_deferred(ctx); - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); return (false); } @@ -3704,27 +3725,38 @@ _task_fn_admin(void *context) if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; iflib_txq_t txq; int i; + bool oactive, running, do_reset, do_watchdog, in_detach; - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) { - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE)) { - return; - } - } + STATE_LOCK(ctx); + running = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING); + oactive = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE); + do_reset = (ctx->ifc_flags & IFC_DO_RESET); + do_watchdog = (ctx->ifc_flags & IFC_DO_WATCHDOG); + in_detach = (ctx->ifc_flags & IFC_IN_DETACH); + ctx->ifc_flags &= ~(IFC_DO_RESET|IFC_DO_WATCHDOG); + STATE_UNLOCK(ctx); + if ((!running & !oactive) && + !(ctx->ifc_sctx->isc_flags & IFLIB_ADMIN_ALWAYS_RUN)) + if (in_detach) + return; + CTX_LOCK(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) { CALLOUT_LOCK(txq); callout_stop(&txq->ift_timer); CALLOUT_UNLOCK(txq); } + if (do_watchdog) { + ctx->ifc_watchdog_events++; + IFDI_WATCHDOG_RESET(ctx); + } IFDI_UPDATE_ADMIN_STATUS(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) callout_reset_on(&txq->ift_timer, hz/2, iflib_timer, txq, txq->ift_timer.c_cpu); IFDI_LINK_INTR_ENABLE(ctx); - if (ctx->ifc_flags & IFC_DO_RESET) { - ctx->ifc_flags &= ~IFC_DO_RESET; + if (do_reset) iflib_if_init_locked(ctx); - } CTX_UNLOCK(ctx); if (LINK_ACTIVE(ctx) == 0) @@ -3739,7 +3771,8 @@ _task_fn_iov(void *context) { if_ctx_t ctx = context; - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) + if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) && + !(ctx->ifc_sctx->isc_flags & IFLIB_ADMIN_ALWAYS_RUN)) return; CTX_LOCK(ctx); @@ -3868,15 +3901,15 @@ iflib_if_qflush(if_t ifp) iflib_txq_t txq = ctx->ifc_txqs; int i; - CTX_LOCK(ctx); + STATE_LOCK(ctx); ctx->ifc_flags |= IFC_QFLUSH; - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); for (i = 0; i < NTXQSETS(ctx); i++, txq++) while (!(ifmp_ring_is_idle(txq->ift_br) || ifmp_ring_is_stalled(txq->ift_br))) iflib_txq_check_drain(txq, 0); - CTX_LOCK(ctx); + STATE_LOCK(ctx); ctx->ifc_flags &= ~IFC_QFLUSH; - CTX_UNLOCK(ctx); + STATE_UNLOCK(ctx); if_qflush(ifp); } @@ -3933,14 +3966,18 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) iflib_stop(ctx); if ((err = IFDI_MTU_SET(ctx, ifr->ifr_mtu)) == 0) { + STATE_LOCK(ctx); if (ifr->ifr_mtu > ctx->ifc_max_fl_buf_size) ctx->ifc_flags |= IFC_MULTISEG; else ctx->ifc_flags &= ~IFC_MULTISEG; + STATE_UNLOCK(ctx); err = if_setmtu(ifp, ifr->ifr_mtu); } iflib_init_locked(ctx); + STATE_LOCK(ctx); if_setdrvflags(ifp, bits); + STATE_UNLOCK(ctx); CTX_UNLOCK(ctx); break; case SIOCSIFFLAGS: @@ -4024,10 +4061,14 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) bits = if_getdrvflags(ifp); if (bits & IFF_DRV_RUNNING) iflib_stop(ctx); + STATE_LOCK(ctx); if_togglecapenable(ifp, setmask); + STATE_UNLOCK(ctx); if (bits & IFF_DRV_RUNNING) iflib_init_locked(ctx); + STATE_LOCK(ctx); if_setdrvflags(ifp, bits); + STATE_UNLOCK(ctx); CTX_UNLOCK(ctx); } break; @@ -4441,12 +4482,21 @@ iflib_device_deregister(if_ctx_t ctx) /* Make sure VLANS are not using driver */ if (if_vlantrunkinuse(ifp)) { - device_printf(dev,"Vlan in use, detach first\n"); + device_printf(dev, "Vlan in use, detach first\n"); return (EBUSY); } +#ifdef PCI_IOV + if (!CTX_IS_VF(ctx) && pci_iov_detach(dev) != 0) { + device_printf(dev, "SR-IOV in use; detach first.\n"); + return (EBUSY); + } +#endif + STATE_LOCK(ctx); + ctx->ifc_flags |= IFC_IN_DETACH; + STATE_UNLOCK(ctx); + CTX_LOCK(ctx); - ctx->ifc_in_detach = 1; iflib_stop(ctx); CTX_UNLOCK(ctx); @@ -4458,8 +4508,6 @@ iflib_device_deregister(if_ctx_t ctx) iflib_netmap_detach(ifp); ether_ifdetach(ifp); - /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ - CTX_LOCK_DESTROY(ctx); if (ctx->ifc_led_dev != NULL) led_destroy(ctx->ifc_led_dev); /* XXX drain any dependent tasks */ @@ -4482,20 +4530,14 @@ iflib_device_deregister(if_ctx_t ctx) taskqgroup_detach(tqg, &ctx->ifc_admin_task); if (ctx->ifc_vflr_task.gt_uniq != NULL) taskqgroup_detach(tqg, &ctx->ifc_vflr_task); - + CTX_LOCK(ctx); IFDI_DETACH(ctx); + CTX_UNLOCK(ctx); + + /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ + CTX_LOCK_DESTROY(ctx); device_set_softc(ctx->ifc_dev, NULL); - if (ctx->ifc_softc_ctx.isc_intr != IFLIB_INTR_LEGACY) { - pci_release_msi(dev); - } - if (ctx->ifc_softc_ctx.isc_intr != IFLIB_INTR_MSIX) { - iflib_irq_free(ctx, &ctx->ifc_legacy_irq); - } - if (ctx->ifc_msix_mem != NULL) { - bus_release_resource(ctx->ifc_dev, SYS_RES_MEMORY, - ctx->ifc_softc_ctx.isc_msix_bar, ctx->ifc_msix_mem); - ctx->ifc_msix_mem = NULL; - } + iflib_free_intr_mem(ctx); bus_generic_detach(dev); if_free(ifp); @@ -4504,11 +4546,28 @@ iflib_device_deregister(if_ctx_t ctx) iflib_rx_structures_free(ctx); if (ctx->ifc_flags & IFC_SC_ALLOCATED) free(ctx->ifc_softc, M_IFLIB); + STATE_LOCK_DESTROY(ctx); free(ctx, M_IFLIB); return (0); } +static void +iflib_free_intr_mem(if_ctx_t ctx) +{ + if (ctx->ifc_softc_ctx.isc_intr != IFLIB_INTR_MSIX) { + iflib_irq_free(ctx, &ctx->ifc_legacy_irq); + } + if (ctx->ifc_softc_ctx.isc_intr != IFLIB_INTR_LEGACY) { + pci_release_msi(ctx->ifc_dev); + } + if (ctx->ifc_msix_mem != NULL) { + bus_release_resource(ctx->ifc_dev, SYS_RES_MEMORY, + rman_get_rid(ctx->ifc_msix_mem), ctx->ifc_msix_mem); + ctx->ifc_msix_mem = NULL; + } +} + int iflib_device_detach(device_t dev) { @@ -4679,7 +4738,7 @@ iflib_register(if_ctx_t ctx) CTX_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev)); - ifp = ctx->ifc_ifp = if_gethandle(IFT_ETHER); + ifp = ctx->ifc_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "can not allocate ifnet structure\n"); return (ENOMEM); @@ -4857,7 +4916,7 @@ iflib_queues_alloc(if_ctx_t ctx) fl[j].ifl_ifdi = &rxq->ifr_ifdi[j + rxq->ifr_fl_offset]; fl[j].ifl_rxd_size = scctx->isc_rxd_size[j]; } - /* Allocate receive buffers for the ring*/ + /* Allocate receive buffers for the ring*/ if (iflib_rxsd_alloc(rxq)) { device_printf(dev, "Critical Failure setting up receive buffers\n"); @@ -5012,6 +5071,8 @@ iflib_rx_structures_free(if_ctx_t ctx) for (int i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { iflib_rx_sds_free(rxq); } + free(ctx->ifc_rxqs, M_IFLIB); + ctx->ifc_rxqs = NULL; } static int @@ -5271,7 +5332,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, in } void -iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, void *arg, int qid, char *name) +iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, void *arg, int qid, char *name) { struct grouptask *gtask; struct taskqgroup *tqg; @@ -5436,9 +5497,11 @@ iflib_link_state_change(if_ctx_t ctx, int link_state, iflib_txq_t txq = ctx->ifc_txqs; if_setbaudrate(ifp, baudrate); - if (baudrate >= IF_Gbps(10)) + if (baudrate >= IF_Gbps(10)) { + STATE_LOCK(ctx); ctx->ifc_flags |= IFC_PREFETCH; - + STATE_UNLOCK(ctx); + } /* If link down, disable watchdog */ if ((ctx->ifc_link_state == LINK_STATE_UP) && (link_state == LINK_STATE_DOWN)) { for (int i = 0; i < ctx->ifc_softc_ctx.isc_ntxqsets; i++, txq++) @@ -5497,7 +5560,7 @@ struct mtx * iflib_ctx_lock_get(if_ctx_t ctx) { - return (&ctx->ifc_mtx); + return (&ctx->ifc_ctx_mtx); } static int @@ -5624,8 +5687,9 @@ iflib_msix_init(if_ctx_t ctx) if (ctx->ifc_sysctl_qs_eq_override == 0) { #ifdef INVARIANTS if (tx_queues != rx_queues) - device_printf(dev, "queue equality override not set, capping rx_queues at %d and tx_queues at %d\n", - min(rx_queues, tx_queues), min(rx_queues, tx_queues)); + device_printf(dev, + "queue equality override not set, capping rx_queues at %d and tx_queues at %d\n", + min(rx_queues, tx_queues), min(rx_queues, tx_queues)); #endif tx_queues = min(rx_queues, tx_queues); rx_queues = min(rx_queues, tx_queues); @@ -5635,8 +5699,8 @@ iflib_msix_init(if_ctx_t ctx) vectors = rx_queues + admincnt; if ((err = pci_alloc_msix(dev, &vectors)) == 0) { - device_printf(dev, - "Using MSIX interrupts with %d vectors\n", vectors); + device_printf(dev, "Using MSI-X interrupts with %d vectors\n", + vectors); scctx->isc_vectors = vectors; scctx->isc_nrxqsets = rx_queues; scctx->isc_ntxqsets = tx_queues; @@ -5644,7 +5708,8 @@ iflib_msix_init(if_ctx_t ctx) return (vectors); } else { - device_printf(dev, "failed to allocate %d msix vectors, err: %d - using MSI\n", vectors, err); + device_printf(dev, + "failed to allocate %d msix vectors, err: %d - using MSI\n", vectors, err); } msi: vectors = pci_msi_count(dev); @@ -5944,6 +6009,15 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) } } +} + +void +iflib_request_reset(if_ctx_t ctx) +{ + + STATE_LOCK(ctx); + ctx->ifc_flags |= IFC_DO_RESET; + STATE_UNLOCK(ctx); } #ifndef __NO_STRICT_ALIGNMENT Modified: stable/11/sys/net/iflib.h ============================================================================== --- stable/11/sys/net/iflib.h Mon May 6 18:46:42 2019 (r347196) +++ stable/11/sys/net/iflib.h Mon May 6 18:50:08 2019 (r347197) @@ -243,7 +243,7 @@ struct if_shared_ctx { /* fields necessary for probe */ pci_vendor_info_t *isc_vendor_info; char *isc_driver_version; -/* optional function to transform the read values to match the table*/ + /* optional function to transform the read values to match the table*/ void (*isc_parse_devinfo) (uint16_t *device_id, uint16_t *subvendor_id, uint16_t *subdevice_id, uint16_t *rev_id); int isc_nrxd_min[8]; @@ -321,9 +321,12 @@ typedef enum { * Driver needs frames padded to some minimum length */ #define IFLIB_NEED_ETHER_PAD 0x100 +/* + * Interface needs admin task to ignore interface up/down status + */ +#define IFLIB_ADMIN_ALWAYS_RUN 0x10000 - /* * field accessors */ @@ -339,6 +342,8 @@ if_softc_ctx_t iflib_get_softc_ctx(if_ctx_t ctx); if_shared_ctx_t iflib_get_sctx(if_ctx_t ctx); void iflib_set_mac(if_ctx_t ctx, uint8_t mac[ETHER_ADDR_LEN]); +void iflib_request_reset(if_ctx_t ctx); +uint8_t iflib_in_detach(if_ctx_t ctx); /* * If the driver can plug cleanly in to newbus use these From owner-svn-src-all@freebsd.org Mon May 6 19:08:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CF061593040; Mon, 6 May 2019 19:08:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA26485281; Mon, 6 May 2019 19:08:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0649B072; Mon, 6 May 2019 19:08:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46J84TX098870; Mon, 6 May 2019 19:08:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46J84w2098868; Mon, 6 May 2019 19:08:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905061908.x46J84w2098868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 6 May 2019 19:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347198 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 347198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA26485281 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 19:08:05 -0000 Author: mav Date: Mon May 6 19:08:03 2019 New Revision: 347198 URL: https://svnweb.freebsd.org/changeset/base/347198 Log: Drop periph lock around cam_periph_unmapmem(). Since r345656 it may call copyout(), that may sleep. MFC after: 3 days Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_sg.c Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Mon May 6 18:50:08 2019 (r347197) +++ head/sys/cam/scsi/scsi_pass.c Mon May 6 19:08:03 2019 (r347198) @@ -2261,7 +2261,9 @@ passsendccb(struct cam_periph *periph, union ccb *ccb, /* sense_flags */ SF_RETRY_UA | SF_NO_PRINT, softc->device_stats); + cam_periph_unlock(periph); cam_periph_unmapmem(ccb, &mapinfo); + cam_periph_lock(periph); ccb->ccb_h.cbfcnp = NULL; ccb->ccb_h.periph_priv = inccb->ccb_h.periph_priv; Modified: head/sys/cam/scsi/scsi_sg.c ============================================================================== --- head/sys/cam/scsi/scsi_sg.c Mon May 6 18:50:08 2019 (r347197) +++ head/sys/cam/scsi/scsi_sg.c Mon May 6 19:08:03 2019 (r347198) @@ -915,7 +915,9 @@ sgsendccb(struct cam_periph *periph, union ccb *ccb) SF_RETRY_UA, softc->device_stats); + cam_periph_unlock(periph); cam_periph_unmapmem(ccb, &mapinfo); + cam_periph_lock(periph); return (error); } From owner-svn-src-all@freebsd.org Mon May 6 19:13:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AEF31593259; Mon, 6 May 2019 19:13:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2037A856C4; Mon, 6 May 2019 19:13:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEF79B210; Mon, 6 May 2019 19:13:04 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46JD4XO004262; Mon, 6 May 2019 19:13:04 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46JD44p004260; Mon, 6 May 2019 19:13:04 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905061913.x46JD44p004260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 6 May 2019 19:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347199 - stable/12/sbin/fsck_ffs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sbin/fsck_ffs X-SVN-Commit-Revision: 347199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2037A856C4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 19:13:05 -0000 Author: mckusick Date: Mon May 6 19:13:04 2019 New Revision: 347199 URL: https://svnweb.freebsd.org/changeset/base/347199 Log: MFC of 345758 Properly flush outstanding I/Os when forcibly deleteing a memory disk device. Sponsored by: Netflix Modified: stable/12/sbin/fsck_ffs/fsck.h stable/12/sbin/fsck_ffs/inode.c stable/12/sbin/fsck_ffs/pass1.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_ffs/fsck.h ============================================================================== --- stable/12/sbin/fsck_ffs/fsck.h Mon May 6 19:08:03 2019 (r347198) +++ stable/12/sbin/fsck_ffs/fsck.h Mon May 6 19:13:04 2019 (r347199) @@ -231,6 +231,7 @@ struct inodesc { ino_t id_parent; /* for DATA nodes, their parent */ ufs_lbn_t id_lbn; /* logical block number of current block */ ufs2_daddr_t id_blkno; /* current block number being examined */ + int id_level; /* level of indirection of this block */ int id_numfrags; /* number of frags contained in block */ ufs_lbn_t id_lballoc; /* pass1: last LBN that is allocated */ off_t id_filesize; /* for DATA nodes, the size of the directory */ Modified: stable/12/sbin/fsck_ffs/inode.c ============================================================================== --- stable/12/sbin/fsck_ffs/inode.c Mon May 6 19:08:03 2019 (r347198) +++ stable/12/sbin/fsck_ffs/inode.c Mon May 6 19:13:04 2019 (r347199) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); static ino_t startinum; -static int iblock(struct inodesc *, long ilevel, off_t isize, int type); +static int iblock(struct inodesc *, off_t isize, int type); int ckinode(union dinode *dp, struct inodesc *idesc) @@ -69,6 +69,8 @@ ckinode(union dinode *dp, struct inodesc *idesc) if (idesc->id_fix != IGNORE) idesc->id_fix = DONTKNOW; idesc->id_lbn = -1; + idesc->id_lballoc = -1; + idesc->id_level = 0; idesc->id_entryno = 0; idesc->id_filesize = DIP(dp, di_size); mode = DIP(dp, di_mode) & IFMT; @@ -121,9 +123,10 @@ ckinode(union dinode *dp, struct inodesc *idesc) sizepb = sblock.fs_bsize; for (i = 0; i < UFS_NIADDR; i++) { sizepb *= NINDIR(&sblock); + idesc->id_level = i + 1; if (DIP(&dino, di_ib[i])) { idesc->id_blkno = DIP(&dino, di_ib[i]); - ret = iblock(idesc, i + 1, remsize, BT_LEVEL1 + i); + ret = iblock(idesc, remsize, BT_LEVEL1 + i); if (ret & STOP) return (ret); } else if (remsize > 0) { @@ -153,7 +156,7 @@ ckinode(union dinode *dp, struct inodesc *idesc) } static int -iblock(struct inodesc *idesc, long ilevel, off_t isize, int type) +iblock(struct inodesc *idesc, off_t isize, int type) { struct bufarea *bp; int i, n, (*func)(struct inodesc *), nif; @@ -171,8 +174,8 @@ iblock(struct inodesc *idesc, long ilevel, off_t isize if (chkrange(idesc->id_blkno, idesc->id_numfrags)) return (SKIP); bp = getdatablk(idesc->id_blkno, sblock.fs_bsize, type); - ilevel--; - for (sizepb = sblock.fs_bsize, i = 0; i < ilevel; i++) + idesc->id_level--; + for (sizepb = sblock.fs_bsize, i = 0; i < idesc->id_level; i++) sizepb *= NINDIR(&sblock); if (howmany(isize, sizepb) > NINDIR(&sblock)) nif = NINDIR(&sblock); @@ -194,19 +197,21 @@ iblock(struct inodesc *idesc, long ilevel, off_t isize flush(fswritefd, bp); } for (i = 0; i < nif; i++) { - if (ilevel == 0) - idesc->id_lbn++; if (IBLK(bp, i)) { idesc->id_blkno = IBLK(bp, i); - if (ilevel == 0) + if (idesc->id_level == 0) { + idesc->id_lbn++; n = (*func)(idesc); - else - n = iblock(idesc, ilevel, isize, type); + } else { + n = iblock(idesc, isize, type); + idesc->id_level++; + } if (n & STOP) { bp->b_flags &= ~B_INUSE; return (n); } } else { + idesc->id_lbn += sizepb / sblock.fs_bsize; if (idesc->id_type == DATA && isize > 0) { /* An empty block in a directory XXX */ getpathname(pathbuf, idesc->id_number, Modified: stable/12/sbin/fsck_ffs/pass1.c ============================================================================== --- stable/12/sbin/fsck_ffs/pass1.c Mon May 6 19:08:03 2019 (r347198) +++ stable/12/sbin/fsck_ffs/pass1.c Mon May 6 19:13:04 2019 (r347199) @@ -378,7 +378,6 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r idesc->id_type = SNAP; else idesc->id_type = ADDR; - idesc->id_lballoc = -1; (void)ckinode(dp, idesc); if (sblock.fs_magic == FS_UFS2_MAGIC && dp->dp2.di_extsize > 0) { idesc->id_type = ADDR; @@ -565,7 +564,7 @@ pass1check(struct inodesc *idesc) */ idesc->id_entryno++; } - if (idesc->id_lballoc == -1 || idesc->id_lballoc < idesc->id_lbn) + if (idesc->id_level == 0 && idesc->id_lballoc < idesc->id_lbn) idesc->id_lballoc = idesc->id_lbn; return (res); } From owner-svn-src-all@freebsd.org Mon May 6 19:16:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C3C91593307; Mon, 6 May 2019 19:16:00 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F42385833; Mon, 6 May 2019 19:16:00 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8491B217; Mon, 6 May 2019 19:15:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46JFxQe004458; Mon, 6 May 2019 19:15:59 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46JFxBY004453; Mon, 6 May 2019 19:15:59 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905061915.x46JFxBY004453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 6 May 2019 19:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347200 - stable/11/sbin/fsck_ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sbin/fsck_ffs X-SVN-Commit-Revision: 347200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F42385833 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 19:16:00 -0000 Author: mckusick Date: Mon May 6 19:15:59 2019 New Revision: 347200 URL: https://svnweb.freebsd.org/changeset/base/347200 Log: MFC of 346185 Properly calculate last block of large sparse files. Sponsored by: Netflix Modified: stable/11/sbin/fsck_ffs/fsck.h stable/11/sbin/fsck_ffs/inode.c stable/11/sbin/fsck_ffs/pass1.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_ffs/fsck.h ============================================================================== --- stable/11/sbin/fsck_ffs/fsck.h Mon May 6 19:13:04 2019 (r347199) +++ stable/11/sbin/fsck_ffs/fsck.h Mon May 6 19:15:59 2019 (r347200) @@ -229,6 +229,7 @@ struct inodesc { ino_t id_parent; /* for DATA nodes, their parent */ ufs_lbn_t id_lbn; /* logical block number of current block */ ufs2_daddr_t id_blkno; /* current block number being examined */ + int id_level; /* level of indirection of this block */ int id_numfrags; /* number of frags contained in block */ ufs_lbn_t id_lballoc; /* pass1: last LBN that is allocated */ off_t id_filesize; /* for DATA nodes, the size of the directory */ Modified: stable/11/sbin/fsck_ffs/inode.c ============================================================================== --- stable/11/sbin/fsck_ffs/inode.c Mon May 6 19:13:04 2019 (r347199) +++ stable/11/sbin/fsck_ffs/inode.c Mon May 6 19:15:59 2019 (r347200) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); static ino_t startinum; -static int iblock(struct inodesc *, long ilevel, off_t isize, int type); +static int iblock(struct inodesc *, off_t isize, int type); int ckinode(union dinode *dp, struct inodesc *idesc) @@ -67,6 +67,8 @@ ckinode(union dinode *dp, struct inodesc *idesc) if (idesc->id_fix != IGNORE) idesc->id_fix = DONTKNOW; idesc->id_lbn = -1; + idesc->id_lballoc = -1; + idesc->id_level = 0; idesc->id_entryno = 0; idesc->id_filesize = DIP(dp, di_size); mode = DIP(dp, di_mode) & IFMT; @@ -119,9 +121,10 @@ ckinode(union dinode *dp, struct inodesc *idesc) sizepb = sblock.fs_bsize; for (i = 0; i < NIADDR; i++) { sizepb *= NINDIR(&sblock); + idesc->id_level = i + 1; if (DIP(&dino, di_ib[i])) { idesc->id_blkno = DIP(&dino, di_ib[i]); - ret = iblock(idesc, i + 1, remsize, BT_LEVEL1 + i); + ret = iblock(idesc, remsize, BT_LEVEL1 + i); if (ret & STOP) return (ret); } else if (remsize > 0) { @@ -151,7 +154,7 @@ ckinode(union dinode *dp, struct inodesc *idesc) } static int -iblock(struct inodesc *idesc, long ilevel, off_t isize, int type) +iblock(struct inodesc *idesc, off_t isize, int type) { struct bufarea *bp; int i, n, (*func)(struct inodesc *), nif; @@ -169,8 +172,8 @@ iblock(struct inodesc *idesc, long ilevel, off_t isize if (chkrange(idesc->id_blkno, idesc->id_numfrags)) return (SKIP); bp = getdatablk(idesc->id_blkno, sblock.fs_bsize, type); - ilevel--; - for (sizepb = sblock.fs_bsize, i = 0; i < ilevel; i++) + idesc->id_level--; + for (sizepb = sblock.fs_bsize, i = 0; i < idesc->id_level; i++) sizepb *= NINDIR(&sblock); if (howmany(isize, sizepb) > NINDIR(&sblock)) nif = NINDIR(&sblock); @@ -192,19 +195,21 @@ iblock(struct inodesc *idesc, long ilevel, off_t isize flush(fswritefd, bp); } for (i = 0; i < nif; i++) { - if (ilevel == 0) - idesc->id_lbn++; if (IBLK(bp, i)) { idesc->id_blkno = IBLK(bp, i); - if (ilevel == 0) + if (idesc->id_level == 0) { + idesc->id_lbn++; n = (*func)(idesc); - else - n = iblock(idesc, ilevel, isize, type); + } else { + n = iblock(idesc, isize, type); + idesc->id_level++; + } if (n & STOP) { bp->b_flags &= ~B_INUSE; return (n); } } else { + idesc->id_lbn += sizepb / sblock.fs_bsize; if (idesc->id_type == DATA && isize > 0) { /* An empty block in a directory XXX */ getpathname(pathbuf, idesc->id_number, Modified: stable/11/sbin/fsck_ffs/pass1.c ============================================================================== --- stable/11/sbin/fsck_ffs/pass1.c Mon May 6 19:13:04 2019 (r347199) +++ stable/11/sbin/fsck_ffs/pass1.c Mon May 6 19:15:59 2019 (r347200) @@ -376,7 +376,6 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r idesc->id_type = SNAP; else idesc->id_type = ADDR; - idesc->id_lballoc = -1; (void)ckinode(dp, idesc); if (sblock.fs_magic == FS_UFS2_MAGIC && dp->dp2.di_extsize > 0) { idesc->id_type = ADDR; @@ -563,7 +562,7 @@ pass1check(struct inodesc *idesc) */ idesc->id_entryno++; } - if (idesc->id_lballoc == -1 || idesc->id_lballoc < idesc->id_lbn) + if (idesc->id_level == 0 && idesc->id_lballoc < idesc->id_lbn) idesc->id_lballoc = idesc->id_lbn; return (res); } From owner-svn-src-all@freebsd.org Mon May 6 19:35:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DE6E15939B4; Mon, 6 May 2019 19:35:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21B9D86311; Mon, 6 May 2019 19:35:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ED85B570; Mon, 6 May 2019 19:35:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46JZUfN014798; Mon, 6 May 2019 19:35:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46JZUbW014797; Mon, 6 May 2019 19:35:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905061935.x46JZUbW014797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 May 2019 19:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347201 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 347201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 21B9D86311 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 19:35:31 -0000 Author: imp Date: Mon May 6 19:35:30 2019 New Revision: 347201 URL: https://svnweb.freebsd.org/changeset/base/347201 Log: Simplify boot1 allocation of handles. There's no need to pre-malloc the number of handles. Instead call LocateHandles twice, once to get the size, and once to get the data. Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Mon May 6 19:15:59 2019 (r347200) +++ head/stand/efi/boot1/boot1.c Mon May 6 19:35:30 2019 (r347201) @@ -47,8 +47,6 @@ static const boot_module_t *boot_modules[] = }; #define NUM_BOOT_MODULES nitems(boot_modules) -/* The initial number of handles used to query EFI for partitions. */ -#define NUM_HANDLES_INIT 24 static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; @@ -420,32 +418,17 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) BS->Exit(IH, EFI_OUT_OF_RESOURCES, 0, NULL); #endif - /* Get all the device handles */ - hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); + hsize = 0; + BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, + &hsize, NULL); handles = malloc(hsize); if (handles == NULL) - printf("Failed to allocate %d handles\n", NUM_HANDLES_INIT); - - status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, - &hsize, handles); - switch (status) { - case EFI_SUCCESS: - break; - case EFI_BUFFER_TOO_SMALL: - free(handles); - handles = malloc(hsize); - if (handles == NULL) - efi_panic(EFI_OUT_OF_RESOURCES, "Failed to allocate %d handles\n", - NUM_HANDLES_INIT); - status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, - NULL, &hsize, handles); - if (status != EFI_SUCCESS) - efi_panic(status, "Failed to get device handles\n"); - break; - default: + efi_panic(EFI_OUT_OF_RESOURCES, "Failed to allocate %d handles\n", + hsize); + status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, + NULL, &hsize, handles); + if (status != EFI_SUCCESS) efi_panic(status, "Failed to get device handles\n"); - break; - } /* Scan all partitions, probing with all modules. */ nhandles = hsize / sizeof(*handles); From owner-svn-src-all@freebsd.org Mon May 6 19:56:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC89B159439D; Mon, 6 May 2019 19:56:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 508D786EEA; Mon, 6 May 2019 19:56:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F0B3B8D5; Mon, 6 May 2019 19:56:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46JuDL4025608; Mon, 6 May 2019 19:56:13 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46JuD9L025607; Mon, 6 May 2019 19:56:13 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905061956.x46JuD9L025607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 6 May 2019 19:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347202 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 347202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 508D786EEA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 19:56:14 -0000 Author: dchagin Date: Mon May 6 19:56:13 2019 New Revision: 347202 URL: https://svnweb.freebsd.org/changeset/base/347202 Log: Complete r347052 (https://reviews.freebsd.org/D20137) as it it was not a final revision. Fix style issues and change bool-like variables from int to bool. Reviewed by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20141 Modified: head/sys/compat/linux/linux.c Modified: head/sys/compat/linux/linux.c ============================================================================== --- head/sys/compat/linux/linux.c Mon May 6 19:35:30 2019 (r347201) +++ head/sys/compat/linux/linux.c Mon May 6 19:56:13 2019 (r347202) @@ -227,21 +227,22 @@ ifname_linux_to_bsd(struct thread *td, const char *lxn struct ifnet *ifp; int len, unit; char *ep; - int is_eth, is_lo, index; + int index; + bool is_eth, is_lo; for (len = 0; len < LINUX_IFNAMSIZ; ++len) - if (!isalpha(lxname[len]) || lxname[len] == 0) + if (!isalpha(lxname[len]) || lxname[len] == '\0') break; if (len == 0 || len == LINUX_IFNAMSIZ) return (NULL); /* Linux loopback interface name is lo (not lo0) */ - is_lo = (len == 2 && !strncmp(lxname, "lo", len)) ? 1 : 0; + is_lo = (len == 2 && strncmp(lxname, "lo", len) == 0); unit = (int)strtoul(lxname + len, &ep, 10); if ((ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ) && is_lo == 0) return (NULL); index = 0; - is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0; + is_eth = (len == 3 && strncmp(lxname, "eth", len) == 0); CURVNET_SET(TD_TO_VNET(td)); IFNET_RLOCK(); From owner-svn-src-all@freebsd.org Mon May 6 19:57:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FF2D159443F; Mon, 6 May 2019 19:57:53 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6EF58705C; Mon, 6 May 2019 19:57:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89847B8DE; Mon, 6 May 2019 19:57:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46JvqCn025719; Mon, 6 May 2019 19:57:52 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46JvqP6025716; Mon, 6 May 2019 19:57:52 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905061957.x46JvqP6025716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 6 May 2019 19:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347203 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 347203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C6EF58705C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 19:57:53 -0000 Author: dchagin Date: Mon May 6 19:57:51 2019 New Revision: 347203 URL: https://svnweb.freebsd.org/changeset/base/347203 Log: Rewrite linux_ifflags() in more readable Linuxulator style. Reviewed by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20146 Modified: head/sys/compat/linux/linux.c head/sys/compat/linux/linux.h Modified: head/sys/compat/linux/linux.c ============================================================================== --- head/sys/compat/linux/linux.c Mon May 6 19:56:13 2019 (r347202) +++ head/sys/compat/linux/linux.c Mon May 6 19:57:51 2019 (r347203) @@ -269,16 +269,30 @@ ifname_linux_to_bsd(struct thread *td, const char *lxn void linux_ifflags(struct ifnet *ifp, short *flags) { + unsigned short fl; - *flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; - /* these flags have no Linux equivalent */ - *flags &= ~(IFF_DRV_OACTIVE|IFF_SIMPLEX| - IFF_LINK0|IFF_LINK1|IFF_LINK2); - /* Linux' multicast flag is in a different bit */ - if (*flags & IFF_MULTICAST) { - *flags &= ~IFF_MULTICAST; - *flags |= 0x1000; - } + fl = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; + *flags = 0; + if (fl & IFF_UP) + *flags |= LINUX_IFF_UP; + if (fl & IFF_BROADCAST) + *flags |= LINUX_IFF_BROADCAST; + if (fl & IFF_DEBUG) + *flags |= LINUX_IFF_DEBUG; + if (fl & IFF_LOOPBACK) + *flags |= LINUX_IFF_LOOPBACK; + if (fl & IFF_POINTOPOINT) + *flags |= LINUX_IFF_POINTOPOINT; + if (fl & IFF_DRV_RUNNING) + *flags |= LINUX_IFF_RUNNING; + if (fl & IFF_NOARP) + *flags |= LINUX_IFF_NOARP; + if (fl & IFF_PROMISC) + *flags |= LINUX_IFF_PROMISC; + if (fl & IFF_ALLMULTI) + *flags |= LINUX_IFF_ALLMULTI; + if (fl & IFF_MULTICAST) + *flags |= LINUX_IFF_MULTICAST; } int Modified: head/sys/compat/linux/linux.h ============================================================================== --- head/sys/compat/linux/linux.h Mon May 6 19:56:13 2019 (r347202) +++ head/sys/compat/linux/linux.h Mon May 6 19:57:51 2019 (r347203) @@ -46,6 +46,26 @@ struct l_sockaddr { #define LINUX_ARPHRD_ETHER 1 #define LINUX_ARPHRD_LOOPBACK 772 +/* + * net device flags + */ +#define LINUX_IFF_UP 0x0001 +#define LINUX_IFF_BROADCAST 0x0002 +#define LINUX_IFF_DEBUG 0x0004 +#define LINUX_IFF_LOOPBACK 0x0008 +#define LINUX_IFF_POINTOPOINT 0x0010 +#define LINUX_IFF_NOTRAILERS 0x0020 +#define LINUX_IFF_RUNNING 0x0040 +#define LINUX_IFF_NOARP 0x0080 +#define LINUX_IFF_PROMISC 0x0100 +#define LINUX_IFF_ALLMULTI 0x0200 +#define LINUX_IFF_MASTER 0x0400 +#define LINUX_IFF_SLAVE 0x0800 +#define LINUX_IFF_MULTICAST 0x1000 +#define LINUX_IFF_PORTSEL 0x2000 +#define LINUX_IFF_AUTOMEDIA 0x4000 +#define LINUX_IFF_DYNAMIC 0x8000 + /* sigaltstack */ #define LINUX_SS_ONSTACK 1 #define LINUX_SS_DISABLE 2 From owner-svn-src-all@freebsd.org Mon May 6 20:01:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1E161594540; Mon, 6 May 2019 20:01:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56E1D87278; Mon, 6 May 2019 20:01:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 172BABA25; Mon, 6 May 2019 20:01:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46K1DKT028934; Mon, 6 May 2019 20:01:13 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46K1Dpn028933; Mon, 6 May 2019 20:01:13 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905062001.x46K1Dpn028933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 6 May 2019 20:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347204 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 347204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56E1D87278 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:01:14 -0000 Author: dchagin Date: Mon May 6 20:01:13 2019 New Revision: 347204 URL: https://svnweb.freebsd.org/changeset/base/347204 Log: Adds sys/class/net devices to linsysfs. Only two interfaces are created eth0 and lo and they expose the following properties: address, addr_len, flags, ifindex, mty, tx_queue_len and type. Initial patch developed by Carlos Neira in 2017 and finished by me. PR: 223722 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13656 Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Mon May 6 19:57:51 2019 (r347203) +++ head/sys/compat/linsysfs/linsysfs.c Mon May 6 20:01:13 2019 (r347204) @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2006 IronPort Systems + * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -44,7 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include +#include #include #include @@ -64,6 +70,146 @@ atoi(const char *str) return (int)strtol(str, (char **)NULL, 10); } +static int +linsysfs_ifnet_addr(PFS_FILL_ARGS) +{ + struct l_sockaddr lsa; + struct ifnet *ifp; + + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); + if (ifp == NULL) + return (ENOENT); + if (linux_ifhwaddr(ifp, &lsa) != 0) + return (ENOENT); + sbuf_printf(sb, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n", + lsa.sa_data[0], lsa.sa_data[1], lsa.sa_data[2], + lsa.sa_data[3], lsa.sa_data[4], lsa.sa_data[5]); + return (0); +} + +static int +linsysfs_ifnet_addrlen(PFS_FILL_ARGS) +{ + + sbuf_printf(sb, "%d\n", LINUX_IFHWADDRLEN); + return (0); +} + +static int +linsysfs_ifnet_flags(PFS_FILL_ARGS) +{ + struct ifnet *ifp; + unsigned short flags; + + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); + if (ifp == NULL) + return (ENOENT); + linux_ifflags(ifp, &flags); + sbuf_printf(sb, "0x%x\n", flags); + return (0); +} + +static int +linsysfs_ifnet_ifindex(PFS_FILL_ARGS) +{ + struct ifnet *ifp; + + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); + if (ifp == NULL) + return (ENOENT); + sbuf_printf(sb, "%u\n", ifp->if_index); + return (0); +} + +static int +linsysfs_ifnet_mtu(PFS_FILL_ARGS) +{ + struct ifnet *ifp; + + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); + if (ifp == NULL) + return (ENOENT); + sbuf_printf(sb, "%u\n", ifp->if_mtu); + return (0); +} + +static int +linsysfs_ifnet_tx_queue_len(PFS_FILL_ARGS) +{ + + /* XXX */ + sbuf_printf(sb, "1000\n"); + return (0); +} + +static int +linsysfs_ifnet_type(PFS_FILL_ARGS) +{ + struct l_sockaddr lsa; + struct ifnet *ifp; + + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); + if (ifp == NULL) + return (ENOENT); + if (linux_ifhwaddr(ifp, &lsa) != 0) + return (ENOENT); + sbuf_printf(sb, "%d\n", lsa.sa_family); + return (0); +} + +static void +linsysfs_listnics(struct pfs_node *dir) +{ + struct pfs_node *nic; + struct pfs_node *lo; + + nic = pfs_create_dir(dir, "eth0", NULL, NULL, NULL, 0); + + pfs_create_file(nic, "address", &linsysfs_ifnet_addr, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "addr_len", &linsysfs_ifnet_addrlen, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "flags", &linsysfs_ifnet_flags, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "ifindex", &linsysfs_ifnet_ifindex, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "mtu", &linsysfs_ifnet_mtu, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "tx_queue_len", &linsysfs_ifnet_tx_queue_len, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(nic, "type", &linsysfs_ifnet_type, + NULL, NULL, NULL, PFS_RD); + + lo = pfs_create_dir(dir, "lo", NULL, NULL, NULL, 0); + + pfs_create_file(lo, "address", &linsysfs_ifnet_addr, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "addr_len", &linsysfs_ifnet_addrlen, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "flags", &linsysfs_ifnet_flags, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "ifindex", &linsysfs_ifnet_ifindex, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "mtu", &linsysfs_ifnet_mtu, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "tx_queue_len", &linsysfs_ifnet_tx_queue_len, + NULL, NULL, NULL, PFS_RD); + + pfs_create_file(lo, "type", &linsysfs_ifnet_type, + NULL, NULL, NULL, PFS_RD); +} + /* * Filler function for proc_name */ @@ -475,6 +621,7 @@ linsysfs_init(PFS_INIT_ARGS) struct pfs_node *drm; struct pfs_node *pci; struct pfs_node *scsi; + struct pfs_node *net; struct pfs_node *devdir, *chardev; devclass_t devclass; device_t dev; @@ -488,6 +635,9 @@ linsysfs_init(PFS_INIT_ARGS) scsi = pfs_create_dir(class, "scsi_host", NULL, NULL, NULL, 0); drm = pfs_create_dir(class, "drm", NULL, NULL, NULL, 0); + /* /sys/class/net/.. */ + net = pfs_create_dir(class, "net", NULL, NULL, NULL, 0); + /* /sys/dev/... */ devdir = pfs_create_dir(root, "dev", NULL, NULL, NULL, 0); chardev = pfs_create_dir(devdir, "char", NULL, NULL, NULL, 0); @@ -518,6 +668,7 @@ linsysfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, PFS_RD); linsysfs_listcpus(cpu); + linsysfs_listnics(net); return (0); } From owner-svn-src-all@freebsd.org Mon May 6 20:15:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B08841594A24; Mon, 6 May 2019 20:15:06 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E3D587B77; Mon, 6 May 2019 20:15:06 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00F82BDF1; Mon, 6 May 2019 20:15:05 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46KF5B2035996; Mon, 6 May 2019 20:15:05 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46KF0j8035968; Mon, 6 May 2019 20:15:00 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201905062015.x46KF0j8035968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Mon, 6 May 2019 20:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347205 - in vendor/Juniper/libxo/dist: . doc libxo tests/core tests/core/saved xo X-SVN-Group: vendor X-SVN-Commit-Author: phil X-SVN-Commit-Paths: in vendor/Juniper/libxo/dist: . doc libxo tests/core tests/core/saved xo X-SVN-Commit-Revision: 347205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E3D587B77 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:15:07 -0000 Author: phil Date: Mon May 6 20:15:00 2019 New Revision: 347205 URL: https://svnweb.freebsd.org/changeset/base/347205 Log: Import libxo 1.0.4 Modified: vendor/Juniper/libxo/dist/configure.ac vendor/Juniper/libxo/dist/doc/libxo-manual.html vendor/Juniper/libxo/dist/libxo/libxo.c vendor/Juniper/libxo/dist/libxo/xo_explicit.h vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.err vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.err vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.err vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.err vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.err vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.err vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.err vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.err vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.err vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out vendor/Juniper/libxo/dist/tests/core/test_01.c vendor/Juniper/libxo/dist/tests/core/test_02.c vendor/Juniper/libxo/dist/xo/xo.c Modified: vendor/Juniper/libxo/dist/configure.ac ============================================================================== --- vendor/Juniper/libxo/dist/configure.ac Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/configure.ac Mon May 6 20:15:00 2019 (r347205) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [1.0.2], [phil@juniper.net]) +AC_INIT([libxo], [1.0.4], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: vendor/Juniper/libxo/dist/doc/libxo-manual.html ============================================================================== --- vendor/Juniper/libxo/dist/doc/libxo-manual.html Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/doc/libxo-manual.html Mon May 6 20:15:00 2019 (r347205) @@ -22011,7 +22011,7 @@ jQuery(function ($) { -April 2, 2019 +April 24, 2019

    libxo: The Easy Way to Generate text, XML, JSON, and HTML output
    libxo-manual

    Modified: vendor/Juniper/libxo/dist/libxo/libxo.c ============================================================================== --- vendor/Juniper/libxo/dist/libxo/libxo.c Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/libxo/libxo.c Mon May 6 20:15:00 2019 (r347205) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018, Juniper Networks, Inc. + * Copyright (c) 2014-2019, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise @@ -600,7 +600,7 @@ xo_no_setlocale (void) static const char * xo_xml_leader_len (xo_handle_t *xop, const char *name, xo_ssize_t nlen) { - if (isalpha(name[0]) || name[0] == '_') + if (name == NULL || isalpha(name[0]) || name[0] == '_') return ""; xo_failure(xop, "invalid XML tag name: '%.*s'", nlen, name); Modified: vendor/Juniper/libxo/dist/libxo/xo_explicit.h ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_explicit.h Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/libxo/xo_explicit.h Mon May 6 20:15:00 2019 (r347205) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Juniper Networks, Inc. + * Copyright (c) 2019, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.err ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.err Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.err Mon May 6 20:15:00 2019 (r347205) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.out Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.out Mon May 6 20:15:00 2019 (r347205) @@ -1,6 +1,10 @@ op create: [] [] [0] op open_container: [top] [] [0x40010] op open_container: [data] [] [0x40010] +op string: [name] [em0] [0x1080] +op string: [flags] [0x8843] [0x18] +op string: [name] [em0] [0x1088] +op string: [flags] [0x8843] [0x18] op string: [what] [braces] [0] op string: [length] [abcdef] [0] op content: [fd] [-1] [0] Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.err ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.err Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.err Mon May 6 20:15:00 2019 (r347205) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.out Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.out Mon May 6 20:15:00 2019 (r347205) @@ -1,4 +1,4 @@ -
    We are
    {emit}
    {ting}
    some
    braces
    abcdef +
    em0
    em0
    We are
    {emit}
    {ting}
    some
    braces
    abcdef
    abcdef: Bad file descriptor
    improper use of profanity; ten yard penalty; first down
    length
    abcdef
    close
    -1
    returned
    Bad file descriptor
    good
    close
    -1
    returned
    Bad fi
    good
    improper use of profanity; ten yard penalty; first down Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.err ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.err Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.err Mon May 6 20:15:00 2019 (r347205) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.out Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.out Mon May 6 20:15:00 2019 (r347205) @@ -1,9 +1,11 @@
    +
    em0
    +
    em0
    We are
    {emit}
    {ting}
    some
    -
    braces
    +
    braces
    abcdef @@ -19,23 +21,23 @@
    length
    -
    abcdef
    +
    abcdef
    close
    -
    -1
    +
    -1
    returned
    -
    Bad file descriptor
    +
    Bad file descriptor
    -
    good
    +
    good
    close
    -
    -1
    +
    -1
    returned
    -
    Bad fi
    +
    Bad fi
    -
    good
    +
    good
    improper use of profanity; ten yard penalty; first down @@ -43,155 +45,155 @@
    -
    20
    +
    20
    -
    30
    +
    30
    -
    40
    +
    40
    -
    file
    +
    file
    -
    0
    +
    0
    bytes
    -
    1
    +
    1
    byte
    -
    2
    +
    2
    bytes
    -
    3
    +
    3
    bytes
    -
    4
    +
    4
    bytes
    -
    10
    +
    10
    /
    -
    20
    +
    20
    /
    -
    30
    +
    30
    mbufs <&> in use (current/cache/total)
    -
    50
    +
    50
    from
    -
    Boston
    +
    Boston
    -
    64
    +
    64
    left out of
    -
    640
    +
    640
    -
    64
    +
    64
    left out of
    -
    640
    +
    640
    beforeworkingafter:
    -
    string
    +
    string
    :
    -
    10
    -
    11
    +
    10
    +
    11
    -
    1010
    +
    1010
    packets here/there/everywhere
    -
    1010
    +
    1010
    packets here/there/everywhere
    (
    -
    15
    +
    15
    /
    -
    20
    +
    20
    /
    -
    125
    +
    125
    )
    (
    -
    15
    +
    15
    /
    -
    20
    +
    20
    /
    -
    125
    +
    125
    )
    (
    -
    15
    +
    15
    /
    -
    20
    +
    20
    /
    -
    125
    +
    125
    )
    (
    -
    15
    +
    15
    /
    -
    20
    +
    20
    /
    -
    125
    +
    125
    )
    Humanize:
    -
    21
    +
    21
    ,
    -
    57 K
    +
    57 K
    ,
    -
    96M
    +
    96M
    ,
    -
    44M
    +
    44M
    ,
    -
    1.2G
    +
    1.2G
    -
    one
    +
    one
    -
    two
    +
    two
    -
    three
    +
    three
    -
    (null)
    +
    (null)
    1:
    -
    1000
    +
    1000
    2:
    -
    test5000
    +
    test5000
    3:
    -
    ten-longx
    +
    ten-longx
    4:
    -
    xtest
    +
    xtest
    this is an error
    @@ -208,10 +210,10 @@
    V1/V2 packets
    :
    -
    10
    +
    10
    -
    0004
    +
    0004
    tries
    Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.err ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.err Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.err Mon May 6 20:15:00 2019 (r347205) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.out Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.out Mon May 6 20:15:00 2019 (r347205) @@ -1,4 +1,6 @@
    +
    em0
    +
    em0
    We are
    {emit}
    {ting}
    Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.err ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.err Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.err Mon May 6 20:15:00 2019 (r347205) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out Mon May 6 20:15:00 2019 (r347205) @@ -1 +1 @@ -{"top": {"data": {"what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}}} +{"top": {"data": {"name":"em0","flags":"0x8843","name":"em0","flags":"0x8843","what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! S he's a-pumpin' mud! <>!,\"!<>\n"}}}} Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.err ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.err Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.err Mon May 6 20:15:00 2019 (r347205) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out Mon May 6 20:15:00 2019 (r347205) @@ -1,6 +1,10 @@ { "top": { "data": { + "name": "em0", + "flags": "0x8843", + "name": "em0", + "flags": "0x8843", "what": "braces", "length": "abcdef", "fd": -1, Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.err ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.err Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.err Mon May 6 20:15:00 2019 (r347205) @@ -1 +1,2 @@ +test_02.test: key field emitted after normal value field: 'name' Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.out Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.out Mon May 6 20:15:00 2019 (r347205) @@ -1,4 +1,4 @@ -We are {emit}{ting} some braces +em0 em0 We are {emit}{ting} some braces abcdef abcdef: Bad file descriptor improper use of profanity; ten yard penalty; first down Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.err ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.err Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.err Mon May 6 20:15:00 2019 (r347205) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out Mon May 6 20:15:00 2019 (r347205) @@ -1,4 +1,4 @@ -bracesabcdef +em00x8843em00x8843bracesabcdef abcdef: Bad file descriptor improper use of profanity; ten yard penalty; first down abcdef-1Bad file descriptorgood-1Bad figoodimproper use of profanity; ten yard penalty; first down Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.err ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.err Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.err Mon May 6 20:15:00 2019 (r347205) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out Mon May 6 20:15:00 2019 (r347205) @@ -1,5 +1,9 @@ + em0 + 0x8843 + em0 + 0x8843 braces abcdef Modified: vendor/Juniper/libxo/dist/tests/core/test_01.c ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/test_01.c Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/test_01.c Mon May 6 20:15:00 2019 (r347205) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Juniper Networks, Inc. + * Copyright (c) 2014-2019, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise Modified: vendor/Juniper/libxo/dist/tests/core/test_02.c ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/test_02.c Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/tests/core/test_02.c Mon May 6 20:15:00 2019 (r347205) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Juniper Networks, Inc. + * Copyright (c) 2014-2019, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise @@ -47,6 +47,12 @@ main (int argc, char **argv) xo_open_container_h(NULL, "top"); xo_open_container("data"); + + xo_emit("{kt:name/%-*.*s}{eq:flags/0x%x}", + 5, 5, "em0", 34883); + + xo_emit("{d:/%-*.*s}{etk:name}{eq:flags/0x%x}", + 5, 5, "em0", "em0", 34883); xo_emit("We are {{emit}}{{ting}} some {:what}\n", "braces"); Modified: vendor/Juniper/libxo/dist/xo/xo.c ============================================================================== --- vendor/Juniper/libxo/dist/xo/xo.c Mon May 6 20:01:13 2019 (r347204) +++ vendor/Juniper/libxo/dist/xo/xo.c Mon May 6 20:15:00 2019 (r347205) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018, Juniper Networks, Inc. + * Copyright (c) 2014-2019, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise From owner-svn-src-all@freebsd.org Mon May 6 20:15:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1176F1594A4E; Mon, 6 May 2019 20:15:19 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB11187C6E; Mon, 6 May 2019 20:15:18 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F9CFBDF3; Mon, 6 May 2019 20:15:18 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46KFIA5036049; Mon, 6 May 2019 20:15:18 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46KFIEi036048; Mon, 6 May 2019 20:15:18 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201905062015.x46KFIEi036048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Mon, 6 May 2019 20:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347206 - vendor/Juniper/libxo/1.0.4 X-SVN-Group: vendor X-SVN-Commit-Author: phil X-SVN-Commit-Paths: vendor/Juniper/libxo/1.0.4 X-SVN-Commit-Revision: 347206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AB11187C6E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:15:19 -0000 Author: phil Date: Mon May 6 20:15:18 2019 New Revision: 347206 URL: https://svnweb.freebsd.org/changeset/base/347206 Log: Tag libxo 1.0.4 Added: - copied from r347205, vendor/Juniper/libxo/dist/ Directory Properties: vendor/Juniper/libxo/1.0.4/ (props changed) From owner-svn-src-all@freebsd.org Mon May 6 20:20:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 684CA1594B87; Mon, 6 May 2019 20:20:28 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFCF287F68; Mon, 6 May 2019 20:20:27 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A829BBDF8; Mon, 6 May 2019 20:20:27 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46KKROO036522; Mon, 6 May 2019 20:20:27 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46KKLGe036492; Mon, 6 May 2019 20:20:21 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201905062020.x46KKLGe036492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Mon, 6 May 2019 20:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347207 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/libxo/xo lib/libxo usr.bin/xohtml X-SVN-Group: head X-SVN-Commit-Author: phil X-SVN-Commit-Paths: in head: contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/libxo/xo lib/libxo usr.bin/xohtml X-SVN-Commit-Revision: 347207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CFCF287F68 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:20:28 -0000 Author: phil Date: Mon May 6 20:20:21 2019 New Revision: 347207 URL: https://svnweb.freebsd.org/changeset/base/347207 Log: Import libxo-1.0.4: - Avoid NULL deref in xo_xml_leader_len (replacing local fix in rS345967) - update copyright dates - update test cases - fix uncommitted version change Submitted by: phil MFC after: 2 weeks Modified: head/contrib/libxo/configure.ac head/contrib/libxo/doc/libxo-manual.html head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo_explicit.h head/contrib/libxo/tests/core/saved/test_02.E.err head/contrib/libxo/tests/core/saved/test_02.E.out head/contrib/libxo/tests/core/saved/test_02.H.err head/contrib/libxo/tests/core/saved/test_02.H.out head/contrib/libxo/tests/core/saved/test_02.HIPx.err head/contrib/libxo/tests/core/saved/test_02.HIPx.out head/contrib/libxo/tests/core/saved/test_02.HP.err head/contrib/libxo/tests/core/saved/test_02.HP.out head/contrib/libxo/tests/core/saved/test_02.J.err head/contrib/libxo/tests/core/saved/test_02.J.out head/contrib/libxo/tests/core/saved/test_02.JP.err head/contrib/libxo/tests/core/saved/test_02.JP.out head/contrib/libxo/tests/core/saved/test_02.T.err head/contrib/libxo/tests/core/saved/test_02.T.out head/contrib/libxo/tests/core/saved/test_02.X.err head/contrib/libxo/tests/core/saved/test_02.X.out head/contrib/libxo/tests/core/saved/test_02.XP.err head/contrib/libxo/tests/core/saved/test_02.XP.out head/contrib/libxo/tests/core/test_01.c head/contrib/libxo/tests/core/test_02.c head/contrib/libxo/xo/xo.c head/lib/libxo/add.man head/lib/libxo/xo_config.h head/usr.bin/xohtml/xohtml.sh Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/configure.ac Mon May 6 20:20:21 2019 (r347207) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [1.0.2], [phil@juniper.net]) +AC_INIT([libxo], [1.0.4], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: head/contrib/libxo/doc/libxo-manual.html ============================================================================== --- head/contrib/libxo/doc/libxo-manual.html Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/doc/libxo-manual.html Mon May 6 20:20:21 2019 (r347207) @@ -22011,7 +22011,7 @@ jQuery(function ($) { -April 2, 2019 +April 24, 2019

    libxo: The Easy Way to Generate text, XML, JSON, and HTML output
    libxo-manual

    Modified: head/contrib/libxo/libxo/libxo.c ============================================================================== --- head/contrib/libxo/libxo/libxo.c Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/libxo/libxo.c Mon May 6 20:20:21 2019 (r347207) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018, Juniper Networks, Inc. + * Copyright (c) 2014-2019, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise Modified: head/contrib/libxo/libxo/xo_explicit.h ============================================================================== --- head/contrib/libxo/libxo/xo_explicit.h Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/libxo/xo_explicit.h Mon May 6 20:20:21 2019 (r347207) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Juniper Networks, Inc. + * Copyright (c) 2019, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise Modified: head/contrib/libxo/tests/core/saved/test_02.E.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.E.err Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.E.err Mon May 6 20:20:21 2019 (r347207) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.E.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.E.out Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.E.out Mon May 6 20:20:21 2019 (r347207) @@ -1,6 +1,10 @@ op create: [] [] [0] op open_container: [top] [] [0x40010] op open_container: [data] [] [0x40010] +op string: [name] [em0] [0x1080] +op string: [flags] [0x8843] [0x18] +op string: [name] [em0] [0x1088] +op string: [flags] [0x8843] [0x18] op string: [what] [braces] [0] op string: [length] [abcdef] [0] op content: [fd] [-1] [0] Modified: head/contrib/libxo/tests/core/saved/test_02.H.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.H.err Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.H.err Mon May 6 20:20:21 2019 (r347207) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.H.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.H.out Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.H.out Mon May 6 20:20:21 2019 (r347207) @@ -1,4 +1,4 @@ -
    We are
    {emit}
    {ting}
    some
    braces
    abcdef +
    em0
    em0
    We are
    {emit}
    {ting}
    some
    braces
    abcdef
    abcdef: Bad file descriptor
    improper use of profanity; ten yard penalty; first down
    length
    abcdef
    close
    -1
    returned
    Bad file descriptor
    good
    close
    -1
    returned
    Bad fi
    good
    improper use of profanity; ten yard penalty; first down Modified: head/contrib/libxo/tests/core/saved/test_02.HIPx.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.HIPx.err Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.HIPx.err Mon May 6 20:20:21 2019 (r347207) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.HIPx.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.HIPx.out Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.HIPx.out Mon May 6 20:20:21 2019 (r347207) @@ -1,9 +1,11 @@
    +
    em0
    +
    em0
    We are
    {emit}
    {ting}
    some
    -
    braces
    +
    braces
    abcdef @@ -19,23 +21,23 @@
    length
    -
    abcdef
    +
    abcdef
    close
    -
    -1
    +
    -1
    returned
    -
    Bad file descriptor
    +
    Bad file descriptor
    -
    good
    +
    good
    close
    -
    -1
    +
    -1
    returned
    -
    Bad fi
    +
    Bad fi
    -
    good
    +
    good
    improper use of profanity; ten yard penalty; first down @@ -43,155 +45,155 @@
    -
    20
    +
    20
    -
    30
    +
    30
    -
    40
    +
    40
    -
    file
    +
    file
    -
    0
    +
    0
    bytes
    -
    1
    +
    1
    byte
    -
    2
    +
    2
    bytes
    -
    3
    +
    3
    bytes
    -
    4
    +
    4
    bytes
    -
    10
    +
    10
    /
    -
    20
    +
    20
    /
    -
    30
    +
    30
    mbufs <&> in use (current/cache/total)
    -
    50
    +
    50
    from
    -
    Boston
    +
    Boston
    -
    64
    +
    64
    left out of
    -
    640
    +
    640
    -
    64
    +
    64
    left out of
    -
    640
    +
    640
    beforeworkingafter:
    -
    string
    +
    string
    :
    -
    10
    -
    11
    +
    10
    +
    11
    -
    1010
    +
    1010
    packets here/there/everywhere
    -
    1010
    +
    1010
    packets here/there/everywhere
    (
    -
    15
    +
    15
    /
    -
    20
    +
    20
    /
    -
    125
    +
    125
    )
    (
    -
    15
    +
    15
    /
    -
    20
    +
    20
    /
    -
    125
    +
    125
    )
    (
    -
    15
    +
    15
    /
    -
    20
    +
    20
    /
    -
    125
    +
    125
    )
    (
    -
    15
    +
    15
    /
    -
    20
    +
    20
    /
    -
    125
    +
    125
    )
    Humanize:
    -
    21
    +
    21
    ,
    -
    57 K
    +
    57 K
    ,
    -
    96M
    +
    96M
    ,
    -
    44M
    +
    44M
    ,
    -
    1.2G
    +
    1.2G
    -
    one
    +
    one
    -
    two
    +
    two
    -
    three
    +
    three
    -
    (null)
    +
    (null)
    1:
    -
    1000
    +
    1000
    2:
    -
    test5000
    +
    test5000
    3:
    -
    ten-longx
    +
    ten-longx
    4:
    -
    xtest
    +
    xtest
    this is an error
    @@ -208,10 +210,10 @@
    V1/V2 packets
    :
    -
    10
    +
    10
    -
    0004
    +
    0004
    tries
    Modified: head/contrib/libxo/tests/core/saved/test_02.HP.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.HP.err Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.HP.err Mon May 6 20:20:21 2019 (r347207) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.HP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.HP.out Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.HP.out Mon May 6 20:20:21 2019 (r347207) @@ -1,4 +1,6 @@
    +
    em0
    +
    em0
    We are
    {emit}
    {ting}
    Modified: head/contrib/libxo/tests/core/saved/test_02.J.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.J.err Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.J.err Mon May 6 20:20:21 2019 (r347207) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.J.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.J.out Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.J.out Mon May 6 20:20:21 2019 (r347207) @@ -1 +1 @@ -{"top": {"data": {"what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}}} +{"top": {"data": {"name":"em0","flags":"0x8843","name":"em0","flags":"0x8843","what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! S he's a-pumpin' mud! <>!,\"!<>\n"}}}} Modified: head/contrib/libxo/tests/core/saved/test_02.JP.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.JP.err Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.JP.err Mon May 6 20:20:21 2019 (r347207) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.JP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.JP.out Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.JP.out Mon May 6 20:20:21 2019 (r347207) @@ -1,6 +1,10 @@ { "top": { "data": { + "name": "em0", + "flags": "0x8843", + "name": "em0", + "flags": "0x8843", "what": "braces", "length": "abcdef", "fd": -1, Modified: head/contrib/libxo/tests/core/saved/test_02.T.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.T.err Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.T.err Mon May 6 20:20:21 2019 (r347207) @@ -1 +1,2 @@ +test_02.test: key field emitted after normal value field: 'name' Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> Modified: head/contrib/libxo/tests/core/saved/test_02.T.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.T.out Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.T.out Mon May 6 20:20:21 2019 (r347207) @@ -1,4 +1,4 @@ -We are {emit}{ting} some braces +em0 em0 We are {emit}{ting} some braces abcdef abcdef: Bad file descriptor improper use of profanity; ten yard penalty; first down Modified: head/contrib/libxo/tests/core/saved/test_02.X.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.X.err Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.X.err Mon May 6 20:20:21 2019 (r347207) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.X.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.X.out Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.X.out Mon May 6 20:20:21 2019 (r347207) @@ -1,4 +1,4 @@ -bracesabcdef +em00x8843em00x8843bracesabcdef abcdef: Bad file descriptor improper use of profanity; ten yard penalty; first down abcdef-1Bad file descriptorgood-1Bad figoodimproper use of profanity; ten yard penalty; first down Modified: head/contrib/libxo/tests/core/saved/test_02.XP.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.XP.err Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.XP.err Mon May 6 20:20:21 2019 (r347207) @@ -0,0 +1 @@ +test_02.test: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.XP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.XP.out Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/saved/test_02.XP.out Mon May 6 20:20:21 2019 (r347207) @@ -1,5 +1,9 @@ + em0 + 0x8843 + em0 + 0x8843 braces abcdef Modified: head/contrib/libxo/tests/core/test_01.c ============================================================================== --- head/contrib/libxo/tests/core/test_01.c Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/test_01.c Mon May 6 20:20:21 2019 (r347207) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Juniper Networks, Inc. + * Copyright (c) 2014-2019, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise Modified: head/contrib/libxo/tests/core/test_02.c ============================================================================== --- head/contrib/libxo/tests/core/test_02.c Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/tests/core/test_02.c Mon May 6 20:20:21 2019 (r347207) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Juniper Networks, Inc. + * Copyright (c) 2014-2019, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise @@ -47,6 +47,12 @@ main (int argc, char **argv) xo_open_container_h(NULL, "top"); xo_open_container("data"); + + xo_emit("{kt:name/%-*.*s}{eq:flags/0x%x}", + 5, 5, "em0", 34883); + + xo_emit("{d:/%-*.*s}{etk:name}{eq:flags/0x%x}", + 5, 5, "em0", "em0", 34883); xo_emit("We are {{emit}}{{ting}} some {:what}\n", "braces"); Modified: head/contrib/libxo/xo/xo.c ============================================================================== --- head/contrib/libxo/xo/xo.c Mon May 6 20:15:18 2019 (r347206) +++ head/contrib/libxo/xo/xo.c Mon May 6 20:20:21 2019 (r347207) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018, Juniper Networks, Inc. + * Copyright (c) 2014-2019, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise Modified: head/lib/libxo/add.man ============================================================================== --- head/lib/libxo/add.man Mon May 6 20:15:18 2019 (r347206) +++ head/lib/libxo/add.man Mon May 6 20:20:21 2019 (r347207) @@ -3,10 +3,10 @@ .Fx uses .Nm libxo -version 0.9.0. +version 1.0.4. Complete documentation can be found on github: .Bd -literal -offset indent -http://juniper.github.io/libxo/0.9.0/libxo\-manual.html +http://juniper.github.io/libxo/1.0.4/libxo\-manual.html .Ed .Pp .Nm libxo Modified: head/lib/libxo/xo_config.h ============================================================================== --- head/lib/libxo/xo_config.h Mon May 6 20:15:18 2019 (r347206) +++ head/lib/libxo/xo_config.h Mon May 6 20:20:21 2019 (r347207) @@ -183,16 +183,16 @@ /* #undef LIBXO_TEXT_ONLY */ /* Version number as dotted value */ -#define LIBXO_VERSION "1.0.2" +#define LIBXO_VERSION "1.0.4" /* Version number extra information */ #define LIBXO_VERSION_EXTRA "" /* Version number as a number */ -#define LIBXO_VERSION_NUMBER 1000002 +#define LIBXO_VERSION_NUMBER 1000004 /* Version number as string */ -#define LIBXO_VERSION_STRING "1000002" +#define LIBXO_VERSION_STRING "1000004" /* Enable local wcwidth implementation */ #define LIBXO_WCWIDTH 1 @@ -210,7 +210,7 @@ #define PACKAGE_NAME "libxo" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxo 1.0.2" +#define PACKAGE_STRING "libxo 1.0.4" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxo" @@ -219,7 +219,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.0.2" +#define PACKAGE_VERSION "1.0.4" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -236,7 +236,7 @@ /* #undef USE_INT_RETURN_CODES */ /* Version number of package */ -#define VERSION "1.0.2" +#define VERSION "1.0.4" /* Retain hash bucket size */ /* #undef XO_RETAIN_SIZE */ Modified: head/usr.bin/xohtml/xohtml.sh ============================================================================== --- head/usr.bin/xohtml/xohtml.sh Mon May 6 20:15:18 2019 (r347206) +++ head/usr.bin/xohtml/xohtml.sh Mon May 6 20:20:21 2019 (r347207) @@ -12,7 +12,7 @@ # BASE=/usr/share/libxo -VERSION=1.0.2 +VERSION=1.0.4 CMD=cat DONE= WEB=http://juniper.github.io/libxo/${VERSION}/xohtml From owner-svn-src-all@freebsd.org Mon May 6 20:35:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 618FE15952FF; Mon, 6 May 2019 20:35:09 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7CEA88AE7; Mon, 6 May 2019 20:35:08 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x46KZ3BG008318; Mon, 6 May 2019 13:35:03 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x46KZ37X008317; Mon, 6 May 2019 13:35:03 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905062035.x46KZ37X008317@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347063 - head/sys/kern In-Reply-To: <20190506184502.GA35464@raichu> To: Mark Johnston Date: Mon, 6 May 2019 13:35:03 -0700 (PDT) CC: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B7CEA88AE7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.983,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:35:09 -0000 > On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: > > On 5/3/19 2:26 PM, Mark Johnston wrote: > > > Author: markj > > > Date: Fri May 3 21:26:44 2019 > > > New Revision: 347063 > > > URL: https://svnweb.freebsd.org/changeset/base/347063 > > > > > > Log: > > > Disallow excessively small times of day in clock_settime(2). > > > > > > Reported by: syzkaller > > > Reviewed by: cem, kib > > > MFC after: 1 week > > > Sponsored by: The FreeBSD Foundation > > > Differential Revision: https://reviews.freebsd.org/D20151 > > > > > > Modified: > > > head/sys/kern/kern_time.c > > > > > > Modified: head/sys/kern/kern_time.c > > > ============================================================================== > > > --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 (r347062) > > > +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 (r347063) > > > @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t clock_ > > > if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || > > > ats->tv_sec < 0) > > > return (EINVAL); > > > - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60) > > > + if (!allow_insane_settime && > > > + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || > > > + ats->tv_sec < utc_offset())) > > > return (EINVAL); > > > /* XXX Don't convert nsec->usec and back */ > > > TIMESPEC_TO_TIMEVAL(&atv, ats); > > > > Pardon my ignorance, but I can't see why you are checking against utc_offset() > > vs some small constant? None of the discussion in the review mentioned the > > reason for using this particular value, and I didn't see any comparisons > > against utc_offset or kernadjtz in kern_clock_setttime() or settime() that > > would have underflowed or panicked. Can you give a bit more detail on why > > utc_offset() is the lower bound? Thanks. > > I chose it because we subtract utc_offset() from the time passed in to > clock_settime(); see settime_task_func(). That subtraction caused the > underflow that later caused the observed panics. If the above conditional stays could the above go in a block comment near this check please? Doesn't this underflow actually indicate the settime is in the prior day and other stuff needs adjusted? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon May 6 20:40:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 828CB15953F8; Mon, 6 May 2019 20:40:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 266E888E21; Mon, 6 May 2019 20:40:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 786DC171A0; Mon, 6 May 2019 20:40:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r347063 - head/sys/kern To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905032126.x43LQilu092655@repo.freebsd.org> <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> <20190506184502.GA35464@raichu> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> Date: Mon, 6 May 2019 13:40:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190506184502.GA35464@raichu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 266E888E21 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:40:22 -0000 On 5/6/19 11:45 AM, Mark Johnston wrote: > On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: >> On 5/3/19 2:26 PM, Mark Johnston wrote: >>> Author: markj >>> Date: Fri May 3 21:26:44 2019 >>> New Revision: 347063 >>> URL: https://svnweb.freebsd.org/changeset/base/347063 >>> >>> Log: >>> Disallow excessively small times of day in clock_settime(2). >>> >>> Reported by: syzkaller >>> Reviewed by: cem, kib >>> MFC after: 1 week >>> Sponsored by: The FreeBSD Foundation >>> Differential Revision: https://reviews.freebsd.org/D20151 >>> >>> Modified: >>> head/sys/kern/kern_time.c >>> >>> Modified: head/sys/kern/kern_time.c >>> ============================================================================== >>> --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 (r347062) >>> +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 (r347063) >>> @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t clock_ >>> if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || >>> ats->tv_sec < 0) >>> return (EINVAL); >>> - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60) >>> + if (!allow_insane_settime && >>> + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || >>> + ats->tv_sec < utc_offset())) >>> return (EINVAL); >>> /* XXX Don't convert nsec->usec and back */ >>> TIMESPEC_TO_TIMEVAL(&atv, ats); >> >> Pardon my ignorance, but I can't see why you are checking against utc_offset() >> vs some small constant? None of the discussion in the review mentioned the >> reason for using this particular value, and I didn't see any comparisons >> against utc_offset or kernadjtz in kern_clock_setttime() or settime() that >> would have underflowed or panicked. Can you give a bit more detail on why >> utc_offset() is the lower bound? Thanks. > > I chose it because we subtract utc_offset() from the time passed in to > clock_settime(); see settime_task_func(). That subtraction caused the > underflow that later caused the observed panics. Ok, thanks. A few things I didn't see anyone else note in the review then: 1) This subtraction is actually not done for all rtc drivers, so it seems like we might block small times for RTC clocks that set CLOCKF_GETTIME_NO_ADJ. 2) utc_offset can be negative for machines using local time in timezones "before" UTC. I suppose we don't think any FreeBSD machines actually need to set the running clock to 0 anyway so fixing it here rather than rejecting invalid values only for RTCs that can't handle it is probably ok, but the connection doesn't feel obvious that we are rejecting times that might be non-representable in RTCs. -- John Baldwin From owner-svn-src-all@freebsd.org Mon May 6 20:41:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EFBA15955DE; Mon, 6 May 2019 20:41:57 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 062E68905E; Mon, 6 May 2019 20:41:57 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4CC3C2DF; Mon, 6 May 2019 20:41:56 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46KfufX051872; Mon, 6 May 2019 20:41:56 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46KfuSN051871; Mon, 6 May 2019 20:41:56 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201905062041.x46KfuSN051871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 6 May 2019 20:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347208 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 347208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 062E68905E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:41:57 -0000 Author: erj Date: Mon May 6 20:41:56 2019 New Revision: 347208 URL: https://svnweb.freebsd.org/changeset/base/347208 Log: MFC r340435: Prevent POLA violation with TSO/CSUM offload Sponsored by: Intel Corporation Modified: stable/11/sys/net/iflib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Mon May 6 20:20:21 2019 (r347207) +++ stable/11/sys/net/iflib.c Mon May 6 20:41:56 2019 (r347208) @@ -2844,9 +2844,6 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip->ip_p; pi->ipi_flags |= IPI_TX_IPV4; - if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) - ip->ip_sum = 0; - /* TCP checksum offload may require TCP header length */ if (IS_TX_OFFLOAD4(pi)) { if (__predict_true(pi->ipi_ipproto == IPPROTO_TCP)) { @@ -2863,6 +2860,10 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (IS_TSO4(pi)) { if (__predict_false(ip->ip_p != IPPROTO_TCP)) return (ENXIO); + /* + * TSO always requires hardware checksum offload. + */ + pi->ipi_csum_flags |= (CSUM_IP_TCP | CSUM_IP); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; @@ -2872,6 +2873,9 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, } } } + if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) + ip->ip_sum = 0; + break; } #endif @@ -2908,9 +2912,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) return (ENXIO); /* - * The corresponding flag is set by the stack in the IPv4 - * TSO case, but not in IPv6 (at least in FreeBSD 10.2). - * So, set it here because the rest of the flow requires it. + * TSO always requires hardware checksum offload. */ pi->ipi_csum_flags |= CSUM_IP6_TCP; th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); From owner-svn-src-all@freebsd.org Mon May 6 20:47:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C047D1595732 for ; Mon, 6 May 2019 20:47:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C2568947F for ; Mon, 6 May 2019 20:47:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82a.google.com with SMTP id d20so6459559qto.2 for ; Mon, 06 May 2019 13:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ybWFaXiyZKCXfCw7qKdzK1f2ADxUQzkIkyNOwnBwLis=; b=pWJoHFxiHblhWbSpzlzb7F5kGeqVSy9ewFWQ/PpcNxDok8w99/W/giqpDZXmeaDMiw F9g+MeEdVpRx4wDJjUGC4zT9NxcFvtDiZ4c+r3yUCQWxpETCnKzWrhgmmbeNE1EgrY3j j6QtRQOJSCsQotS+Mjadnx3nOXSrzpj+5mN6goOlzOf5e3tv7K1QK5dvYus1Zei4NUz7 lsfLKtCOdxXvyX+XhvGeChhjbnkOkG7k5jL2UnLlfgRZ0FvqL7sBvpO0M09DZswSC/dE nSJYEF2R/VnGzm6G2P5XrzUoFo2SxfQZfoSY+Lm+SEP0Ow/b/s++cD7Q2kGzXrANDNqz hNsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ybWFaXiyZKCXfCw7qKdzK1f2ADxUQzkIkyNOwnBwLis=; b=DAw7rLo0/tiVxmrTBWIXTvCfIELYSiILkmGUAvwrnqC+DRL1kKF9LKUh/SqwRzKFaz Alqhj2OBXmhLeZUgjOcogNVUf4F9k0qZj+kHEaFATaGZQCDlT28qEUhS6XidNByA1TmM QCJNLky2ARRWKP02V8f9Q1RPSZkcbUYxGuVJgX/1af/2I/bTM0irYgPxHUHx61yW9C3N wJGpGKLr4NWMUM2ecoB6or3KOTe6CxtSMkyEsWkG9HLQ36oIqj+22beZwLt2sli3E7nx gyhw5FmLipBATlrLAFdVUGQX16g5ZR3xg5y1UpPYjv8N9X7q8yZw25aScnmtXvBld/td 6j2A== X-Gm-Message-State: APjAAAW8UoCqsvoSomAd0HoHJKxvByLeExTeA29LxgXac4ffU38BISqj /pignUeTBS3dZyz4FvHZZHF2sYBiWJ+T5AcNjWs4tg== X-Google-Smtp-Source: APXvYqwkALJxj8FEn8HZuDThmywlrWmRSsozTtxYPNjlcRAy6tkm6Xc2RMaxdn0NdmVgzsOQPW5s2pfl27QGtwc6Ulc= X-Received: by 2002:ac8:28d0:: with SMTP id j16mr23757746qtj.15.1557175644676; Mon, 06 May 2019 13:47:24 -0700 (PDT) MIME-Version: 1.0 References: <201905032126.x43LQilu092655@repo.freebsd.org> <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> <20190506184502.GA35464@raichu> <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> In-Reply-To: <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> From: Warner Losh Date: Mon, 6 May 2019 14:47:13 -0600 Message-ID: Subject: Re: svn commit: r347063 - head/sys/kern To: John Baldwin Cc: Mark Johnston , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 5C2568947F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:47:26 -0000 On Mon, May 6, 2019 at 2:40 PM John Baldwin wrote: > On 5/6/19 11:45 AM, Mark Johnston wrote: > > On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: > >> On 5/3/19 2:26 PM, Mark Johnston wrote: > >>> Author: markj > >>> Date: Fri May 3 21:26:44 2019 > >>> New Revision: 347063 > >>> URL: https://svnweb.freebsd.org/changeset/base/347063 > >>> > >>> Log: > >>> Disallow excessively small times of day in clock_settime(2). > >>> > >>> Reported by: syzkaller > >>> Reviewed by: cem, kib > >>> MFC after: 1 week > >>> Sponsored by: The FreeBSD Foundation > >>> Differential Revision: https://reviews.freebsd.org/D20151 > >>> > >>> Modified: > >>> head/sys/kern/kern_time.c > >>> > >>> Modified: head/sys/kern/kern_time.c > >>> > ============================================================================== > >>> --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 > (r347062) > >>> +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 > (r347063) > >>> @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t > clock_ > >>> if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || > >>> ats->tv_sec < 0) > >>> return (EINVAL); > >>> - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 > * 60) > >>> + if (!allow_insane_settime && > >>> + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || > >>> + ats->tv_sec < utc_offset())) > >>> return (EINVAL); > >>> /* XXX Don't convert nsec->usec and back */ > >>> TIMESPEC_TO_TIMEVAL(&atv, ats); > >> > >> Pardon my ignorance, but I can't see why you are checking against > utc_offset() > >> vs some small constant? None of the discussion in the review mentioned > the > >> reason for using this particular value, and I didn't see any comparisons > >> against utc_offset or kernadjtz in kern_clock_setttime() or settime() > that > >> would have underflowed or panicked. Can you give a bit more detail on > why > >> utc_offset() is the lower bound? Thanks. > > > > I chose it because we subtract utc_offset() from the time passed in to > > clock_settime(); see settime_task_func(). That subtraction caused the > > underflow that later caused the observed panics. > > Ok, thanks. A few things I didn't see anyone else note in the review then: > > 1) This subtraction is actually not done for all rtc drivers, so it seems > like we might block small times for RTC clocks that set > CLOCKF_GETTIME_NO_ADJ. > 2) utc_offset can be negative for machines using local time in timezones > "before" UTC. > > I suppose we don't think any FreeBSD machines actually need to set the > running clock to 0 anyway so fixing it here rather than rejecting invalid > values only for RTCs that can't handle it is probably ok, but the > connection doesn't feel obvious that we are rejecting times that might > be non-representable in RTCs. > I'd be tempted to change utc_offset() to be "< 2 * 86400" personally, since that's the worst-case UTC offset and will cover all cases for people that want to run in 1970. Though honestly, we could also substitute in 946684800 (First second of 2000) as well, since who needs to run before 2000, right? Warner From owner-svn-src-all@freebsd.org Mon May 6 20:48:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80F9415957D2; Mon, 6 May 2019 20:48:28 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27B4C8969C; Mon, 6 May 2019 20:48:28 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03C43C318; Mon, 6 May 2019 20:48:28 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46KmRVH052400; Mon, 6 May 2019 20:48:27 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46KmRai052398; Mon, 6 May 2019 20:48:27 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201905062048.x46KmRai052398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 6 May 2019 20:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347210 - in stable/11/sys: dev/e1000 net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in stable/11/sys: dev/e1000 net X-SVN-Commit-Revision: 347210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27B4C8969C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:48:28 -0000 Author: erj Date: Mon May 6 20:48:27 2019 New Revision: 347210 URL: https://svnweb.freebsd.org/changeset/base/347210 Log: MFC r344817: Remove references to CONTIGMALLOC_WORKS in iflib and em Sponsored by: Intel Corporation Modified: stable/11/sys/dev/e1000/if_em.c stable/11/sys/net/iflib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/e1000/if_em.c ============================================================================== --- stable/11/sys/dev/e1000/if_em.c Mon May 6 20:46:58 2019 (r347209) +++ stable/11/sys/dev/e1000/if_em.c Mon May 6 20:48:27 2019 (r347210) @@ -1429,15 +1429,8 @@ em_init_locked(struct adapter *adapter) */ if (adapter->hw.mac.max_frame_size <= 2048) adapter->rx_mbuf_sz = MCLBYTES; -#ifndef CONTIGMALLOC_WORKS else adapter->rx_mbuf_sz = MJUMPAGESIZE; -#else - else if (adapter->hw.mac.max_frame_size <= 4096) - adapter->rx_mbuf_sz = MJUMPAGESIZE; - else - adapter->rx_mbuf_sz = MJUM9BYTES; -#endif /* Prepare receive descriptors and buffers */ if (em_setup_receive_structures(adapter)) { Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Mon May 6 20:46:58 2019 (r347209) +++ stable/11/sys/net/iflib.c Mon May 6 20:48:27 2019 (r347210) @@ -2048,17 +2048,8 @@ iflib_fl_setup(iflib_fl_t fl) */ if (sctx->isc_max_frame_size <= 2048) fl->ifl_buf_size = MCLBYTES; -#ifndef CONTIGMALLOC_WORKS else fl->ifl_buf_size = MJUMPAGESIZE; -#else - else if (sctx->isc_max_frame_size <= 4096) - fl->ifl_buf_size = MJUMPAGESIZE; - else if (sctx->isc_max_frame_size <= 9216) - fl->ifl_buf_size = MJUM9BYTES; - else - fl->ifl_buf_size = MJUM16BYTES; -#endif if (fl->ifl_buf_size > ctx->ifc_max_fl_buf_size) ctx->ifc_max_fl_buf_size = fl->ifl_buf_size; fl->ifl_cltype = m_gettype(fl->ifl_buf_size); From owner-svn-src-all@freebsd.org Mon May 6 20:53:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 323091595A0C; Mon, 6 May 2019 20:53:12 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A355089B0D; Mon, 6 May 2019 20:53:11 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x46Kr9cA008374; Mon, 6 May 2019 13:53:09 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x46Kr92u008373; Mon, 6 May 2019 13:53:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905062053.x46Kr92u008373@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347204 - head/sys/compat/linsysfs In-Reply-To: <201905062001.x46K1Dpn028933@repo.freebsd.org> To: Dmitry Chagin Date: Mon, 6 May 2019 13:53:09 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: A355089B0D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:53:12 -0000 > Author: dchagin > Date: Mon May 6 20:01:13 2019 > New Revision: 347204 > URL: https://svnweb.freebsd.org/changeset/base/347204 > > Log: > Adds sys/class/net devices to linsysfs. > > Only two interfaces are created eth0 and lo and they expose > the following properties: > address, addr_len, flags, ifindex, mty, tx_queue_len and type. > > Initial patch developed by Carlos Neira in 2017 and finished by me. > > PR: 223722 > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D13656 > > Modified: > head/sys/compat/linsysfs/linsysfs.c > > Modified: head/sys/compat/linsysfs/linsysfs.c > ============================================================================== > --- head/sys/compat/linsysfs/linsysfs.c Mon May 6 19:57:51 2019 (r347203) > +++ head/sys/compat/linsysfs/linsysfs.c Mon May 6 20:01:13 2019 (r347204) > @@ -2,6 +2,7 @@ > * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > * > * Copyright (c) 2006 IronPort Systems > + * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com > * All rights reserved. Inproper insertion of copyright, this seperates IronPort Systems from the All rights reserved clause, and makes it seem as if Carlos Neira is asserting it. That needs sorted out and resolved. Thanks, Rod > * > * Redistribution and use in source and binary forms, with or without > @@ -31,6 +32,7 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #include > #include > #include > @@ -44,7 +46,11 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > +#include > > +#include > +#include > #include > #include > > @@ -64,6 +70,146 @@ atoi(const char *str) > return (int)strtol(str, (char **)NULL, 10); > } > > +static int > +linsysfs_ifnet_addr(PFS_FILL_ARGS) > +{ > + struct l_sockaddr lsa; > + struct ifnet *ifp; > + > + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); > + if (ifp == NULL) > + return (ENOENT); > + if (linux_ifhwaddr(ifp, &lsa) != 0) > + return (ENOENT); > + sbuf_printf(sb, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n", > + lsa.sa_data[0], lsa.sa_data[1], lsa.sa_data[2], > + lsa.sa_data[3], lsa.sa_data[4], lsa.sa_data[5]); > + return (0); > +} > + > +static int > +linsysfs_ifnet_addrlen(PFS_FILL_ARGS) > +{ > + > + sbuf_printf(sb, "%d\n", LINUX_IFHWADDRLEN); > + return (0); > +} > + > +static int > +linsysfs_ifnet_flags(PFS_FILL_ARGS) > +{ > + struct ifnet *ifp; > + unsigned short flags; > + > + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); > + if (ifp == NULL) > + return (ENOENT); > + linux_ifflags(ifp, &flags); > + sbuf_printf(sb, "0x%x\n", flags); > + return (0); > +} > + > +static int > +linsysfs_ifnet_ifindex(PFS_FILL_ARGS) > +{ > + struct ifnet *ifp; > + > + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); > + if (ifp == NULL) > + return (ENOENT); > + sbuf_printf(sb, "%u\n", ifp->if_index); > + return (0); > +} > + > +static int > +linsysfs_ifnet_mtu(PFS_FILL_ARGS) > +{ > + struct ifnet *ifp; > + > + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); > + if (ifp == NULL) > + return (ENOENT); > + sbuf_printf(sb, "%u\n", ifp->if_mtu); > + return (0); > +} > + > +static int > +linsysfs_ifnet_tx_queue_len(PFS_FILL_ARGS) > +{ > + > + /* XXX */ > + sbuf_printf(sb, "1000\n"); > + return (0); > +} > + > +static int > +linsysfs_ifnet_type(PFS_FILL_ARGS) > +{ > + struct l_sockaddr lsa; > + struct ifnet *ifp; > + > + ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); > + if (ifp == NULL) > + return (ENOENT); > + if (linux_ifhwaddr(ifp, &lsa) != 0) > + return (ENOENT); > + sbuf_printf(sb, "%d\n", lsa.sa_family); > + return (0); > +} > + > +static void > +linsysfs_listnics(struct pfs_node *dir) > +{ > + struct pfs_node *nic; > + struct pfs_node *lo; > + > + nic = pfs_create_dir(dir, "eth0", NULL, NULL, NULL, 0); > + > + pfs_create_file(nic, "address", &linsysfs_ifnet_addr, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(nic, "addr_len", &linsysfs_ifnet_addrlen, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(nic, "flags", &linsysfs_ifnet_flags, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(nic, "ifindex", &linsysfs_ifnet_ifindex, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(nic, "mtu", &linsysfs_ifnet_mtu, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(nic, "tx_queue_len", &linsysfs_ifnet_tx_queue_len, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(nic, "type", &linsysfs_ifnet_type, > + NULL, NULL, NULL, PFS_RD); > + > + lo = pfs_create_dir(dir, "lo", NULL, NULL, NULL, 0); > + > + pfs_create_file(lo, "address", &linsysfs_ifnet_addr, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(lo, "addr_len", &linsysfs_ifnet_addrlen, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(lo, "flags", &linsysfs_ifnet_flags, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(lo, "ifindex", &linsysfs_ifnet_ifindex, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(lo, "mtu", &linsysfs_ifnet_mtu, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(lo, "tx_queue_len", &linsysfs_ifnet_tx_queue_len, > + NULL, NULL, NULL, PFS_RD); > + > + pfs_create_file(lo, "type", &linsysfs_ifnet_type, > + NULL, NULL, NULL, PFS_RD); > +} > + > /* > * Filler function for proc_name > */ > @@ -475,6 +621,7 @@ linsysfs_init(PFS_INIT_ARGS) > struct pfs_node *drm; > struct pfs_node *pci; > struct pfs_node *scsi; > + struct pfs_node *net; > struct pfs_node *devdir, *chardev; > devclass_t devclass; > device_t dev; > @@ -488,6 +635,9 @@ linsysfs_init(PFS_INIT_ARGS) > scsi = pfs_create_dir(class, "scsi_host", NULL, NULL, NULL, 0); > drm = pfs_create_dir(class, "drm", NULL, NULL, NULL, 0); > > + /* /sys/class/net/.. */ > + net = pfs_create_dir(class, "net", NULL, NULL, NULL, 0); > + > /* /sys/dev/... */ > devdir = pfs_create_dir(root, "dev", NULL, NULL, NULL, 0); > chardev = pfs_create_dir(devdir, "char", NULL, NULL, NULL, 0); > @@ -518,6 +668,7 @@ linsysfs_init(PFS_INIT_ARGS) > NULL, NULL, NULL, PFS_RD); > > linsysfs_listcpus(cpu); > + linsysfs_listnics(net); > > return (0); > } > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon May 6 20:56:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67E2B1595AD7; Mon, 6 May 2019 20:56:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15F4A89C8A; Mon, 6 May 2019 20:56:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9586C4DE; Mon, 6 May 2019 20:56:42 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46Kug9V057714; Mon, 6 May 2019 20:56:42 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46KugJT057711; Mon, 6 May 2019 20:56:42 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201905062056.x46KugJT057711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 6 May 2019 20:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347211 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 15F4A89C8A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:56:43 -0000 Author: marius Date: Mon May 6 20:56:41 2019 New Revision: 347211 URL: https://svnweb.freebsd.org/changeset/base/347211 Log: - Remove the unused ifc_link_irq and ifc_mtx_name members of struct iflib_ctx. - Remove the only ever written to ift_db_mtx_name member of struct iflib_txq. - Remove the unused or only ever written to ifr_size, ifr_cq_pidx, ifr_cq_gen and ifr_lro_enabled members of struct iflib_rxq. - Consistently spell DMA, RX and TX uppercase in comments, messages etc. instead of mixing with some lowercase variants. - Consistently use if_t instead of a mix of if_t and struct ifnet pointers. - Bring the function comments of _iflib_fl_refill(), iflib_rx_sds_free() and iflib_fl_setup() in line with reality. - Judging problem reports, people are wondering what on earth messages like: "TX(0) desc avail = 1024, pidx = 0" are trying to indicate. Thus, extend this string to be more like that of non-iflib(4) Ethernet MAC drivers, notifying about a watchdog timeout due to which the interface will be reset. - Take advantage of the M_HAS_VLANTAG macro. - Use false/true rather than FALSE/TRUE for variables of type bool. - Use FALLTHROUGH as advocated by style(9). Modified: head/sys/net/iflib.c head/sys/net/iflib.h head/sys/net/iflib_clone.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon May 6 20:48:27 2019 (r347210) +++ head/sys/net/iflib.c Mon May 6 20:56:41 2019 (r347211) @@ -172,7 +172,6 @@ struct iflib_ctx { uint32_t ifc_rx_mbuf_sz; int ifc_link_state; - int ifc_link_irq; int ifc_watchdog_events; struct cdev *ifc_led_dev; struct resource *ifc_msix_mem; @@ -210,10 +209,8 @@ struct iflib_ctx { eventhandler_tag ifc_vlan_attach_event; eventhandler_tag ifc_vlan_detach_event; struct ether_addr ifc_mac; - char ifc_mtx_name[16]; }; - void * iflib_get_softc(if_ctx_t ctx) { @@ -289,7 +286,6 @@ typedef struct iflib_sw_tx_desc_array { struct mbuf **ifsd_m; /* pkthdr mbufs */ } if_txsd_vec_t; - /* magic number that should be high enough for any hardware */ #define IFLIB_MAX_TX_SEGS 128 #define IFLIB_RX_COPY_THRESH 128 @@ -308,10 +304,10 @@ typedef struct iflib_sw_tx_desc_array { #define IFLIB_RESTART_BUDGET 8 - #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) + struct iflib_txq { qidx_t ift_in_use; qidx_t ift_cidx; @@ -361,7 +357,6 @@ struct iflib_txq { iflib_dma_info_t ift_ifdi; #define MTX_NAME_LEN 16 char ift_mtx_name[MTX_NAME_LEN]; - char ift_db_mtx_name[MTX_NAME_LEN]; bus_dma_segment_t ift_segs[IFLIB_MAX_TX_SEGS] __aligned(CACHE_LINE_SIZE); #ifdef IFLIB_DIAGNOSTICS uint64_t ift_cpu_exec_count[256]; @@ -424,25 +419,20 @@ get_inuse(int size, qidx_t cidx, qidx_t pidx, uint8_t ((head) >= (tail) ? (head) - (tail) : (wrap) - (tail) + (head)) struct iflib_rxq { - /* If there is a separate completion queue - - * these are the cq cidx and pidx. Otherwise - * these are unused. - */ - qidx_t ifr_size; - qidx_t ifr_cq_cidx; - qidx_t ifr_cq_pidx; - uint8_t ifr_cq_gen; - uint8_t ifr_fl_offset; - if_ctx_t ifr_ctx; iflib_fl_t ifr_fl; uint64_t ifr_rx_irq; struct pfil_head *pfil; + /* + * If there is a separate completion queue (IFLIB_HAS_RXCQ), this is + * the command queue consumer index. Otherwise it's unused. + */ + qidx_t ifr_cq_cidx; uint16_t ifr_id; - uint8_t ifr_lro_enabled; uint8_t ifr_nfl; uint8_t ifr_ntxqirq; uint8_t ifr_txqid[IFLIB_MAX_TX_SHARED_INTR]; + uint8_t ifr_fl_offset; struct lro_ctrl ifr_lc; struct grouptask ifr_task; struct iflib_filter_info ifr_filter_info; @@ -540,14 +530,11 @@ rxd_info_zero(if_rxd_info_t ri) #define CTX_UNLOCK(ctx) sx_xunlock(&(ctx)->ifc_ctx_sx) #define CTX_LOCK_DESTROY(ctx) sx_destroy(&(ctx)->ifc_ctx_sx) - #define STATE_LOCK_INIT(_sc, _name) mtx_init(&(_sc)->ifc_state_mtx, _name, "iflib state lock", MTX_DEF) #define STATE_LOCK(ctx) mtx_lock(&(ctx)->ifc_state_mtx) #define STATE_UNLOCK(ctx) mtx_unlock(&(ctx)->ifc_state_mtx) #define STATE_LOCK_DESTROY(ctx) mtx_destroy(&(ctx)->ifc_state_mtx) - - #define CALLOUT_LOCK(txq) mtx_lock(&txq->ift_mtx) #define CALLOUT_UNLOCK(txq) mtx_unlock(&txq->ift_mtx) @@ -610,15 +597,15 @@ static int iflib_fl_refills_large; static int iflib_tx_frees; SYSCTL_INT(_net_iflib, OID_AUTO, tx_seen, CTLFLAG_RD, - &iflib_tx_seen, 0, "# tx mbufs seen"); + &iflib_tx_seen, 0, "# TX mbufs seen"); SYSCTL_INT(_net_iflib, OID_AUTO, tx_sent, CTLFLAG_RD, - &iflib_tx_sent, 0, "# tx mbufs sent"); + &iflib_tx_sent, 0, "# TX mbufs sent"); SYSCTL_INT(_net_iflib, OID_AUTO, tx_encap, CTLFLAG_RD, - &iflib_tx_encap, 0, "# tx mbufs encapped"); + &iflib_tx_encap, 0, "# TX mbufs encapped"); SYSCTL_INT(_net_iflib, OID_AUTO, tx_frees, CTLFLAG_RD, - &iflib_tx_frees, 0, "# tx frees"); + &iflib_tx_frees, 0, "# TX frees"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_allocs, CTLFLAG_RD, - &iflib_rx_allocs, 0, "# rx allocations"); + &iflib_rx_allocs, 0, "# RX allocations"); SYSCTL_INT(_net_iflib, OID_AUTO, fl_refills, CTLFLAG_RD, &iflib_fl_refills, 0, "# refills"); SYSCTL_INT(_net_iflib, OID_AUTO, fl_refills_large, CTLFLAG_RD, @@ -664,7 +651,7 @@ static int iflib_verbose_debug; SYSCTL_INT(_net_iflib, OID_AUTO, task_fn_rx, CTLFLAG_RD, &iflib_task_fn_rxs, 0, "# task_fn_rx calls"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_intr_enables, CTLFLAG_RD, - &iflib_rx_intr_enables, 0, "# rx intr enables"); + &iflib_rx_intr_enables, 0, "# RX intr enables"); SYSCTL_INT(_net_iflib, OID_AUTO, fast_intrs, CTLFLAG_RD, &iflib_fast_intrs, 0, "# fast_intr calls"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_unavail, CTLFLAG_RD, @@ -768,13 +755,13 @@ SYSCTL_DECL(_dev_netmap); int iflib_crcstrip = 1; SYSCTL_INT(_dev_netmap, OID_AUTO, iflib_crcstrip, - CTLFLAG_RW, &iflib_crcstrip, 1, "strip CRC on rx frames"); + CTLFLAG_RW, &iflib_crcstrip, 1, "strip CRC on RX frames"); int iflib_rx_miss, iflib_rx_miss_bufs; SYSCTL_INT(_dev_netmap, OID_AUTO, iflib_rx_miss, - CTLFLAG_RW, &iflib_rx_miss, 0, "potentially missed rx intr"); + CTLFLAG_RW, &iflib_rx_miss, 0, "potentially missed RX intr"); SYSCTL_INT(_dev_netmap, OID_AUTO, iflib_rx_miss_bufs, - CTLFLAG_RW, &iflib_rx_miss_bufs, 0, "potentially missed rx intr bufs"); + CTLFLAG_RW, &iflib_rx_miss_bufs, 0, "potentially missed RX intr bufs"); /* * Register/unregister. We are already under netmap lock. @@ -783,7 +770,7 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, iflib_rx_miss_bufs, static int iflib_netmap_register(struct netmap_adapter *na, int onoff) { - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; if_ctx_t ctx = ifp->if_softc; int status; @@ -913,7 +900,7 @@ static int iflib_netmap_txsync(struct netmap_kring *kring, int flags) { struct netmap_adapter *na = kring->na; - struct ifnet *ifp = na->ifp; + if_t ifp = na->ifp; struct netmap_ring *ring = kring->ring; u_int nm_i; /* index into the netmap kring */ u_int nic_i; /* index into the NIC ring */ @@ -1061,6 +1048,7 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl { struct netmap_adapter *na = kring->na; struct netmap_ring *ring = kring->ring; + if_t ifp = na->ifp; iflib_fl_t fl; uint32_t nm_i; /* index into the netmap ring */ uint32_t nic_i; /* index into the NIC ring */ @@ -1070,7 +1058,6 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; struct if_rxd_info ri; - struct ifnet *ifp = na->ifp; if_ctx_t ctx = ifp->if_softc; iflib_rxq_t rxq = &ctx->ifc_rxqs[kring->ring_id]; if (head > lim) @@ -1154,8 +1141,7 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int fl static void iflib_netmap_intr(struct netmap_adapter *na, int onoff) { - struct ifnet *ifp = na->ifp; - if_ctx_t ctx = ifp->if_softc; + if_ctx_t ctx = na->ifp->if_softc; CTX_LOCK(ctx); if (onoff) { @@ -1929,13 +1915,13 @@ _rxq_refill_cb(void *arg, bus_dma_segment_t *segs, int } /** - * rxq_refill - refill an rxq free-buffer list - * @ctx: the iflib context - * @rxq: the free-list to refill - * @n: the number of new buffers to allocate + * _iflib_fl_refill - refill an rxq free-buffer list + * @ctx: the iflib context + * @fl: the free list to refill + * @count: the number of new buffers to allocate * - * (Re)populate an rxq free-buffer list with up to @n new packet buffers. - * The caller must assure that @n does not exceed the queue's capacity. + * (Re)populate an rxq free-buffer list with up to @count new packet buffers. + * The caller must assure that @count does not exceed the queue's capacity. */ static void _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int count) @@ -2088,6 +2074,7 @@ uint8_t iflib_in_detach(if_ctx_t ctx) { bool in_detach; + STATE_LOCK(ctx); in_detach = !!(ctx->ifc_flags & IFC_IN_DETACH); STATE_UNLOCK(ctx); @@ -2145,7 +2132,7 @@ iflib_fl_bufs_free(iflib_fl_t fl) /********************************************************************* * - * Initialize a receive ring and its buffers. + * Initialize a free list and its buffers. * **********************************************************************/ static int @@ -2228,13 +2215,12 @@ iflib_rx_sds_free(iflib_rxq_t rxq) } free(rxq->ifr_fl, M_IFLIB); rxq->ifr_fl = NULL; - rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; + rxq->ifr_cq_cidx = 0; } } /* - * MI independent logic - * + * Timer routine */ static void iflib_timer(void *arg) @@ -2247,6 +2233,7 @@ iflib_timer(void *arg) if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) return; + /* ** Check on the state of the TX queue(s), this ** can be done without the lock because its RO @@ -2276,9 +2263,11 @@ iflib_timer(void *arg) if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) callout_reset_on(&txq->ift_timer, reset_on, iflib_timer, txq, txq->ift_timer.c_cpu); return; + hung: - device_printf(ctx->ifc_dev, "TX(%d) desc avail = %d, pidx = %d\n", - txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx); + device_printf(ctx->ifc_dev, + "Watchdog timeout (TX: %d desc avail: %d pidx: %d) -- resetting\n", + txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx); STATE_LOCK(ctx); if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); ctx->ifc_flags |= (IFC_DO_WATCHDOG|IFC_DO_RESET); @@ -2304,6 +2293,7 @@ iflib_calc_rx_mbuf_sz(if_ctx_t ctx) uint32_t iflib_get_rx_mbuf_sz(if_ctx_t ctx) { + return (ctx->ifc_rx_mbuf_sz); } @@ -2318,7 +2308,6 @@ iflib_init_locked(if_ctx_t ctx) iflib_rxq_t rxq; int i, j, tx_ip_csum_flags, tx_ip6_csum_flags; - if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); IFDI_INTR_DISABLE(ctx); @@ -2447,7 +2436,7 @@ iflib_stop(if_ctx_t ctx) for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { /* make sure all transmitters have completed before proceeding XXX */ - rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; + rxq->ifr_cq_cidx = 0; for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); /* also resets the free lists pidx/cidx */ @@ -2733,6 +2722,7 @@ iflib_get_ip_forwarding(struct lro_ctrl *lc __unused, static bool iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) { + if_t ifp; if_ctx_t ctx = rxq->ifr_ctx; if_shared_ctx_t sctx = ctx->ifc_sctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; @@ -2741,7 +2731,6 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) struct if_rxd_info ri; int err, budget_left, rx_bytes, rx_pkts; iflib_fl_t fl; - struct ifnet *ifp; int lro_enabled; bool v4_forwarding, v6_forwarding, lro_possible; @@ -2792,10 +2781,8 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) *cidxp = ri.iri_cidx; /* Update our consumer index */ /* XXX NB: shurd - check if this is still safe */ - while (rxq->ifr_cq_cidx >= scctx->isc_nrxd[0]) { + while (rxq->ifr_cq_cidx >= scctx->isc_nrxd[0]) rxq->ifr_cq_cidx -= scctx->isc_nrxd[0]; - rxq->ifr_cq_gen = 0; - } /* was this only a completion queue message? */ if (__predict_false(ri.iri_nfrags == 0)) continue; @@ -3311,7 +3298,7 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) pi.ipi_qsidx = txq->ift_id; pi.ipi_len = m_head->m_pkthdr.len; pi.ipi_csum_flags = m_head->m_pkthdr.csum_flags; - pi.ipi_vtag = (m_head->m_flags & M_VLANTAG) ? m_head->m_pkthdr.ether_vtag : 0; + pi.ipi_vtag = M_HAS_VLANTAG(m_head) ? m_head->m_pkthdr.ether_vtag : 0; /* deliberate bitwise OR to make one condition */ if (__predict_true((pi.ipi_csum_flags | pi.ipi_vtag))) { @@ -3584,7 +3571,7 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, ui { iflib_txq_t txq = r->cookie; if_ctx_t ctx = txq->ift_ctx; - struct ifnet *ifp = ctx->ifc_ifp; + if_t ifp = ctx->ifc_ifp; struct mbuf **mp, *m; int i, count, consumed, pkt_sent, bytes_sent, mcast_sent, avail; int reclaimed, err, in_use_prev, desc_used; @@ -4099,18 +4086,18 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) #if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; #endif - bool avoid_reset = FALSE; + bool avoid_reset = false; int err = 0, reinit = 0, bits; switch (command) { case SIOCSIFADDR: #ifdef INET if (ifa->ifa_addr->sa_family == AF_INET) - avoid_reset = TRUE; + avoid_reset = true; #endif #ifdef INET6 if (ifa->ifa_addr->sa_family == AF_INET6) - avoid_reset = TRUE; + avoid_reset = true; #endif /* ** Calling init results in link renegotiation, @@ -4182,7 +4169,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) CTX_LOCK(ctx); IFDI_MEDIA_SET(ctx); CTX_UNLOCK(ctx); - /* falls thru */ + /* FALLTHROUGH */ case SIOCGIFMEDIA: case SIOCGIFXMEDIA: err = ifmedia_ioctl(ifp, ifr, ctx->ifc_mediap, command); @@ -4604,12 +4591,13 @@ iflib_device_register(device_t dev, void *sc, if_share main_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; /* XXX change for per-queue sizes */ - device_printf(dev, "Using %d tx descriptors and %d rx descriptors\n", + device_printf(dev, "Using %d TX descriptors and %d RX descriptors\n", scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); for (i = 0; i < sctx->isc_nrxqs; i++) { if (!powerof2(scctx->isc_nrxd[i])) { /* round down instead? */ - device_printf(dev, "# rx descriptors must be a power of 2\n"); + device_printf(dev, + "# RX descriptors must be a power of 2\n"); err = EINVAL; goto fail_iflib_detach; } @@ -4617,7 +4605,7 @@ iflib_device_register(device_t dev, void *sc, if_share for (i = 0; i < sctx->isc_ntxqs; i++) { if (!powerof2(scctx->isc_ntxd[i])) { device_printf(dev, - "# tx descriptors must be a power of 2"); + "# TX descriptors must be a power of 2"); err = EINVAL; goto fail_iflib_detach; } @@ -4871,12 +4859,13 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc main_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; /* XXX change for per-queue sizes */ - device_printf(dev, "Using %d tx descriptors and %d rx descriptors\n", + device_printf(dev, "Using %d TX descriptors and %d RX descriptors\n", scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); for (i = 0; i < sctx->isc_nrxqs; i++) { if (!powerof2(scctx->isc_nrxd[i])) { /* round down instead? */ - device_printf(dev, "# rx descriptors must be a power of 2\n"); + device_printf(dev, + "# RX descriptors must be a power of 2\n"); err = EINVAL; goto fail_iflib_detach; } @@ -4884,7 +4873,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc for (i = 0; i < sctx->isc_ntxqs; i++) { if (!powerof2(scctx->isc_ntxd[i])) { device_printf(dev, - "# tx descriptors must be a power of 2"); + "# TX descriptors must be a power of 2"); err = EINVAL; goto fail_iflib_detach; } @@ -5447,14 +5436,11 @@ iflib_queues_alloc(if_ctx_t ctx) } /* Initialize the TX lock */ - snprintf(txq->ift_mtx_name, MTX_NAME_LEN, "%s:tx(%d):callout", + snprintf(txq->ift_mtx_name, MTX_NAME_LEN, "%s:TX(%d):callout", device_get_nameunit(dev), txq->ift_id); mtx_init(&txq->ift_mtx, txq->ift_mtx_name, NULL, MTX_DEF); callout_init_mtx(&txq->ift_timer, &txq->ift_mtx, 0); - snprintf(txq->ift_db_mtx_name, MTX_NAME_LEN, "%s:tx(%d):db", - device_get_nameunit(dev), txq->ift_id); - err = ifmp_ring_alloc(&txq->ift_br, 2048, txq, iflib_txq_drain, iflib_txq_can_drain, M_IFLIB, M_WAITOK); if (err) { @@ -5634,7 +5620,6 @@ iflib_rx_structures_setup(if_ctx_t ctx) device_printf(ctx->ifc_dev, "LRO Initialization failed!\n"); goto fail; } - rxq->ifr_lro_enabled = TRUE; #endif IFDI_RXQ_SETUP(ctx, rxq->ifr_id); } @@ -5649,7 +5634,7 @@ fail: rxq = ctx->ifc_rxqs; for (i = 0; i < q; ++i, rxq++) { iflib_rx_sds_free(rxq); - rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; + rxq->ifr_cq_cidx = 0; } return (err); #endif @@ -6278,8 +6263,8 @@ iflib_msix_init(if_ctx_t ctx) rx_queues = min(rx_queues, tx_queues); } - device_printf(dev, "Using %d rx queues %d tx queues\n", - rx_queues, tx_queues); + device_printf(dev, "Using %d RX queues %d TX queues\n", rx_queues, + tx_queues); vectors = rx_queues + admincnt; if ((err = pci_alloc_msix(dev, &vectors)) == 0) { @@ -6433,10 +6418,10 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) "disable MSI-X (default 0)"); SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "rx_budget", CTLFLAG_RWTUN, &ctx->ifc_sysctl_rx_budget, 0, - "set the rx budget"); + "set the RX budget"); SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "tx_abdicate", CTLFLAG_RWTUN, &ctx->ifc_sysctl_tx_abdicate, 0, - "cause tx to abdicate instead of running to completion"); + "cause TX to abdicate instead of running to completion"); ctx->ifc_sysctl_core_offset = CORE_OFFSET_UNSPECIFIED; SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "core_offset", CTLFLAG_RDTUN, &ctx->ifc_sysctl_core_offset, 0, @@ -6449,11 +6434,11 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds", CTLTYPE_STRING|CTLFLAG_RWTUN, ctx, IFLIB_NTXD_HANDLER, mp_ndesc_handler, "A", - "list of # of tx descriptors to use, 0 = use default #"); + "list of # of TX descriptors to use, 0 = use default #"); SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_nrxds", CTLTYPE_STRING|CTLFLAG_RWTUN, ctx, IFLIB_NRXD_HANDLER, mp_ndesc_handler, "A", - "list of # of rx descriptors to use, 0 = use default #"); + "list of # of RX descriptors to use, 0 = use default #"); } static void @@ -6510,7 +6495,7 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) &txq->ift_no_desc_avail, "# of times no descriptors were available"); SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "tx_map_failed", CTLFLAG_RD, - &txq->ift_map_failed, "# of times dma map failed"); + &txq->ift_map_failed, "# of times DMA map failed"); SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "txd_encap_efbig", CTLFLAG_RD, &txq->ift_txd_encap_efbig, "# of times txd_encap returned EFBIG"); @@ -6570,9 +6555,6 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) CTLFLAG_RD, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); if (sctx->isc_flags & IFLIB_HAS_RXCQ) { - SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "rxq_cq_pidx", - CTLFLAG_RD, - &rxq->ifr_cq_pidx, 1, "Producer Index"); SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "rxq_cq_cidx", CTLFLAG_RD, &rxq->ifr_cq_cidx, 1, "Consumer Index"); @@ -6650,7 +6632,7 @@ iflib_fixup_rx(struct mbuf *m) #ifdef NETDUMP static void -iflib_netdump_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize) +iflib_netdump_init(if_t ifp, int *nrxr, int *ncl, int *clsize) { if_ctx_t ctx; @@ -6663,7 +6645,7 @@ iflib_netdump_init(struct ifnet *ifp, int *nrxr, int * } static void -iflib_netdump_event(struct ifnet *ifp, enum netdump_ev event) +iflib_netdump_event(if_t ifp, enum netdump_ev event) { if_ctx_t ctx; if_softc_ctx_t scctx; @@ -6691,7 +6673,7 @@ iflib_netdump_event(struct ifnet *ifp, enum netdump_ev } static int -iflib_netdump_transmit(struct ifnet *ifp, struct mbuf *m) +iflib_netdump_transmit(if_t ifp, struct mbuf *m) { if_ctx_t ctx; iflib_txq_t txq; @@ -6710,7 +6692,7 @@ iflib_netdump_transmit(struct ifnet *ifp, struct mbuf } static int -iflib_netdump_poll(struct ifnet *ifp, int count) +iflib_netdump_poll(if_t ifp, int count) { if_ctx_t ctx; if_softc_ctx_t scctx; Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Mon May 6 20:48:27 2019 (r347210) +++ head/sys/net/iflib.h Mon May 6 20:56:41 2019 (r347211) @@ -79,7 +79,7 @@ typedef struct if_rxd_info { /* XXX redundant with the new irf_len field */ uint16_t iri_len; /* packet length */ qidx_t iri_cidx; /* consumer index of cq */ - struct ifnet *iri_ifp; /* some drivers >1 interface per softc */ + if_t iri_ifp; /* driver may have >1 iface per softc */ /* updated by driver */ if_rxd_frag_t iri_frags; Modified: head/sys/net/iflib_clone.c ============================================================================== --- head/sys/net/iflib_clone.c Mon May 6 20:48:27 2019 (r347210) +++ head/sys/net/iflib_clone.c Mon May 6 20:56:41 2019 (r347211) @@ -153,16 +153,18 @@ iflib_ip_insert(if_pseudo_t ip) } static void -iflib_ifdetach(void *arg __unused, struct ifnet *ifp) +iflib_ifdetach(void *arg __unused, if_t ifp) { + /* If the ifnet is just being renamed, don't do anything. */ if (ifp->if_flags & IFF_RENAMING) return; } static void -iflib_iflladdr(void *arg __unused, struct ifnet *ifp) +iflib_iflladdr(void *arg __unused, if_t ifp __unused) { + } static int @@ -218,15 +220,15 @@ iflib_clone_create(struct if_clone *ifc, int unit, cad } static void -iflib_clone_destroy(struct ifnet *ifp) +iflib_clone_destroy(if_t ifp) { if_ctx_t ctx; device_t dev; struct sx *ctx_lock; int rc; + /* * Detach device / free / free unit - * */ ctx = if_getsoftc(ifp); dev = iflib_get_dev(ctx); From owner-svn-src-all@freebsd.org Mon May 6 20:57:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8A141595B8A; Mon, 6 May 2019 20:57:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x141.google.com (mail-it1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B35689E02; Mon, 6 May 2019 20:57:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x141.google.com with SMTP id q132so7527899itc.5; Mon, 06 May 2019 13:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pY1Lsrr8cI9kv057D2G/h8G26TB7RumQBtQgZ/8An0M=; b=f6xcW4Cez7TeWnWCLcxAii2ahxMIObrX42G75JQc69QIAJkNOWrGe+4DgBwv9G1Kk5 ERw54LTEZYCkE8UBfalHYiLfd9yLmU+iVEvzliRxdYdjQnSK/UFhOrAx9+oI4lCmhlwl XHatoBWRMz61w9QgSpObVpVCfrjJ7ODce/0ympSUlYJtz1jwxgwaHlypZpYhv4MXnduv 9MEjdl2XuCDyV5jeiriaoeajBR5mADyE7VyZoXfawpN+wzqMtlSlrRYFI6teL6NNMMW6 AvySz3L1LQB4G17RYhEuI7fV31wegUnsLYMKN321PAqy3sWml/W6eExHxHK51qJ7kgJa Iw8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=pY1Lsrr8cI9kv057D2G/h8G26TB7RumQBtQgZ/8An0M=; b=SeNUFx9yLYMNzH25LRJbbkOGb5LyJ2C+dHCPMHx4XnnT0A5pxXPlvEsFQ+XtXElt07 jdoKQOscrQ137XAZhTx4J8rQlDvWmlrZvqRnr2Qu54AyNJ2Rrg09yoHo7q+Faz0WZ3I3 O5voBC7eppcuqFn1mLk8df7JOqsZVvbnBug9E8yoNxNq6I+7J6CWG8Nhj6qsaK402Aka BNI9g3wSNIgGLPqG+wFgaXQaHiVaO2LtJYsjNGuShFG3yQUxESjpmcCWNBVdYPYqkZng VqeJaBo+ohz0tv2zy2xuy+/avz3pQqIUV6Yz8nO0eOoj7SjTgYZyC0VhfmxW3SLUqqsg AohQ== X-Gm-Message-State: APjAAAXXuszCZF6ChrWUfRuU5Kzf9U7tSiFPUcChj7SiJVQhNrN9ACtu A+PaQEaCrVhPl+V6Jv+pYykaMLBV X-Google-Smtp-Source: APXvYqyAx0Ndi1OwUA0w0JlSCU3EadNQx+4wCCyJlW9hTQbB7eaP4WtAkcZTfJ417278X51QS0Oliw== X-Received: by 2002:a05:6638:2a4:: with SMTP id d4mr20071281jaq.118.1557176268265; Mon, 06 May 2019 13:57:48 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-36-31.dsl.bell.ca. [69.159.36.31]) by smtp.gmail.com with ESMTPSA id k192sm1664042ite.36.2019.05.06.13.57.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2019 13:57:47 -0700 (PDT) Sender: Mark Johnston Date: Mon, 6 May 2019 16:57:43 -0400 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347063 - head/sys/kern Message-ID: <20190506205743.GA65083@raichu> References: <201905032126.x43LQilu092655@repo.freebsd.org> <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> <20190506184502.GA35464@raichu> <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 5B35689E02 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 20:57:50 -0000 On Mon, May 06, 2019 at 01:40:19PM -0700, John Baldwin wrote: > On 5/6/19 11:45 AM, Mark Johnston wrote: > > On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: > >> On 5/3/19 2:26 PM, Mark Johnston wrote: > >>> Author: markj > >>> Date: Fri May 3 21:26:44 2019 > >>> New Revision: 347063 > >>> URL: https://svnweb.freebsd.org/changeset/base/347063 > >>> > >>> Log: > >>> Disallow excessively small times of day in clock_settime(2). > >>> > >>> Reported by: syzkaller > >>> Reviewed by: cem, kib > >>> MFC after: 1 week > >>> Sponsored by: The FreeBSD Foundation > >>> Differential Revision: https://reviews.freebsd.org/D20151 > >>> > >>> Modified: > >>> head/sys/kern/kern_time.c > >>> > >>> Modified: head/sys/kern/kern_time.c > >>> ============================================================================== > >>> --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 (r347062) > >>> +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 (r347063) > >>> @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t clock_ > >>> if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || > >>> ats->tv_sec < 0) > >>> return (EINVAL); > >>> - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60) > >>> + if (!allow_insane_settime && > >>> + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || > >>> + ats->tv_sec < utc_offset())) > >>> return (EINVAL); > >>> /* XXX Don't convert nsec->usec and back */ > >>> TIMESPEC_TO_TIMEVAL(&atv, ats); > >> > >> Pardon my ignorance, but I can't see why you are checking against utc_offset() > >> vs some small constant? None of the discussion in the review mentioned the > >> reason for using this particular value, and I didn't see any comparisons > >> against utc_offset or kernadjtz in kern_clock_setttime() or settime() that > >> would have underflowed or panicked. Can you give a bit more detail on why > >> utc_offset() is the lower bound? Thanks. > > > > I chose it because we subtract utc_offset() from the time passed in to > > clock_settime(); see settime_task_func(). That subtraction caused the > > underflow that later caused the observed panics. > > Ok, thanks. A few things I didn't see anyone else note in the review then: > > 1) This subtraction is actually not done for all rtc drivers, so it seems > like we might block small times for RTC clocks that set > CLOCKF_GETTIME_NO_ADJ. The drivers that set NO_ADJ still account for the offset in their individual settime methods. I don't see how it can be correct for any driver to ignore adjkerntz? > 2) utc_offset can be negative for machines using local time in timezones > "before" UTC. Hmm, I believe the patch still handles this case? > I suppose we don't think any FreeBSD machines actually need to set the > running clock to 0 anyway so fixing it here rather than rejecting invalid > values only for RTCs that can't handle it is probably ok, but the > connection doesn't feel obvious that we are rejecting times that might > be non-representable in RTCs. I can add a comment explaining where the comment comes from, assuming there are no objections to keeping the existing change. The placement of the check was motivated by the placement of the pre-existing bounds check, and the fact that we have no good way to signal an error after setting the clock. From owner-svn-src-all@freebsd.org Mon May 6 21:03:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 547F91595FFB; Mon, 6 May 2019 21:03:14 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C41AC8A54D; Mon, 6 May 2019 21:03:13 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x46L3BJD008438; Mon, 6 May 2019 14:03:11 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x46L3BSW008437; Mon, 6 May 2019 14:03:11 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905062103.x46L3BSW008437@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347063 - head/sys/kern In-Reply-To: <20190506205743.GA65083@raichu> To: Mark Johnston Date: Mon, 6 May 2019 14:03:11 -0700 (PDT) CC: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: C41AC8A54D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.983,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 21:03:14 -0000 > On Mon, May 06, 2019 at 01:40:19PM -0700, John Baldwin wrote: > > On 5/6/19 11:45 AM, Mark Johnston wrote: > > > On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: > > >> On 5/3/19 2:26 PM, Mark Johnston wrote: > > >>> Author: markj > > >>> Date: Fri May 3 21:26:44 2019 > > >>> New Revision: 347063 > > >>> URL: https://svnweb.freebsd.org/changeset/base/347063 > > >>> > > >>> Log: > > >>> Disallow excessively small times of day in clock_settime(2). > > >>> > > >>> Reported by: syzkaller > > >>> Reviewed by: cem, kib > > >>> MFC after: 1 week > > >>> Sponsored by: The FreeBSD Foundation > > >>> Differential Revision: https://reviews.freebsd.org/D20151 > > >>> > > >>> Modified: > > >>> head/sys/kern/kern_time.c > > >>> > > >>> Modified: head/sys/kern/kern_time.c > > >>> ============================================================================== > > >>> --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 (r347062) > > >>> +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 (r347063) > > >>> @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t clock_ > > >>> if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || > > >>> ats->tv_sec < 0) > > >>> return (EINVAL); > > >>> - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60) > > >>> + if (!allow_insane_settime && > > >>> + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || > > >>> + ats->tv_sec < utc_offset())) > > >>> return (EINVAL); > > >>> /* XXX Don't convert nsec->usec and back */ > > >>> TIMESPEC_TO_TIMEVAL(&atv, ats); > > >> > > >> Pardon my ignorance, but I can't see why you are checking against utc_offset() > > >> vs some small constant? None of the discussion in the review mentioned the > > >> reason for using this particular value, and I didn't see any comparisons > > >> against utc_offset or kernadjtz in kern_clock_setttime() or settime() that > > >> would have underflowed or panicked. Can you give a bit more detail on why > > >> utc_offset() is the lower bound? Thanks. > > > > > > I chose it because we subtract utc_offset() from the time passed in to > > > clock_settime(); see settime_task_func(). That subtraction caused the > > > underflow that later caused the observed panics. > > > > Ok, thanks. A few things I didn't see anyone else note in the review then: > > > > 1) This subtraction is actually not done for all rtc drivers, so it seems > > like we might block small times for RTC clocks that set > > CLOCKF_GETTIME_NO_ADJ. > > The drivers that set NO_ADJ still account for the offset in their > individual settime methods. I don't see how it can be correct for any > driver to ignore adjkerntz? > > > 2) utc_offset can be negative for machines using local time in timezones > > "before" UTC. > > Hmm, I believe the patch still handles this case? It should, as for the negative utc_offset the subtract actually increases the value and thus no wrapping through 0 occurs. > > I suppose we don't think any FreeBSD machines actually need to set the > > running clock to 0 anyway so fixing it here rather than rejecting invalid > > values only for RTCs that can't handle it is probably ok, but the > > connection doesn't feel obvious that we are rejecting times that might > > be non-representable in RTCs. > > I can add a comment explaining where the comment comes from, assuming > there are no objections to keeping the existing change. The placement > of the check was motivated by the placement of the pre-existing bounds > check, and the fact that we have no good way to signal an error after > setting the clock. The later works for me. Would it make since to mark the code where the subtraction is done too, sighting the above code and comment? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon May 6 21:07:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35E3B15960A2 for ; Mon, 6 May 2019 21:07:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CFED8A6DC for ; Mon, 6 May 2019 21:07:18 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1557175865; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=iNhxQ71LSrAR2nCsmLrbfqMWUHxtrv9VZqEZUX8Y7+cIEg/paNndmZCaO0BVrUJbU0c/hm8SEoc0V d1Lvsp9sD+I89/pe3v1GuKO9RRKkkfHlHcb+o/lfZ1CUGhArOIfc52/d74AiSryd6fHdkeeWYyBq8c xAEHYajp5HnvS67GiqucxHN+PChHvNVYEOExAGZJm4EGDh9JDnFyc3gcR3psvgbZy/cO/RXppL7hJP fVfCaTF/nmGBAqUEmRthQ7VFeJwN52R41xho5GADaSbPR6sIK+9zDt2MnOVG7zJxTT2jgPlWiqTdBe hgYBvKWiXRyHv5G+lhI4eRvPiXz8ceA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=T2Pwja/1ULORC07zerU2Cp4LZZcNglmzFZidomVt12g=; b=FoQiRZ9sYCHgYSCuwtVa0gPmUVv1cKduE23zgDbqxkpm4SFHvDFPNblez4bpgRAAAATsI31Y6yLSp PLWG4BZgsG3DwoOXqN/FEIWq9wIHjVe5CBSCUX7L7DO33EeDq4ol6taFCChmZz6xFipkbX4fInpOM6 YZynA6C1MDw0L6d6daBals5SCnU1XyyZ7IQ8B2SWb+ukw+W1LI8f34HCtGkZ9I/OJULseXnNHPKZCr lSiv99IgRP1EZUeIUBg9SadfBkPIZDOmI+QJlsIlz1yK+HBrUQ1voZ8P8vS5PtydMWCACMXBilrMzH VT1FKfBJN9aAE8+H5DnPE36aoEnJQIQ== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=T2Pwja/1ULORC07zerU2Cp4LZZcNglmzFZidomVt12g=; b=TA/P9Sqz+4yEH6fCj4I2DdLcWXC8m1wbtItu41CzkM+5tiw/XqkngkLCJFvIqQPaagFyEiJenOfRB kiNESSHU5VIZJ0YmZ/QwxoD3hRiQC1YjB0wWkZ3J8yuoF3+HsnI7HM/3MUOyVE5MenLRQ0PYZwe0pA WrFP0fJq5RIHTuIuWrRevoTOC5WiTjxTdsic79DVO5Mek/omZnmhItvfvhUcLe/tZTlE5fWBmt2cBN Mo39t7nMPEN/45K0lo1pxoM9wkVFfO/O+QtFPNFlu/H7YB2zHvMCjYP9cA79rDswmcaLdCLDDp7awB AcdiFbEmmPxCsfNgHMiB5FMmC8d4xrw== X-MHO-RoutePath: aGlwcGll X-MHO-User: a7c1bf39-7040-11e9-908b-352056dbf2de X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id a7c1bf39-7040-11e9-908b-352056dbf2de; Mon, 06 May 2019 20:51:02 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x46Kp01N034062; Mon, 6 May 2019 14:51:00 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <2f2db4195cc199afd56d2089feed60d8ddbc75b3.camel@freebsd.org> Subject: Re: svn commit: r347063 - head/sys/kern From: Ian Lepore To: John Baldwin , Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 06 May 2019 14:51:00 -0600 In-Reply-To: <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> References: <201905032126.x43LQilu092655@repo.freebsd.org> <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> <20190506184502.GA35464@raichu> <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 9CFED8A6DC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 21:07:19 -0000 On Mon, 2019-05-06 at 13:40 -0700, John Baldwin wrote: > On 5/6/19 11:45 AM, Mark Johnston wrote: > > On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: > > > On 5/3/19 2:26 PM, Mark Johnston wrote: > > > > Author: markj > > > > Date: Fri May 3 21:26:44 2019 > > > > New Revision: 347063 > > > > URL: https://svnweb.freebsd.org/changeset/base/347063 > > > > > > > > Log: > > > > Disallow excessively small times of day in clock_settime(2). > > > > > > > > Reported by: syzkaller > > > > Reviewed by: cem, kib > > > > MFC after: 1 week > > > > Sponsored by: The FreeBSD Foundation > > > > Differential Revision: > > > > https://reviews.freebsd.org/D20151 > > > > > > > > Modified: > > > > head/sys/kern/kern_time.c > > > > > > > > Modified: head/sys/kern/kern_time.c > > > > =============================================================== > > > > =============== > > > > --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 > > > > (r347062) > > > > +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 > > > > (r347063) > > > > @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, > > > > clockid_t clock_ > > > > if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || > > > > ats->tv_sec < 0) > > > > return (EINVAL); > > > > - if (!allow_insane_settime && ats->tv_sec > 8000ULL * > > > > 365 * 24 * 60 * 60) > > > > + if (!allow_insane_settime && > > > > + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || > > > > + ats->tv_sec < utc_offset())) > > > > return (EINVAL); > > > > /* XXX Don't convert nsec->usec and back */ > > > > TIMESPEC_TO_TIMEVAL(&atv, ats); > > > > > > Pardon my ignorance, but I can't see why you are checking against > > > utc_offset() > > > vs some small constant? None of the discussion in the review > > > mentioned the > > > reason for using this particular value, and I didn't see any > > > comparisons > > > against utc_offset or kernadjtz in kern_clock_setttime() or > > > settime() that > > > would have underflowed or panicked. Can you give a bit more > > > detail on why > > > utc_offset() is the lower bound? Thanks. > > > > I chose it because we subtract utc_offset() from the time passed in > > to > > clock_settime(); see settime_task_func(). That subtraction caused > > the > > underflow that later caused the observed panics. > > Ok, thanks. A few things I didn't see anyone else note in the review > then: > > 1) This subtraction is actually not done for all rtc drivers, so it > seems > like we might block small times for RTC clocks that set > CLOCKF_GETTIME_NO_ADJ. The RTC drivers that use the NO_ADJ flag do so because they're doing the same utc offset adjustment themselves (usually after sleeping and then obtaining a fresh time after waking up). -- Ian > 2) utc_offset can be negative for machines using local time in > timezones > "before" UTC. > > I suppose we don't think any FreeBSD machines actually need to set > the > running clock to 0 anyway so fixing it here rather than rejecting > invalid > values only for RTCs that can't handle it is probably ok, but the > connection doesn't feel obvious that we are rejecting times that > might > be non-representable in RTCs. > I don't think this is specific to RTCs at all, I remember (vaguely) a discussion From owner-svn-src-all@freebsd.org Mon May 6 21:11:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0B6A15963FD; Mon, 6 May 2019 21:11:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 751428AB24; Mon, 6 May 2019 21:11:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id BFE1F174F4; Mon, 6 May 2019 21:11:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r347063 - head/sys/kern To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905032126.x43LQilu092655@repo.freebsd.org> <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> <20190506184502.GA35464@raichu> <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> <20190506205743.GA65083@raichu> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <85c51618-01ca-2005-388e-52762358320b@FreeBSD.org> Date: Mon, 6 May 2019 14:11:44 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190506205743.GA65083@raichu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 751428AB24 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 21:11:48 -0000 On 5/6/19 1:57 PM, Mark Johnston wrote: > On Mon, May 06, 2019 at 01:40:19PM -0700, John Baldwin wrote: >> On 5/6/19 11:45 AM, Mark Johnston wrote: >>> On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: >>>> On 5/3/19 2:26 PM, Mark Johnston wrote: >>>>> Author: markj >>>>> Date: Fri May 3 21:26:44 2019 >>>>> New Revision: 347063 >>>>> URL: https://svnweb.freebsd.org/changeset/base/347063 >>>>> >>>>> Log: >>>>> Disallow excessively small times of day in clock_settime(2). >>>>> >>>>> Reported by: syzkaller >>>>> Reviewed by: cem, kib >>>>> MFC after: 1 week >>>>> Sponsored by: The FreeBSD Foundation >>>>> Differential Revision: https://reviews.freebsd.org/D20151 >>>>> >>>>> Modified: >>>>> head/sys/kern/kern_time.c >>>>> >>>>> Modified: head/sys/kern/kern_time.c >>>>> ============================================================================== >>>>> --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 (r347062) >>>>> +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 (r347063) >>>>> @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t clock_ >>>>> if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || >>>>> ats->tv_sec < 0) >>>>> return (EINVAL); >>>>> - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60) >>>>> + if (!allow_insane_settime && >>>>> + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || >>>>> + ats->tv_sec < utc_offset())) >>>>> return (EINVAL); >>>>> /* XXX Don't convert nsec->usec and back */ >>>>> TIMESPEC_TO_TIMEVAL(&atv, ats); >>>> >>>> Pardon my ignorance, but I can't see why you are checking against utc_offset() >>>> vs some small constant? None of the discussion in the review mentioned the >>>> reason for using this particular value, and I didn't see any comparisons >>>> against utc_offset or kernadjtz in kern_clock_setttime() or settime() that >>>> would have underflowed or panicked. Can you give a bit more detail on why >>>> utc_offset() is the lower bound? Thanks. >>> >>> I chose it because we subtract utc_offset() from the time passed in to >>> clock_settime(); see settime_task_func(). That subtraction caused the >>> underflow that later caused the observed panics. >> >> Ok, thanks. A few things I didn't see anyone else note in the review then: >> >> 1) This subtraction is actually not done for all rtc drivers, so it seems >> like we might block small times for RTC clocks that set >> CLOCKF_GETTIME_NO_ADJ. > > The drivers that set NO_ADJ still account for the offset in their > individual settime methods. I don't see how it can be correct for any > driver to ignore adjkerntz? > >> 2) utc_offset can be negative for machines using local time in timezones >> "before" UTC. > > Hmm, I believe the patch still handles this case? Yes, it's just redundant as the earlier 'tv_sec < 0' check means we'll never see a value < utc_offset. One thought I had was similar to what Warner suggested of just using the max value of '24 * 60 * 60', though I suppose the maximal utc_offset is more like '12 * 60 * 60'? utc_offset is probably good enough as is. >> I suppose we don't think any FreeBSD machines actually need to set the >> running clock to 0 anyway so fixing it here rather than rejecting invalid >> values only for RTCs that can't handle it is probably ok, but the >> connection doesn't feel obvious that we are rejecting times that might >> be non-representable in RTCs. > > I can add a comment explaining where the comment comes from, assuming > there are no objections to keeping the existing change. The placement > of the check was motivated by the placement of the pre-existing bounds > check, and the fact that we have no good way to signal an error after > setting the clock. Well, one route we could have chosen would be to let the kernel run at a time the RTC can't represent and in that case we just don't rewrite the RTC and the time will reset to the RTC's time when we reboot. This would rely on the individual RTC drivers ignoring non-representable times in their settime methods. However, the fact that we already ignore times < 0 means we already have an arbitrary lower bound, so I ended up concluding that what you committed was fine. If you can think of a good comment to add that might be helpful to future readers. -- John Baldwin From owner-svn-src-all@freebsd.org Mon May 6 21:14:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AE661596541 for ; Mon, 6 May 2019 21:14:05 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDBD38ADB4 for ; Mon, 6 May 2019 21:14:04 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1557176272; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=knS7fgC/86RuCkawanYaTH4TouCUXFgNL0UzgNmZgBGhz2OS0iYGa6AZwwuHEX6D/YviqcNtn+b5U 6Fb+ofwpaQfmq8aSst6PBlEw9TgWiTSdIsw3TwGxPlz+rdB3C99g9/CY3Y3Q9vi335z608+sQrekJl V3lrgEv51fhQWhGY1h4jAwoHQsUR8ikK8R2EmWajsS3Q/MAGe0+UXOiJQ93Epyjsf4hLdvHUI4xlzF shq63KfPeX6QEsgBcKw8oFcO6e4RgHXrjmbKlEr9OcaWOTPTle3a7y3KgWDLlqAC4FU6TspdIhraPQ urrTT6va2gEbw7qvYxd/YShGYUQXxJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=HhAr9gGqIMeKjmWCBsi8aj5mopL5+cZxi6mBDV3dbNM=; b=gSTjIOaSpiBdrLIwWLxQkInmSXR+y0ygNKQKxrL3cQs8zqk6RPr9hrPHB/MyaBh0GKRrvQF84fyhR s+ytkH7MY60B05tezrJIRlh4h4DEE/kb7XNbjWWo+6udMy7oOvqAzcPxzn8EH6A9cAA61gEwMYy6pw qrGsdMROWwPkAisPt2gJz/7oJ3TCCU8HkmL3IvzPBFfADffzP+xDxJElMW+IkDwBTOMnAb0Hkezngh mQ30mQthNFly6PkhwlQPGCNBSEyjY+y4CZlyD7V5Yyvi9Iil508vhvxDukbTaREG95oJu2cg9vw7RM 6VOB6e6ImjsAUFcVPB5FqFk45FYXkNg== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=HhAr9gGqIMeKjmWCBsi8aj5mopL5+cZxi6mBDV3dbNM=; b=D6gzzgXMxyQVhMLzCIP5wLvSy87+UctS88x7LkNreeHb7Oe3KzOLtdaIN619SfVBXaz9iZvAznT6x +jX7vilITXg+2zwek6WTTZ2QpS2kW0r1LUxk0K18Lt6g2WoPw6KMox4KMuvqgyxQ5TT30dEPrAmES6 KrouzAYft+FiNNtIfVW1Woyd7iWeRr/AZcrwkE/+sFMtASnfFCOfx0dieIgdKE5SOzW8KNSgM3kpAs 2HjoVzOAIMzwHoKWQsphqoEVK2HFOGpTl0y0v4Xb+V52rsY0tWhfp/1LB9uVrMjpVoRNEg//5bIHB1 jMVctpJOuBUnPF2CFBwoZf9ajDybqtQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 98466a3b-7041-11e9-803b-31925da7267c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id 98466a3b-7041-11e9-803b-31925da7267c; Mon, 06 May 2019 20:57:46 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x46KvhCi034092; Mon, 6 May 2019 14:57:43 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <2317f6bdf0b9045fe137b5e9080b00de0da64678.camel@freebsd.org> Subject: Re: svn commit: r347063 - head/sys/kern From: Ian Lepore To: Warner Losh , John Baldwin Cc: Mark Johnston , src-committers , svn-src-all , svn-src-head Date: Mon, 06 May 2019 14:57:43 -0600 In-Reply-To: References: <201905032126.x43LQilu092655@repo.freebsd.org> <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> <20190506184502.GA35464@raichu> <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: BDBD38ADB4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 21:14:05 -0000 On Mon, 2019-05-06 at 14:47 -0600, Warner Losh wrote: > On Mon, May 6, 2019 at 2:40 PM John Baldwin wrote: > > > On 5/6/19 11:45 AM, Mark Johnston wrote: > > > On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: > > > > On 5/3/19 2:26 PM, Mark Johnston wrote: > > > > > Author: markj > > > > > Date: Fri May 3 21:26:44 2019 > > > > > New Revision: 347063 > > > > > URL: https://svnweb.freebsd.org/changeset/base/347063 > > > > > > > > > > Log: > > > > > Disallow excessively small times of day in clock_settime(2). > > > > > > > > > > Reported by: syzkaller > > > > > Reviewed by: cem, kib > > > > > MFC after: 1 week > > > > > Sponsored by: The FreeBSD Foundation > > > > > Differential Revision: https://reviews.freebsd.org/D20151 > > > > > > > > > > Modified: > > > > > head/sys/kern/kern_time.c > > > > > > > > > > Modified: head/sys/kern/kern_time.c > > > > > > > > > ============================================================================== > > > > > --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 > > > > (r347062) > > > > > +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 > > > > (r347063) > > > > > @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t > > > > clock_ > > > > > if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || > > > > > ats->tv_sec < 0) > > > > > return (EINVAL); > > > > > - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 > > > > * 60) > > > > > + if (!allow_insane_settime && > > > > > + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || > > > > > + ats->tv_sec < utc_offset())) > > > > > return (EINVAL); > > > > > /* XXX Don't convert nsec->usec and back */ > > > > > TIMESPEC_TO_TIMEVAL(&atv, ats); > > > > > > > > Pardon my ignorance, but I can't see why you are checking against > > > > utc_offset() > > > > vs some small constant? None of the discussion in the review mentioned > > > > the > > > > reason for using this particular value, and I didn't see any comparisons > > > > against utc_offset or kernadjtz in kern_clock_setttime() or settime() > > > > that > > > > would have underflowed or panicked. Can you give a bit more detail on > > > > why > > > > utc_offset() is the lower bound? Thanks. > > > > > > I chose it because we subtract utc_offset() from the time passed in to > > > clock_settime(); see settime_task_func(). That subtraction caused the > > > underflow that later caused the observed panics. > > > > Ok, thanks. A few things I didn't see anyone else note in the review then: > > > > 1) This subtraction is actually not done for all rtc drivers, so it seems > > like we might block small times for RTC clocks that set > > CLOCKF_GETTIME_NO_ADJ. > > 2) utc_offset can be negative for machines using local time in timezones > > "before" UTC. > > > > I suppose we don't think any FreeBSD machines actually need to set the > > running clock to 0 anyway so fixing it here rather than rejecting invalid > > values only for RTCs that can't handle it is probably ok, but the > > connection doesn't feel obvious that we are rejecting times that might > > be non-representable in RTCs. > > > > I'd be tempted to change utc_offset() to be "< 2 * 86400" personally, since > that's the worst-case UTC offset and will cover all cases for people that > want to run in 1970. Though honestly, we could also substitute in 946684800 > (First second of 2000) as well, since who needs to run before 2000, right? > > Warner I do. The first GPS epoch rollover was August 1999, and I've been known to use a gps simulator to drive the system through that event and make sure software handles it correctly. Now I'd probably be more likely to use the rollover that happened last month, but still... some people like to live in the past, at least in simulations. :) I wasn't even happy about the change that prevents setting time near the unix epoch. But, given that there is a tunable/sysctl to disable the sanity checks, it's probably not all that important; we can set debug.allow_insane_settime=1. -- Ian From owner-svn-src-all@freebsd.org Mon May 6 21:21:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9088B15967A1; Mon, 6 May 2019 21:21:16 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 358188B3F9; Mon, 6 May 2019 21:21:16 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12CDBC8B9; Mon, 6 May 2019 21:21:16 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46LLFem071510; Mon, 6 May 2019 21:21:15 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46LLFT4071507; Mon, 6 May 2019 21:21:15 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201905062121.x46LLFT4071507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 6 May 2019 21:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347212 - in stable/11/sys: net sys X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in stable/11/sys: net sys X-SVN-Commit-Revision: 347212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 358188B3F9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 21:21:16 -0000 Author: erj Date: Mon May 6 21:21:15 2019 New Revision: 347212 URL: https://svnweb.freebsd.org/changeset/base/347212 Log: MFC r345303, 345658, and partially MFC r345305 These are: r345303: prevent possible infinite loop in iflib_encap r345305: expose the Rx mbuf buffer size to drivers r345658: return ENETDOWN when the network device is down r345305 is only partially MFC'd with no mergeinfo because it includes changes to iflib-using drivers, and none of the drivers it changes use iflib in stable/11. This commit just makes the function it adds available for use with iflib-using kernel modules. Sponsored by: Intel Corporation Modified: stable/11/sys/net/iflib.c stable/11/sys/net/iflib.h stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Mon May 6 20:56:41 2019 (r347211) +++ stable/11/sys/net/iflib.c Mon May 6 21:21:15 2019 (r347212) @@ -176,6 +176,7 @@ struct iflib_ctx { uint32_t ifc_if_flags; uint32_t ifc_flags; uint32_t ifc_max_fl_buf_size; + uint32_t ifc_rx_mbuf_sz; int ifc_link_state; int ifc_link_irq; @@ -2033,7 +2034,6 @@ iflib_fl_setup(iflib_fl_t fl) { iflib_rxq_t rxq = fl->ifl_rxq; if_ctx_t ctx = rxq->ifr_ctx; - if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; bit_nclear(fl->ifl_rx_bitmap, 0, fl->ifl_size - 1); /* @@ -2042,14 +2042,7 @@ iflib_fl_setup(iflib_fl_t fl) iflib_fl_bufs_free(fl); /* Now replenish the mbufs */ MPASS(fl->ifl_credits == 0); - /* - * XXX don't set the max_frame_size to larger - * than the hardware can handle - */ - if (sctx->isc_max_frame_size <= 2048) - fl->ifl_buf_size = MCLBYTES; - else - fl->ifl_buf_size = MJUMPAGESIZE; + fl->ifl_buf_size = ctx->ifc_rx_mbuf_sz; if (fl->ifl_buf_size > ctx->ifc_max_fl_buf_size) ctx->ifc_max_fl_buf_size = fl->ifl_buf_size; fl->ifl_cltype = m_gettype(fl->ifl_buf_size); @@ -2151,6 +2144,27 @@ iflib_timer(void *arg) } static void +iflib_calc_rx_mbuf_sz(if_ctx_t ctx) +{ + if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; + + /* + * XXX don't set the max_frame_size to larger + * than the hardware can handle + */ + if (sctx->isc_max_frame_size <= MCLBYTES) + ctx->ifc_rx_mbuf_sz = MCLBYTES; + else + ctx->ifc_rx_mbuf_sz = MJUMPAGESIZE; +} + +uint32_t +iflib_get_rx_mbuf_sz(if_ctx_t ctx) +{ + return (ctx->ifc_rx_mbuf_sz); +} + +static void iflib_init_locked(if_ctx_t ctx) { if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; @@ -2184,6 +2198,14 @@ iflib_init_locked(if_ctx_t ctx) CALLOUT_UNLOCK(txq); iflib_netmap_txq_init(ctx, txq); } + + /* + * Calculate a suitable Rx mbuf size prior to calling IFDI_INIT, so + * that drivers can use the value when setting up the hardware receive + * buffers. + */ + iflib_calc_rx_mbuf_sz(ctx); + #ifdef INVARIANTS i = if_getdrvflags(ifp); #endif @@ -3251,9 +3273,14 @@ defrag: } if (remap == 1) m_head = m_defrag(*m_headp, M_NOWAIT); - remap++; - if (__predict_false(m_head == NULL)) + /* + * remap should never be >1 unless bus_dmamap_load_mbuf_sg + * failed to map an mbuf that was run through m_defrag + */ + MPASS(remap <= 1); + if (__predict_false(m_head == NULL || remap > 1)) goto defrag_failed; + remap++; txq->ift_mbuf_defrag++; *m_headp = m_head; goto retry; @@ -3825,7 +3852,7 @@ iflib_if_transmit(if_t ifp, struct mbuf *m) if (__predict_false((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || !LINK_ACTIVE(ctx))) { DBG_COUNTER_INC(tx_frees); m_freem(m); - return (ENOBUFS); + return (ENETDOWN); } MPASS(m->m_nextpkt == NULL); Modified: stable/11/sys/net/iflib.h ============================================================================== --- stable/11/sys/net/iflib.h Mon May 6 20:56:41 2019 (r347211) +++ stable/11/sys/net/iflib.h Mon May 6 21:21:15 2019 (r347212) @@ -345,6 +345,8 @@ void iflib_set_mac(if_ctx_t ctx, uint8_t mac[ETHER_ADD void iflib_request_reset(if_ctx_t ctx); uint8_t iflib_in_detach(if_ctx_t ctx); +uint32_t iflib_get_rx_mbuf_sz(if_ctx_t ctx); + /* * If the driver can plug cleanly in to newbus use these */ Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Mon May 6 20:56:41 2019 (r347211) +++ stable/11/sys/sys/param.h Mon May 6 21:21:15 2019 (r347212) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1102508 /* Master, propagated to newvers */ +#define __FreeBSD_version 1102509 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon May 6 21:25:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 762FB15969AE for ; Mon, 6 May 2019 21:25:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 165288B7D5 for ; Mon, 6 May 2019 21:25:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x830.google.com with SMTP id d13so16648790qth.5 for ; Mon, 06 May 2019 14:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/loTN5dadOPclcl0IpkLKCXqos51rM/PMqKBOulAdoo=; b=XaXnznmNtegNUvzKMKgUCtogKA7uMvzTGuVjTPHzS1ZATEioevDbYZpPghxr98Vxuq 6p2jCaFPGksgApwFPbD80q+jxWF25kmlvnP4rD5aP7cjVO9Hg07VwLnM2pkE88wVS8rH xuso64AycjCT92yAravKtdWZ32scmFpk5KBlV+V+bD2cRq6OfFAGQ2lpR1UL7niQLEc/ X10xpl0gY/UtpuJXMmseZqM9sMfMh3I2h+FaZ72HGOizCNNhj+sWBbT3f5MyKuFtsMbP Q4y5/by7wyJ/8zQPhfd230X5N3RUA7sjCiw/+ABRIfRBIIbwXVv/Eh5IkFI41rlkaOBQ n90A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/loTN5dadOPclcl0IpkLKCXqos51rM/PMqKBOulAdoo=; b=qKZY4kVj3aJHh1vWDZl9K3za6QsP9WI31zXwJc+EQoNLDrsK+c26THZMFKNMpgLS1B BYxiImbuBOzqp8P5r8Ma7T4nOYTjVcWnaoAIj92o83NQ6mnItuWOUzskwdzeeFoOz9Q+ d5FOdLY2LPzqNFq+bKHxmtyfh0NjtcOa3oeCpYFXce2bZnjLNh79lqNm4IaRl/foq7M9 zoiqfVBZzSLbRsyZOwHSTDrkkgXOVuoOfxlD3tejm/pOfaiknMTRHK5X21x048jXiBvc XN1L07AgDMWKOJ7XH8c9pEZ4rua4uPKdrfP2xecP/lvzEhbsw4bjR9UZvfx0tHONnTc5 yPEQ== X-Gm-Message-State: APjAAAXUVGS4BJeCtroryVCNqmlQkJ8Bxpma4xo3H1FFuI4kEeDskxoi AgqlfOIJQu00lMQVRFwOdHeyiT6J7JlvsytN0veFzA== X-Google-Smtp-Source: APXvYqw+lZMimrYX8VUBluD9gkRgq7IZYNGQ+IJw4BXPckZ6SeskpUSOY9A2iFSoX5rm7RvtMZXRIVl+cn7f6w5L7h8= X-Received: by 2002:a0c:ee25:: with SMTP id l5mr22177662qvs.153.1557177920398; Mon, 06 May 2019 14:25:20 -0700 (PDT) MIME-Version: 1.0 References: <201905032126.x43LQilu092655@repo.freebsd.org> <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> <20190506184502.GA35464@raichu> <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> <20190506205743.GA65083@raichu> <85c51618-01ca-2005-388e-52762358320b@FreeBSD.org> In-Reply-To: <85c51618-01ca-2005-388e-52762358320b@FreeBSD.org> From: Warner Losh Date: Mon, 6 May 2019 15:25:09 -0600 Message-ID: Subject: Re: svn commit: r347063 - head/sys/kern To: John Baldwin Cc: Mark Johnston , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 165288B7D5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.988,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 21:25:21 -0000 On Mon, May 6, 2019 at 3:11 PM John Baldwin wrote: > On 5/6/19 1:57 PM, Mark Johnston wrote: > > On Mon, May 06, 2019 at 01:40:19PM -0700, John Baldwin wrote: > >> On 5/6/19 11:45 AM, Mark Johnston wrote: > >>> On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: > >>>> On 5/3/19 2:26 PM, Mark Johnston wrote: > >>>>> Author: markj > >>>>> Date: Fri May 3 21:26:44 2019 > >>>>> New Revision: 347063 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/347063 > >>>>> > >>>>> Log: > >>>>> Disallow excessively small times of day in clock_settime(2). > >>>>> > >>>>> Reported by: syzkaller > >>>>> Reviewed by: cem, kib > >>>>> MFC after: 1 week > >>>>> Sponsored by: The FreeBSD Foundation > >>>>> Differential Revision: https://reviews.freebsd.org/D20151 > >>>>> > >>>>> Modified: > >>>>> head/sys/kern/kern_time.c > >>>>> > >>>>> Modified: head/sys/kern/kern_time.c > >>>>> > ============================================================================== > >>>>> --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 > (r347062) > >>>>> +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 > (r347063) > >>>>> @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t > clock_ > >>>>> if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || > >>>>> ats->tv_sec < 0) > >>>>> return (EINVAL); > >>>>> - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 > * 60) > >>>>> + if (!allow_insane_settime && > >>>>> + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || > >>>>> + ats->tv_sec < utc_offset())) > >>>>> return (EINVAL); > >>>>> /* XXX Don't convert nsec->usec and back */ > >>>>> TIMESPEC_TO_TIMEVAL(&atv, ats); > >>>> > >>>> Pardon my ignorance, but I can't see why you are checking against > utc_offset() > >>>> vs some small constant? None of the discussion in the review > mentioned the > >>>> reason for using this particular value, and I didn't see any > comparisons > >>>> against utc_offset or kernadjtz in kern_clock_setttime() or settime() > that > >>>> would have underflowed or panicked. Can you give a bit more detail > on why > >>>> utc_offset() is the lower bound? Thanks. > >>> > >>> I chose it because we subtract utc_offset() from the time passed in to > >>> clock_settime(); see settime_task_func(). That subtraction caused the > >>> underflow that later caused the observed panics. > >> > >> Ok, thanks. A few things I didn't see anyone else note in the review > then: > >> > >> 1) This subtraction is actually not done for all rtc drivers, so it > seems > >> like we might block small times for RTC clocks that set > >> CLOCKF_GETTIME_NO_ADJ. > > > > The drivers that set NO_ADJ still account for the offset in their > > individual settime methods. I don't see how it can be correct for any > > driver to ignore adjkerntz? > > > >> 2) utc_offset can be negative for machines using local time in timezones > >> "before" UTC. > > > > Hmm, I believe the patch still handles this case? > > Yes, it's just redundant as the earlier 'tv_sec < 0' check means we'll > never see a value < utc_offset. One thought I had was similar to what > Warner suggested of just using the max value of '24 * 60 * 60', though > I suppose the maximal utc_offset is more like '12 * 60 * 60'? utc_offset > is probably good enough as is. > The maximum UTC offset is closer to 15 hours due to that crazy international date line and different groups of islands wanting to be on one side or the other of the international date line. that's why I suggested 24 hours (if you read carefully, I typed * 2 for bogus reasons). Warner From owner-svn-src-all@freebsd.org Mon May 6 21:31:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E6901596D1B; Mon, 6 May 2019 21:31:04 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 055068BBCA; Mon, 6 May 2019 21:31:04 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4456CB8A; Mon, 6 May 2019 21:31:03 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46LV3g3075191; Mon, 6 May 2019 21:31:03 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46LV30W075187; Mon, 6 May 2019 21:31:03 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201905062131.x46LV30W075187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 6 May 2019 21:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347213 - in stable/11: share/man/man9 sys/net sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in stable/11: share/man/man9 sys/net sys/sys X-SVN-Commit-Revision: 347213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 055068BBCA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 21:31:04 -0000 Author: erj Date: Mon May 6 21:31:02 2019 New Revision: 347213 URL: https://svnweb.freebsd.org/changeset/base/347213 Log: MFC r345312: iflib: mark isc_driver_version as constant (Additional comment by erj: This also adds a new sysctl_add_oid macro, SYSCTL_ADD_CONST_STRING, for displaying const strings. This commit also includes an edit to the sysctl.9 man page for it.) Sponsored by: Intel Corporation Modified: stable/11/share/man/man9/sysctl.9 stable/11/sys/net/iflib.c stable/11/sys/net/iflib.h stable/11/sys/sys/sysctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/sysctl.9 ============================================================================== --- stable/11/share/man/man9/sysctl.9 Mon May 6 21:21:15 2019 (r347212) +++ stable/11/share/man/man9/sysctl.9 Mon May 6 21:31:02 2019 (r347213) @@ -42,6 +42,7 @@ .Nm SYSCTL_ADD_S32 , .Nm SYSCTL_ADD_S64 , .Nm SYSCTL_ADD_STRING , +.Nm SYSCTL_ADD_CONST_STRING , .Nm SYSCTL_ADD_STRUCT , .Nm SYSCTL_ADD_U8 , .Nm SYSCTL_ADD_U16 , @@ -67,6 +68,7 @@ .Nm SYSCTL_S32 , .Nm SYSCTL_S64 , .Nm SYSCTL_STRING , +.Nm SYSCTL_CONST_STRING , .Nm SYSCTL_STRUCT , .Nm SYSCTL_U8 , .Nm SYSCTL_U16 , @@ -211,6 +213,16 @@ .Fa "const char *descr" .Fc .Ft struct sysctl_oid * +.Fo SYSCTL_ADD_CONST_STRING +.Fa "struct sysctl_ctx_list *ctx" +.Fa "struct sysctl_oid_list *parent" +.Fa "int number" +.Fa "const char *name" +.Fa "int ctlflags" +.Fa "const char *ptr" +.Fa "const char *descr" +.Fc +.Ft struct sysctl_oid * .Fo SYSCTL_ADD_STRUCT .Fa "struct sysctl_ctx_list *ctx" .Fa "struct sysctl_oid_list *parent" @@ -335,6 +347,7 @@ .Fn SYSCTL_S32 parent number name ctlflags ptr val descr .Fn SYSCTL_S64 parent number name ctlflags ptr val descr .Fn SYSCTL_STRING parent number name ctlflags arg len descr +.Fn SYSCTL_CONST_STRING parent number name ctlflags arg descr .Fn SYSCTL_STRUCT parent number name ctlflags ptr struct_type descr .Fn SYSCTL_U8 parent number name ctlflags ptr val descr .Fn SYSCTL_U16 parent number name ctlflags ptr val descr @@ -484,6 +497,11 @@ If the .Fa len argument in zero, the string length is computed at every access to the OID using .Xr strlen 3 . +Use the +.Fn SYSCTL_CONST_STRING +macro or the +.Fn SYSCTL_ADD_CONST_STRING +function to add a sysctl for a constant string. .Sh CREATING OPAQUE SYSCTLS The .Fn SYSCTL_OPAQUE @@ -528,6 +546,7 @@ Static sysctls are declared using one of the .Fn SYSCTL_S32 , .Fn SYSCTL_S64 , .Fn SYSCTL_STRING , +.Fn SYSCTL_CONST_STRING , .Fn SYSCTL_STRUCT , .Fn SYSCTL_U8 , .Fn SYSCTL_U16 , @@ -552,6 +571,7 @@ Dynamic nodes are created using one of the .Fn SYSCTL_ADD_S32 , .Fn SYSCTL_ADD_S64 , .Fn SYSCTL_ADD_STRING , +.Fn SYSCTL_ADD_CONST_STRING , .Fn SYSCTL_ADD_STRUCT , .Fn SYSCTL_ADD_U8 , .Fn SYSCTL_ADD_U16 , Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Mon May 6 21:21:15 2019 (r347212) +++ stable/11/sys/net/iflib.c Mon May 6 21:31:02 2019 (r347213) @@ -5844,8 +5844,8 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) CTLFLAG_RD, NULL, "IFLIB fields"); oid_list = SYSCTL_CHILDREN(node); - SYSCTL_ADD_STRING(ctx_list, oid_list, OID_AUTO, "driver_version", - CTLFLAG_RD, ctx->ifc_sctx->isc_driver_version, 0, + SYSCTL_ADD_CONST_STRING(ctx_list, oid_list, OID_AUTO, "driver_version", + CTLFLAG_RD, ctx->ifc_sctx->isc_driver_version, "driver version"); SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "override_ntxqs", Modified: stable/11/sys/net/iflib.h ============================================================================== --- stable/11/sys/net/iflib.h Mon May 6 21:21:15 2019 (r347212) +++ stable/11/sys/net/iflib.h Mon May 6 21:31:02 2019 (r347213) @@ -242,7 +242,7 @@ struct if_shared_ctx { /* fields necessary for probe */ pci_vendor_info_t *isc_vendor_info; - char *isc_driver_version; + const char *isc_driver_version; /* optional function to transform the read values to match the table*/ void (*isc_parse_devinfo) (uint16_t *device_id, uint16_t *subvendor_id, uint16_t *subdevice_id, uint16_t *rev_id); Modified: stable/11/sys/sys/sysctl.h ============================================================================== --- stable/11/sys/sys/sysctl.h Mon May 6 21:21:15 2019 (r347212) +++ stable/11/sys/sys/sysctl.h Mon May 6 21:31:02 2019 (r347213) @@ -333,6 +333,24 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); __arg, len, sysctl_handle_string, "A", __DESCR(descr)); \ }) +/* Oid for a constant '\0' terminated string. */ +#define SYSCTL_CONST_STRING(parent, nbr, name, access, arg, descr) \ + SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \ + __DECONST(char *, arg), 0, sysctl_handle_string, "A", descr); \ + CTASSERT(!(access & CTLFLAG_WR)); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING) + +#define SYSCTL_ADD_CONST_STRING(ctx, parent, nbr, name, access, arg, descr) \ +({ \ + char *__arg = __DECONST(char *, arg); \ + CTASSERT(!(access & CTLFLAG_WR)); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_STRING); \ + sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_STRING|(access), \ + __arg, 0, sysctl_handle_string, "A", __DESCR(descr)); \ +}) + /* Oid for a bool. If ptr is NULL, val is returned. */ #define SYSCTL_NULL_BOOL_PTR ((bool *)NULL) #define SYSCTL_BOOL(parent, nbr, name, access, ptr, val, descr) \ From owner-svn-src-all@freebsd.org Mon May 6 22:12:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B39591597745; Mon, 6 May 2019 22:12:16 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 538F58CE7A; Mon, 6 May 2019 22:12:16 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31838D29C; Mon, 6 May 2019 22:12:16 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x46MCGKe000375; Mon, 6 May 2019 22:12:16 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x46MCGGO000374; Mon, 6 May 2019 22:12:16 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905062212.x46MCGGO000374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Douglas William Moore Date: Mon, 6 May 2019 22:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347214 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 538F58CE7A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2019 22:12:17 -0000 Author: dougm Date: Mon May 6 22:12:15 2019 New Revision: 347214 URL: https://svnweb.freebsd.org/changeset/base/347214 Log: The intention of the blist cursor is for the search for free blocks to resume where the last search left off. Suppose that there are no free blocks of size 32, but plenty of size 16. If we repeatedly request size 32 blocks, fail, and retry with size 16 blocks, then the failures all reset the cursor to the beginning of memory, making the 16 block allocation use a first fit, rather than next fit, strategy. This change has blist_alloc make a copy of the cursor for its own decision making, and only updates the real blist cursor after a successful allocation, making those 16 block searches behave like next-fit searches. Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D20177 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Mon May 6 21:31:02 2019 (r347213) +++ head/sys/kern/subr_blist.c Mon May 6 22:12:15 2019 (r347214) @@ -286,7 +286,7 @@ blist_destroy(blist_t bl) daddr_t blist_alloc(blist_t bl, daddr_t count) { - daddr_t blk; + daddr_t blk, cursor; if (count > BLIST_MAX_ALLOC) panic("allocation too large"); @@ -297,8 +297,9 @@ blist_alloc(blist_t bl, daddr_t count) * non-zero. When the cursor is zero, an allocation failure will * stop further iterations. */ + cursor = bl->bl_cursor; for (;;) { - blk = blst_meta_alloc(bl->bl_root, bl->bl_cursor, count, + blk = blst_meta_alloc(bl->bl_root, cursor, count, bl->bl_radix); if (blk != SWAPBLK_NONE) { bl->bl_avail -= count; @@ -306,9 +307,9 @@ blist_alloc(blist_t bl, daddr_t count) if (bl->bl_cursor == bl->bl_blocks) bl->bl_cursor = 0; return (blk); - } else if (bl->bl_cursor == 0) + } else if (cursor == 0) return (SWAPBLK_NONE); - bl->bl_cursor = 0; + cursor = 0; } } From owner-svn-src-all@freebsd.org Tue May 7 00:47:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 009531599D33; Tue, 7 May 2019 00:47:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A3646A1BC; Tue, 7 May 2019 00:47:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x470ldgN043694 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 7 May 2019 03:47:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x470ldgN043694 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x470ldL7043693; Tue, 7 May 2019 03:47:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 7 May 2019 03:47:39 +0300 From: Konstantin Belousov To: Kirk McKusick Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r347199 - stable/12/sbin/fsck_ffs Message-ID: <20190507004738.GN2748@kib.kiev.ua> References: <201905061913.x46JD44p004260@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905061913.x46JD44p004260@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 00:47:53 -0000 On Mon, May 06, 2019 at 07:13:04PM +0000, Kirk McKusick wrote: > Author: mckusick > Date: Mon May 6 19:13:04 2019 > New Revision: 347199 > URL: https://svnweb.freebsd.org/changeset/base/347199 > > Log: > MFC of 345758 I think this was an MFC of r346185. > > Properly flush outstanding I/Os when forcibly deleteing a memory disk device. > > Sponsored by: Netflix > > Modified: > stable/12/sbin/fsck_ffs/fsck.h > stable/12/sbin/fsck_ffs/inode.c > stable/12/sbin/fsck_ffs/pass1.c > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/sbin/fsck_ffs/fsck.h > ============================================================================== > --- stable/12/sbin/fsck_ffs/fsck.h Mon May 6 19:08:03 2019 (r347198) > +++ stable/12/sbin/fsck_ffs/fsck.h Mon May 6 19:13:04 2019 (r347199) > @@ -231,6 +231,7 @@ struct inodesc { > ino_t id_parent; /* for DATA nodes, their parent */ > ufs_lbn_t id_lbn; /* logical block number of current block */ > ufs2_daddr_t id_blkno; /* current block number being examined */ > + int id_level; /* level of indirection of this block */ > int id_numfrags; /* number of frags contained in block */ > ufs_lbn_t id_lballoc; /* pass1: last LBN that is allocated */ > off_t id_filesize; /* for DATA nodes, the size of the directory */ > > Modified: stable/12/sbin/fsck_ffs/inode.c > ============================================================================== > --- stable/12/sbin/fsck_ffs/inode.c Mon May 6 19:08:03 2019 (r347198) > +++ stable/12/sbin/fsck_ffs/inode.c Mon May 6 19:13:04 2019 (r347199) > @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); > > static ino_t startinum; > > -static int iblock(struct inodesc *, long ilevel, off_t isize, int type); > +static int iblock(struct inodesc *, off_t isize, int type); > > int > ckinode(union dinode *dp, struct inodesc *idesc) > @@ -69,6 +69,8 @@ ckinode(union dinode *dp, struct inodesc *idesc) > if (idesc->id_fix != IGNORE) > idesc->id_fix = DONTKNOW; > idesc->id_lbn = -1; > + idesc->id_lballoc = -1; > + idesc->id_level = 0; > idesc->id_entryno = 0; > idesc->id_filesize = DIP(dp, di_size); > mode = DIP(dp, di_mode) & IFMT; > @@ -121,9 +123,10 @@ ckinode(union dinode *dp, struct inodesc *idesc) > sizepb = sblock.fs_bsize; > for (i = 0; i < UFS_NIADDR; i++) { > sizepb *= NINDIR(&sblock); > + idesc->id_level = i + 1; > if (DIP(&dino, di_ib[i])) { > idesc->id_blkno = DIP(&dino, di_ib[i]); > - ret = iblock(idesc, i + 1, remsize, BT_LEVEL1 + i); > + ret = iblock(idesc, remsize, BT_LEVEL1 + i); > if (ret & STOP) > return (ret); > } else if (remsize > 0) { > @@ -153,7 +156,7 @@ ckinode(union dinode *dp, struct inodesc *idesc) > } > > static int > -iblock(struct inodesc *idesc, long ilevel, off_t isize, int type) > +iblock(struct inodesc *idesc, off_t isize, int type) > { > struct bufarea *bp; > int i, n, (*func)(struct inodesc *), nif; > @@ -171,8 +174,8 @@ iblock(struct inodesc *idesc, long ilevel, off_t isize > if (chkrange(idesc->id_blkno, idesc->id_numfrags)) > return (SKIP); > bp = getdatablk(idesc->id_blkno, sblock.fs_bsize, type); > - ilevel--; > - for (sizepb = sblock.fs_bsize, i = 0; i < ilevel; i++) > + idesc->id_level--; > + for (sizepb = sblock.fs_bsize, i = 0; i < idesc->id_level; i++) > sizepb *= NINDIR(&sblock); > if (howmany(isize, sizepb) > NINDIR(&sblock)) > nif = NINDIR(&sblock); > @@ -194,19 +197,21 @@ iblock(struct inodesc *idesc, long ilevel, off_t isize > flush(fswritefd, bp); > } > for (i = 0; i < nif; i++) { > - if (ilevel == 0) > - idesc->id_lbn++; > if (IBLK(bp, i)) { > idesc->id_blkno = IBLK(bp, i); > - if (ilevel == 0) > + if (idesc->id_level == 0) { > + idesc->id_lbn++; > n = (*func)(idesc); > - else > - n = iblock(idesc, ilevel, isize, type); > + } else { > + n = iblock(idesc, isize, type); > + idesc->id_level++; > + } > if (n & STOP) { > bp->b_flags &= ~B_INUSE; > return (n); > } > } else { > + idesc->id_lbn += sizepb / sblock.fs_bsize; > if (idesc->id_type == DATA && isize > 0) { > /* An empty block in a directory XXX */ > getpathname(pathbuf, idesc->id_number, > > Modified: stable/12/sbin/fsck_ffs/pass1.c > ============================================================================== > --- stable/12/sbin/fsck_ffs/pass1.c Mon May 6 19:08:03 2019 (r347198) > +++ stable/12/sbin/fsck_ffs/pass1.c Mon May 6 19:13:04 2019 (r347199) > @@ -378,7 +378,6 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r > idesc->id_type = SNAP; > else > idesc->id_type = ADDR; > - idesc->id_lballoc = -1; > (void)ckinode(dp, idesc); > if (sblock.fs_magic == FS_UFS2_MAGIC && dp->dp2.di_extsize > 0) { > idesc->id_type = ADDR; > @@ -565,7 +564,7 @@ pass1check(struct inodesc *idesc) > */ > idesc->id_entryno++; > } > - if (idesc->id_lballoc == -1 || idesc->id_lballoc < idesc->id_lbn) > + if (idesc->id_level == 0 && idesc->id_lballoc < idesc->id_lbn) > idesc->id_lballoc = idesc->id_lbn; > return (res); > } From owner-svn-src-all@freebsd.org Tue May 7 01:01:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55D96159A3AC; Tue, 7 May 2019 01:01:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6981D6AAD7; Tue, 7 May 2019 01:01:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x47118rq084420 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 7 May 2019 04:01:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x47118rq084420 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x47118Y3084400; Tue, 7 May 2019 04:01:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 7 May 2019 04:01:08 +0300 From: Konstantin Belousov To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347180 - head/sys/vm Message-ID: <20190507010108.GO2748@kib.kiev.ua> References: <201905060846.x468kCuf072276@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905060846.x468kCuf072276@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 01:01:16 -0000 On Mon, May 06, 2019 at 08:46:12AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon May 6 08:46:11 2019 > New Revision: 347180 > URL: https://svnweb.freebsd.org/changeset/base/347180 > The commit message should include some text like this: Include OBJT_DEFAULT objects in the fix from r347150. Default objects can legitimately have OBJ_NOSPLIT flag set, e.g. POSIX shm. And collapse must be avoided for them same as for the swap objects. > Log: > Noted by: alc > Reviewed by: alc, markj (previous version) > Sponsored by: The FreeBSD Foundation > MFC after: 6 days > > Modified: > head/sys/vm/vm_object.c > > Modified: head/sys/vm/vm_object.c > ============================================================================== > --- head/sys/vm/vm_object.c Mon May 6 08:32:49 2019 (r347179) > +++ head/sys/vm/vm_object.c Mon May 6 08:46:11 2019 (r347180) > @@ -1726,9 +1726,8 @@ vm_object_collapse(vm_object_t object) > VM_OBJECT_WLOCK(backing_object); > if (backing_object->handle != NULL || > (backing_object->type != OBJT_DEFAULT && > - (backing_object->type != OBJT_SWAP || > - (backing_object->flags & OBJ_NOSPLIT) != 0)) || > - (backing_object->flags & OBJ_DEAD) || > + backing_object->type != OBJT_SWAP) || > + (backing_object->flags & (OBJ_DEAD | OBJ_NOSPLIT)) != 0 || > object->handle != NULL || > (object->type != OBJT_DEFAULT && > object->type != OBJT_SWAP) || From owner-svn-src-all@freebsd.org Tue May 7 01:18:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29B8A159AFB5; Tue, 7 May 2019 01:18:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C31A36B779; Tue, 7 May 2019 01:18:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93A62F12B; Tue, 7 May 2019 01:18:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x471IvkK094829; Tue, 7 May 2019 01:18:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x471IvQ2094828; Tue, 7 May 2019 01:18:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905070118.x471IvQ2094828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 May 2019 01:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347216 - head/sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/include X-SVN-Commit-Revision: 347216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C31A36B779 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 01:18:58 -0000 Author: kib Date: Tue May 7 01:18:57 2019 New Revision: 347216 URL: https://svnweb.freebsd.org/changeset/base/347216 Log: amd64: fix BUS_SPACE_MAXSIZE to 64bit max value. Reviewed by: jhb, tychon (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D20154 Modified: head/sys/x86/include/bus.h Modified: head/sys/x86/include/bus.h ============================================================================== --- head/sys/x86/include/bus.h Tue May 7 00:03:05 2019 (r347215) +++ head/sys/x86/include/bus.h Tue May 7 01:18:57 2019 (r347216) @@ -114,7 +114,11 @@ #define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFF #define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF +#if defined(__amd64__) +#define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFFULL +#else #define BUS_SPACE_MAXSIZE 0xFFFFFFFF +#endif #define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF #define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF #if defined(__amd64__) || defined(PAE) From owner-svn-src-all@freebsd.org Tue May 7 05:08:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15444159F54B; Tue, 7 May 2019 05:08:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACEBF71400; Tue, 7 May 2019 05:08:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87DBE198A6; Tue, 7 May 2019 05:08:13 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4758DUF015689; Tue, 7 May 2019 05:08:13 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4758DW5015688; Tue, 7 May 2019 05:08:13 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905070508.x4758DW5015688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 7 May 2019 05:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347218 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 347218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ACEBF71400 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 05:08:14 -0000 Author: dchagin Date: Tue May 7 05:08:13 2019 New Revision: 347218 URL: https://svnweb.freebsd.org/changeset/base/347218 Log: Remove wrong copyright line. Discussed with Carlos Neira. Reported by: Rodney W. Grimes MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13656 Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Tue May 7 01:27:23 2019 (r347217) +++ head/sys/compat/linsysfs/linsysfs.c Tue May 7 05:08:13 2019 (r347218) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2006 IronPort Systems - * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@freebsd.org Tue May 7 05:32:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B8AD159FCC0; Tue, 7 May 2019 05:32:06 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F151D71F53; Tue, 7 May 2019 05:32:05 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x475VuuM010070; Mon, 6 May 2019 22:31:56 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x475VuIY010069; Mon, 6 May 2019 22:31:56 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905070531.x475VuIY010069@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347218 - head/sys/compat/linsysfs In-Reply-To: <201905070508.x4758DW5015688@repo.freebsd.org> To: Dmitry Chagin Date: Mon, 6 May 2019 22:31:56 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: F151D71F53 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 05:32:06 -0000 > Author: dchagin > Date: Tue May 7 05:08:13 2019 > New Revision: 347218 > URL: https://svnweb.freebsd.org/changeset/base/347218 > > Log: > Remove wrong copyright line. Discussed with Carlos Neira. > > Reported by: Rodney W. Grimes normally just use a committers username, aka rgrimes or rgrimes@ for these types of things. > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D13656 Hang on, now you removed his copyright? I see he said that was ok, but that was not the desired intent here. It would of been fine to have the copyright read: * Copyright (c) 2006 IronPort Systems * All rights reserved. * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com As a heads up to other committers you should never insert your copyright between another copyright and the "All rights reserved." text, if you wish to assert the all rights reserved you should duplicate it like: * Copyright (c) 2006 IronPort Systems * All rights reserved. * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com * All rights reserved. preferably on the line with your copyright as in: * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com All rights reserved. But if at all possible it would be best if we could not add any more of these, and remove them when possible. For those wishing to save space the (c) is unneeded when you spell out the word "Copyright". > > Modified: > head/sys/compat/linsysfs/linsysfs.c > > Modified: head/sys/compat/linsysfs/linsysfs.c > ============================================================================== > --- head/sys/compat/linsysfs/linsysfs.c Tue May 7 01:27:23 2019 (r347217) > +++ head/sys/compat/linsysfs/linsysfs.c Tue May 7 05:08:13 2019 (r347218) > @@ -2,7 +2,6 @@ > * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > * > * Copyright (c) 2006 IronPort Systems > - * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 7 07:16:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE14E15A1425; Tue, 7 May 2019 07:16:18 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A59474E01; Tue, 7 May 2019 07:16:18 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by mail-io1-f42.google.com with SMTP id y6so13419452ior.5; Tue, 07 May 2019 00:16:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wBJx5v2Rz1l4apBGmFjWudAwXVfqbqwLWjWolhWQ/dI=; b=O8X0N/6YuRk/kJ01gPPDOYg2cL7EF7HgpzsmhbOWWMJE/fF13IMOvMkrAvmqxociAr OpM7L7FMjvQ1N/zBEOQyc/zGX2a19rE7Q81OCcLKfAOHPNA1tmMYQiB7LQ97ImqDNe4D iieVuC6IFgMy6WBtZP1mHZo6MIWgpGH4vY6iQ0SZefWBSywNbkw79CmwksiqbR4IJ4QC 2vBK+Wt9G6qIgfGI7KzMwYqsStz5dgw2V7AyNToml2ui/bhbqVktZXw2iMTvjVsgkd2L XH60f3Euablncg10Bk2SHS6V0e9kww6MvpI2+rQ3t3zSwXTfWXxvc5P39qVebFCMfZ10 ZAlQ== X-Gm-Message-State: APjAAAXzFMHwXVVJX7JlsjlNRvrhYIeK3KnMwk2PxSBF9Pv0Ds5/14+c LqQZ0Aql+sz/LMt2uB1IHLkpLsMZwUeTFXSdMjDtZ7lTux0= X-Google-Smtp-Source: APXvYqyc+Lkg92yvu0eUrq1lt+9SkiYzVTxR6dZx0c15rU9IHKHrSgGdnWHS/FZ2Q+ILL/YFHO7RzJenyu0v8gawV4w= X-Received: by 2002:a6b:1494:: with SMTP id 142mr2162222iou.199.1557207956066; Mon, 06 May 2019 22:45:56 -0700 (PDT) MIME-Version: 1.0 References: <201905070508.x4758DW5015688@repo.freebsd.org> <201905070531.x475VuIY010069@gndrsh.dnsmgr.net> In-Reply-To: <201905070531.x475VuIY010069@gndrsh.dnsmgr.net> From: Dmitry Chagin Date: Tue, 7 May 2019 08:45:44 +0300 Message-ID: Subject: Re: svn commit: r347218 - head/sys/compat/linsysfs To: rgrimes@freebsd.org Cc: Dmitry Chagin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 7A59474E01 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.84 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.84)[-0.839,0]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 07:16:19 -0000 =D0=B2=D1=82, 7 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 08:32, Rodney W. Gri= mes : > > Author: dchagin > > Date: Tue May 7 05:08:13 2019 > > New Revision: 347218 > > URL: https://svnweb.freebsd.org/changeset/base/347218 > > > > Log: > > Remove wrong copyright line. Discussed with Carlos Neira. > > > > Reported by: Rodney W. Grimes > normally just use a committers username, aka rgrimes or rgrimes@ > for these types of things. > > ah, I see only: Rodney W. Grimes > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D13656 > > Hang on, now you removed his copyright? > I see he said that was ok, but that was not the desired intent here. > It would of been fine to have the copyright read: > > * Copyright (c) 2006 IronPort Systems > * All rights reserved. > * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com > > As a heads up to other committers you should never insert your > copyright between another copyright and the "All rights reserved." text, > if you wish to assert the all rights reserved you should duplicate > it like: > > * Copyright (c) 2006 IronPort Systems > * All rights reserved. > * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com > * All rights reserved. > > preferably on the line with your copyright as in: > * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com All rights > reserved. > > But if at all possible it would be best if we could not add any > more of these, and remove them when possible. > > and that actually I did. thanks > For those wishing to save space the (c) is unneeded when you > spell out the word "Copyright". > > > > > Modified: > > head/sys/compat/linsysfs/linsysfs.c > > > > Modified: head/sys/compat/linsysfs/linsysfs.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/sys/compat/linsysfs/linsysfs.c Tue May 7 01:27:23 2019 > (r347217) > > +++ head/sys/compat/linsysfs/linsysfs.c Tue May 7 05:08:13 2019 > (r347218) > > @@ -2,7 +2,6 @@ > > * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > * > > * Copyright (c) 2006 IronPort Systems > > - * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com > > * All rights reserved. > > * > > * Redistribution and use in source and binary forms, with or without > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Tue May 7 07:46:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BC6015A1FAB; Tue, 7 May 2019 07:46:42 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6AD475D1C; Tue, 7 May 2019 07:46:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 770601B379; Tue, 7 May 2019 07:46:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x477kffl098559; Tue, 7 May 2019 07:46:41 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x477kfZm098558; Tue, 7 May 2019 07:46:41 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905070746.x477kfZm098558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 7 May 2019 07:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347219 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 347219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A6AD475D1C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 07:46:42 -0000 Author: tsoome Date: Tue May 7 07:46:40 2019 New Revision: 347219 URL: https://svnweb.freebsd.org/changeset/base/347219 Log: loader: use safer DPRINTF body for non-debug case Modified: head/stand/common/bcache.c Modified: head/stand/common/bcache.c ============================================================================== --- head/stand/common/bcache.c Tue May 7 05:08:13 2019 (r347218) +++ head/stand/common/bcache.c Tue May 7 07:46:40 2019 (r347219) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #ifdef BCACHE_DEBUG # define DPRINTF(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args) #else -# define DPRINTF(fmt, args...) +# define DPRINTF(fmt, args...) ((void)0) #endif struct bcachectl From owner-svn-src-all@freebsd.org Tue May 7 08:14:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D286B15A2EAB; Tue, 7 May 2019 08:14:31 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77B7776C65; Tue, 7 May 2019 08:14:31 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51DE91B893; Tue, 7 May 2019 08:14:31 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x478EVED014043; Tue, 7 May 2019 08:14:31 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x478EVfx014042; Tue, 7 May 2019 08:14:31 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905070814.x478EVfx014042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 7 May 2019 08:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347220 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 347220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 77B7776C65 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 08:14:32 -0000 Author: tsoome Date: Tue May 7 08:14:30 2019 New Revision: 347220 URL: https://svnweb.freebsd.org/changeset/base/347220 Log: loader: bcache code does not need to check argument for free() Modified: head/stand/common/bcache.c Modified: head/stand/common/bcache.c ============================================================================== --- head/stand/common/bcache.c Tue May 7 07:46:40 2019 (r347219) +++ head/stand/common/bcache.c Tue May 7 08:14:30 2019 (r347220) @@ -426,10 +426,8 @@ static void bcache_free_instance(struct bcache *bc) { if (bc != NULL) { - if (bc->bcache_ctl) - free(bc->bcache_ctl); - if (bc->bcache_data) - free(bc->bcache_data); + free(bc->bcache_ctl); + free(bc->bcache_data); free(bc); } } From owner-svn-src-all@freebsd.org Tue May 7 08:28:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13B0215A3489; Tue, 7 May 2019 08:28:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7D0477341; Tue, 7 May 2019 08:28:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 785AF1BA6A; Tue, 7 May 2019 08:28:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x478SZTD019399; Tue, 7 May 2019 08:28:35 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x478SZ3t019398; Tue, 7 May 2019 08:28:35 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201905070828.x478SZ3t019398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 7 May 2019 08:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347221 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347221 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7D0477341 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 08:28:36 -0000 Author: marius Date: Tue May 7 08:28:35 2019 New Revision: 347221 URL: https://svnweb.freebsd.org/changeset/base/347221 Log: o Use iflib_fast_intr_rxtx() also for "legacy" interrupts, i. e. INTx and MSI. Unlike as with iflib_fast_intr_ctx(), the former will also enqueue _task_fn_tx() in addition to _task_fn_rx() if appropriate, bringing TCP TX throughput of EM-class devices on par with the MSI-X case and, thus, close to wirespeed/pre-iflib(4) times again. [1] Note that independently of the interrupt type, the UDP performance with these MACs still is abysmal and nowhere near to where it was before the conversion of em(4) to iflib(4). o In iflib_init_locked(), announce which free list failed to set up. o In _task_fn_tx() when running netmap(4), issue ifdi_intr_enable instead of the ifdi_tx_queue_intr_enable method in case of a "legacy" interrupt as the latter is valid with MSI-X only. o Instead of adding the missing - and apparently convoluted enough that a DBG_COUNTER_INC was put into a wrong spot in _task_fn_rx() - checks for ifdi_{r,t}x_queue_intr_enable being available in the MSI-X case also to iflib_fast_intr_rxtx(), factor these out to iflib_device_register() and make the checks fail gracefully rather than panic. This avoids invoking the checks at runtime over and over again in iflib_fast_intr_rxtx() and _task_fn_{r,t}x() - even if it's just in case of INVARIANTS - and makes these functions more readable. o In iflib_rx_structures_setup(), only initialize LRO resources if device and driver have LRO capability in order to not waste memory. Also, free the LRO resources again if setting them up fails for one of the queues. However, don't bother invoking iflib_rx_sds_free() in that case because iflib_rx_structures_setup() doesn't call iflib_rxsd_alloc() either (and iflib_{device,pseudo}_register() will issue iflib_rx_sds_free() in case of failure via iflib_rx_structures_free(), but there definitely is some asymmetry left to be fixed, though). o Similarly, free LRO resources again in iflib_rx_structures_free(). o In iflib_irq_set_affinity(), handle get_core_offset() errors gracefully instead of panicing (but only in case of INVARIANTS). This is a follow- up to r344132, as such driver bugs shouldn't be fatal. o Likewise, handle unknown iflib_intr_type_t in iflib_irq_alloc_generic() gracefully, too. o Bring yet more sanity to iflib_msix_init(): - If the device doesn't provide enough MSI-X vectors or not all vectors can be allocate so the expected number of queues in addition to admin interrupts can't be supported, try MSI next (and then INTx) as proper MSI-X vector distribution can't be assured in such cases. In essence, this change brings r254008 forward to iflib(4). Also, this is the fix alluded to in the commit message of r343934. - If the MSI-X allocation has failed, don't prematurely announce MSI is going to be used as the latter in fact may not be available either. - When falling back to MSI, only release the MSI-X table resource again if it was allocated in iflib_msix_init(), i. e. isn't supplied by the driver, in the first place. o In mp_ndesc_handler(), handle unknown type arguments gracefully, too. PR: 235031 (likely) [1] Reviewed by: shurd Differential Revision: https://reviews.freebsd.org/D20175 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue May 7 08:14:30 2019 (r347220) +++ head/sys/net/iflib.c Tue May 7 08:28:35 2019 (r347221) @@ -1461,6 +1461,7 @@ iflib_fast_intr_rxtx(void *arg) void *sc; int i, cidx, result; qidx_t txqid; + bool intr_enable, intr_legacy; if (!iflib_started) return (FILTER_STRAY); @@ -1474,6 +1475,8 @@ iflib_fast_intr_rxtx(void *arg) ctx = rxq->ifr_ctx; sc = ctx->ifc_softc; + intr_enable = false; + intr_legacy = !!(ctx->ifc_flags & IFC_LEGACY); MPASS(rxq->ifr_ntxqirq); for (i = 0; i < rxq->ifr_ntxqirq; i++) { txqid = rxq->ifr_txqid[i]; @@ -1481,7 +1484,10 @@ iflib_fast_intr_rxtx(void *arg) bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, BUS_DMASYNC_POSTREAD); if (!ctx->isc_txd_credits_update(sc, txqid, false)) { - IFDI_TX_QUEUE_INTR_ENABLE(ctx, txqid); + if (intr_legacy) + intr_enable = true; + else + IFDI_TX_QUEUE_INTR_ENABLE(ctx, txqid); continue; } GROUPTASK_ENQUEUE(&txq->ift_task); @@ -1493,9 +1499,14 @@ iflib_fast_intr_rxtx(void *arg) if (iflib_rxd_avail(ctx, rxq, cidx, 1)) GROUPTASK_ENQUEUE(gtask); else { - IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); + if (intr_legacy) + intr_enable = true; + else + IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); DBG_COUNTER_INC(rx_intr_enables); } + if (intr_enable) + IFDI_INTR_ENABLE(ctx); return (FILTER_HANDLED); } @@ -2352,7 +2363,9 @@ iflib_init_locked(if_ctx_t ctx) } for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) { if (iflib_fl_setup(fl)) { - device_printf(ctx->ifc_dev, "freelist setup failed - check cluster settings\n"); + device_printf(ctx->ifc_dev, + "setting up free list %d failed - " + "check cluster settings\n", j); goto done; } } @@ -3733,7 +3746,10 @@ _task_fn_tx(void *context) BUS_DMASYNC_POSTREAD); if (ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)) netmap_tx_irq(ifp, txq->ift_id); - IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); + if (ctx->ifc_flags & IFC_LEGACY) + IFDI_INTR_ENABLE(ctx); + else + IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); return; } #endif @@ -3752,13 +3768,8 @@ _task_fn_tx(void *context) ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); - else { -#ifdef INVARIANTS - int rc = -#endif - IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); - KASSERT(rc != ENOTSUP, ("MSI-X support requires queue_intr_enable, but not implemented in driver")); - } + else + IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); } static void @@ -3790,14 +3801,9 @@ _task_fn_rx(void *context) if (more == false || (more = iflib_rxeof(rxq, budget)) == false) { if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); - else { -#ifdef INVARIANTS - int rc = -#endif - IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); - KASSERT(rc != ENOTSUP, ("MSI-X support requires queue_intr_enable, but not implemented in driver")); - DBG_COUNTER_INC(rx_intr_enables); - } + else + IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); + DBG_COUNTER_INC(rx_intr_enables); } if (__predict_false(!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))) return; @@ -4532,15 +4538,14 @@ unref_ctx_core_offset(if_ctx_t ctx) int iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ctxp) { - int err, rid, msix; if_ctx_t ctx; if_t ifp; if_softc_ctx_t scctx; - int i; - uint16_t main_txq; - uint16_t main_rxq; + kobjop_desc_t kobj_desc; + kobj_method_t *kobj_method; + int err, i, msix, rid; + uint16_t main_rxq, main_txq; - ctx = malloc(sizeof(* ctx), M_IFLIB, M_WAITOK|M_ZERO); if (sc == NULL) { @@ -4699,11 +4704,43 @@ iflib_device_register(device_t dev, void *sc, if_share * interrupt storm. */ IFDI_INTR_DISABLE(ctx); - if (msix > 1 && (err = IFDI_MSIX_INTR_ASSIGN(ctx, msix)) != 0) { - device_printf(dev, "IFDI_MSIX_INTR_ASSIGN failed %d\n", err); - goto fail_queues; - } - if (msix <= 1) { + + if (msix > 1) { + /* + * When using MSI-X, ensure that ifdi_{r,t}x_queue_intr_enable + * aren't the default NULL implementation. + */ + kobj_desc = &ifdi_rx_queue_intr_enable_desc; + kobj_method = kobj_lookup_method(((kobj_t)ctx)->ops->cls, NULL, + kobj_desc); + if (kobj_method == &kobj_desc->deflt) { + device_printf(dev, + "MSI-X requires ifdi_rx_queue_intr_enable method"); + err = EOPNOTSUPP; + goto fail_queues; + } + kobj_desc = &ifdi_tx_queue_intr_enable_desc; + kobj_method = kobj_lookup_method(((kobj_t)ctx)->ops->cls, NULL, + kobj_desc); + if (kobj_method == &kobj_desc->deflt) { + device_printf(dev, + "MSI-X requires ifdi_tx_queue_intr_enable method"); + err = EOPNOTSUPP; + goto fail_queues; + } + + /* + * Assign the MSI-X vectors. + * Note that the default NULL ifdi_msix_intr_assign method will + * fail here, too. + */ + err = IFDI_MSIX_INTR_ASSIGN(ctx, msix); + if (err != 0) { + device_printf(dev, "IFDI_MSIX_INTR_ASSIGN failed %d\n", + err); + goto fail_queues; + } + } else { rid = 0; if (scctx->isc_intr == IFLIB_INTR_MSI) { MPASS(msix == 1); @@ -4743,6 +4780,7 @@ iflib_device_register(device_t dev, void *sc, if_share iflib_add_pfil(ctx); ctx->ifc_flags |= IFC_INIT_DONE; CTX_UNLOCK(ctx); + return (0); fail_detach: @@ -4957,6 +4995,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc iflib_add_device_sysctl_post(ctx); ctx->ifc_flags |= IFC_INIT_DONE; CTX_UNLOCK(ctx); + return (0); fail_detach: ether_ifdetach(ctx->ifc_ifp); @@ -5349,7 +5388,6 @@ iflib_register(if_ctx_t ctx) return (0); } - static int iflib_queues_alloc(if_ctx_t ctx) { @@ -5608,17 +5646,20 @@ iflib_rx_structures_setup(if_ctx_t ctx) iflib_rxq_t rxq = ctx->ifc_rxqs; int q; #if defined(INET6) || defined(INET) - int i, err; + int err, i; #endif for (q = 0; q < ctx->ifc_softc_ctx.isc_nrxqsets; q++, rxq++) { #if defined(INET6) || defined(INET) - tcp_lro_free(&rxq->ifr_lc); - if ((err = tcp_lro_init_args(&rxq->ifr_lc, ctx->ifc_ifp, - TCP_LRO_ENTRIES, min(1024, - ctx->ifc_softc_ctx.isc_nrxd[rxq->ifr_fl_offset]))) != 0) { - device_printf(ctx->ifc_dev, "LRO Initialization failed!\n"); - goto fail; + if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) { + err = tcp_lro_init_args(&rxq->ifr_lc, ctx->ifc_ifp, + TCP_LRO_ENTRIES, min(1024, + ctx->ifc_softc_ctx.isc_nrxd[rxq->ifr_fl_offset])); + if (err != 0) { + device_printf(ctx->ifc_dev, + "LRO Initialization failed!\n"); + goto fail; + } } #endif IFDI_RXQ_SETUP(ctx, rxq->ifr_id); @@ -5627,14 +5668,14 @@ iflib_rx_structures_setup(if_ctx_t ctx) #if defined(INET6) || defined(INET) fail: /* - * Free RX software descriptors allocated so far, we will only handle + * Free LRO resources allocated so far, we will only handle * the rings that completed, the failing case will have - * cleaned up for itself. 'q' failed, so its the terminus. + * cleaned up for itself. 'q' failed, so its the terminus. */ rxq = ctx->ifc_rxqs; for (i = 0; i < q; ++i, rxq++) { - iflib_rx_sds_free(rxq); - rxq->ifr_cq_cidx = 0; + if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) + tcp_lro_free(&rxq->ifr_lc); } return (err); #endif @@ -5649,9 +5690,12 @@ static void iflib_rx_structures_free(if_ctx_t ctx) { iflib_rxq_t rxq = ctx->ifc_rxqs; + int i; - for (int i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { + for (i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { iflib_rx_sds_free(rxq); + if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) + tcp_lro_free(&rxq->ifr_lc); } free(ctx->ifc_rxqs, M_IFLIB); ctx->ifc_rxqs = NULL; @@ -5822,7 +5866,10 @@ iflib_irq_set_affinity(if_ctx_t ctx, if_irq_t irq, ifl co += ctx->ifc_softc_ctx.isc_nrxqsets; cpuid = find_nth(ctx, qid + co); tid = get_core_offset(ctx, type, qid); - MPASS(tid >= 0); + if (tid < 0) { + device_printf(dev, "get_core_offset failed\n"); + return (EOPNOTSUPP); + } cpuid = find_close_core(cpuid, tid); err = taskqgroup_attach_cpu(tqg, gtask, uniq, cpuid, dev, irq->ii_res, name); @@ -5834,7 +5881,7 @@ iflib_irq_set_affinity(if_ctx_t ctx, if_irq_t irq, ifl if (cpuid > ctx->ifc_cpuid_highest) ctx->ifc_cpuid_highest = cpuid; #endif - return 0; + return (0); } int @@ -5894,7 +5941,9 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, in intr_fast = iflib_fast_intr_ctx; break; default: - panic("unknown net intr type"); + device_printf(ctx->ifc_dev, "%s: unknown net intr type\n", + __func__); + return (EINVAL); } info->ifi_filter = filter; @@ -6005,11 +6054,12 @@ iflib_legacy_setup(if_ctx_t ctx, driver_filter_t filte info->ifi_filter = filter; info->ifi_filter_arg = filter_arg; info->ifi_task = gtask; - info->ifi_ctx = ctx; + info->ifi_ctx = q; dev = ctx->ifc_dev; /* We allocate a single interrupt resource */ - if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr_ctx, NULL, info, name)) != 0) + if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr_rxtx, + NULL, info, name)) != 0) return (err); GROUPTASK_INIT(gtask, 0, fn, q); res = irq->ii_res; @@ -6174,9 +6224,8 @@ iflib_msix_init(if_ctx_t ctx) device_t dev = ctx->ifc_dev; if_shared_ctx_t sctx = ctx->ifc_sctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; - int vectors, queues, rx_queues, tx_queues, queuemsgs, msgs; - int iflib_num_tx_queues, iflib_num_rx_queues; - int err, admincnt, bar; + int admincnt, bar, err, iflib_num_rx_queues, iflib_num_tx_queues; + int msgs, queuemsgs, queues, rx_queues, tx_queues, vectors; iflib_num_tx_queues = ctx->ifc_sysctl_ntxqs; iflib_num_rx_queues = ctx->ifc_sysctl_nrxqs; @@ -6185,8 +6234,6 @@ iflib_msix_init(if_ctx_t ctx) device_printf(dev, "msix_init qsets capped at %d\n", imax(scctx->isc_ntxqsets, scctx->isc_nrxqsets)); - bar = ctx->ifc_softc_ctx.isc_msix_bar; - admincnt = sctx->isc_admin_intrcnt; /* Override by tuneable */ if (scctx->isc_disable_msix) goto msi; @@ -6197,6 +6244,8 @@ iflib_msix_init(if_ctx_t ctx) device_printf(dev, "MSI-X not supported or disabled\n"); goto msi; } + + bar = ctx->ifc_softc_ctx.isc_msix_bar; /* * bar == -1 => "trust me I know what I'm doing" * Some drivers are for hardware that is so shoddily @@ -6212,6 +6261,8 @@ iflib_msix_init(if_ctx_t ctx) goto msi; } } + + admincnt = sctx->isc_admin_intrcnt; #if IFLIB_DEBUG /* use only 1 qset in debug mode */ queuemsgs = min(msgs - admincnt, 1); @@ -6263,11 +6314,30 @@ iflib_msix_init(if_ctx_t ctx) rx_queues = min(rx_queues, tx_queues); } + vectors = rx_queues + admincnt; + if (msgs < vectors) { + device_printf(dev, + "insufficient number of MSI-X vectors " + "(supported %d, need %d)\n", msgs, vectors); + goto msi; + } + device_printf(dev, "Using %d RX queues %d TX queues\n", rx_queues, tx_queues); - - vectors = rx_queues + admincnt; + msgs = vectors; if ((err = pci_alloc_msix(dev, &vectors)) == 0) { + if (vectors != msgs) { + device_printf(dev, + "Unable to allocate sufficient MSI-X vectors " + "(got %d, need %d)\n", vectors, msgs); + pci_release_msi(dev); + if (bar != -1) { + bus_release_resource(dev, SYS_RES_MEMORY, bar, + ctx->ifc_msix_mem); + ctx->ifc_msix_mem = NULL; + } + goto msi; + } device_printf(dev, "Using MSI-X interrupts with %d vectors\n", vectors); scctx->isc_vectors = vectors; @@ -6278,12 +6348,15 @@ iflib_msix_init(if_ctx_t ctx) return (vectors); } else { device_printf(dev, - "failed to allocate %d MSI-X vectors, err: %d - using MSI\n", - vectors, err); - bus_release_resource(dev, SYS_RES_MEMORY, bar, - ctx->ifc_msix_mem); - ctx->ifc_msix_mem = NULL; + "failed to allocate %d MSI-X vectors, err: %d\n", vectors, + err); + if (bar != -1) { + bus_release_resource(dev, SYS_RES_MEMORY, bar, + ctx->ifc_msix_mem); + ctx->ifc_msix_mem = NULL; + } } + msi: vectors = pci_msi_count(dev); scctx->isc_nrxqsets = 1; @@ -6345,8 +6418,6 @@ mp_ndesc_handler(SYSCTL_HANDLER_ARGS) char *p, *next; int nqs, rc, i; - MPASS(type == IFLIB_NTXD_HANDLER || type == IFLIB_NRXD_HANDLER); - nqs = 8; switch(type) { case IFLIB_NTXD_HANDLER: @@ -6360,7 +6431,8 @@ mp_ndesc_handler(SYSCTL_HANDLER_ARGS) nqs = ctx->ifc_sctx->isc_nrxqs; break; default: - panic("unhandled type"); + printf("%s: unhandled type\n", __func__); + return (EINVAL); } if (nqs == 0) nqs = 8; From owner-svn-src-all@freebsd.org Tue May 7 08:31:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE87F15A37F0; Tue, 7 May 2019 08:31:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91C5D777B6; Tue, 7 May 2019 08:31:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B8BA1BBFA; Tue, 7 May 2019 08:31:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x478VtxJ024585; Tue, 7 May 2019 08:31:55 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x478VtTh024584; Tue, 7 May 2019 08:31:55 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201905070831.x478VtTh024584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 7 May 2019 08:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347222 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 347222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 91C5D777B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 08:31:56 -0000 Author: marius Date: Tue May 7 08:31:54 2019 New Revision: 347222 URL: https://svnweb.freebsd.org/changeset/base/347222 Log: o Avoid determining the MAC class (LEM/EM or IGB) - possibly even multiple times - on every interrupt by using an own set of device methods for the IGB class. This translates to introducing igb_if_intr_{disable,enable}() and igb_if_{rx,tx}_queue_intr_enable() with that IGB-specific code moved out of their EM counterparts and otherwise continuing to use the EM IFDI methods also for IGB. Note that igb_if_intr_{disable,enable}() also issue E1000_WRITE_FLUSH as lost with the conversion of igb(4) to iflib(4). Also note, that the em_if_{disable,enable}_intr() methods are renamed to em_if_intr_{disable,enable}() for consistency with the names used in the interface declaration. o In em_intr(): - Don't bother to bail out if the interrupt type is "legacy", i. e. INTx or MSI, as iflib(4) doesn't use ift_legacy_intr methods for MSI-X. All other iflib(4)-based drivers avoid this check, too. - Given that only the MSI-X interrupts have one-shot behavior (by taking advantage of the EIAC register), explicitly disable interrupts. Hence, em_intr() now matches what {em,igb}_irq_fast() previously did (in case of igb(4) supposedly also to work around MSI message reordering errata on certain systems). o In em_if_intr_disable(): - Clear the EIAC register unconditionally for 82574 and not just in case of MSI-X, matching em_if_intr_enable() and bringing back the last hunk of r206437 lost with the iflib(4) conversion. - Write to EM_EIAC for clearing said register instead of to the IGB-only E1000_EIAC used ever since the iflib(4) conversion. Reviewed by: shurd Differential Revision: https://reviews.freebsd.org/D20176 Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue May 7 08:28:35 2019 (r347221) +++ head/sys/dev/e1000/if_em.c Tue May 7 08:31:54 2019 (r347222) @@ -261,10 +261,14 @@ static int em_setup_msix(if_ctx_t ctx); static void em_initialize_transmit_unit(if_ctx_t ctx); static void em_initialize_receive_unit(if_ctx_t ctx); -static void em_if_enable_intr(if_ctx_t ctx); -static void em_if_disable_intr(if_ctx_t ctx); +static void em_if_intr_enable(if_ctx_t ctx); +static void em_if_intr_disable(if_ctx_t ctx); +static void igb_if_intr_enable(if_ctx_t ctx); +static void igb_if_intr_disable(if_ctx_t ctx); static int em_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid); static int em_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid); +static int igb_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid); +static int igb_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid); static void em_if_multi_set(if_ctx_t ctx); static void em_if_update_admin_status(if_ctx_t ctx); static void em_if_debug(if_ctx_t ctx); @@ -375,8 +379,8 @@ static device_method_t em_if_methods[] = { DEVMETHOD(ifdi_init, em_if_init), DEVMETHOD(ifdi_stop, em_if_stop), DEVMETHOD(ifdi_msix_intr_assign, em_if_msix_intr_assign), - DEVMETHOD(ifdi_intr_enable, em_if_enable_intr), - DEVMETHOD(ifdi_intr_disable, em_if_disable_intr), + DEVMETHOD(ifdi_intr_enable, em_if_intr_enable), + DEVMETHOD(ifdi_intr_disable, em_if_intr_disable), DEVMETHOD(ifdi_tx_queues_alloc, em_if_tx_queues_alloc), DEVMETHOD(ifdi_rx_queues_alloc, em_if_rx_queues_alloc), DEVMETHOD(ifdi_queues_free, em_if_queues_free), @@ -398,14 +402,47 @@ static device_method_t em_if_methods[] = { DEVMETHOD_END }; -/* - * note that if (adapter->msix_mem) is replaced by: - * if (adapter->intr_type == IFLIB_INTR_MSIX) - */ static driver_t em_if_driver = { "em_if", em_if_methods, sizeof(struct adapter) }; +static device_method_t igb_if_methods[] = { + DEVMETHOD(ifdi_attach_pre, em_if_attach_pre), + DEVMETHOD(ifdi_attach_post, em_if_attach_post), + DEVMETHOD(ifdi_detach, em_if_detach), + DEVMETHOD(ifdi_shutdown, em_if_shutdown), + DEVMETHOD(ifdi_suspend, em_if_suspend), + DEVMETHOD(ifdi_resume, em_if_resume), + DEVMETHOD(ifdi_init, em_if_init), + DEVMETHOD(ifdi_stop, em_if_stop), + DEVMETHOD(ifdi_msix_intr_assign, em_if_msix_intr_assign), + DEVMETHOD(ifdi_intr_enable, igb_if_intr_enable), + DEVMETHOD(ifdi_intr_disable, igb_if_intr_disable), + DEVMETHOD(ifdi_tx_queues_alloc, em_if_tx_queues_alloc), + DEVMETHOD(ifdi_rx_queues_alloc, em_if_rx_queues_alloc), + DEVMETHOD(ifdi_queues_free, em_if_queues_free), + DEVMETHOD(ifdi_update_admin_status, em_if_update_admin_status), + DEVMETHOD(ifdi_multi_set, em_if_multi_set), + DEVMETHOD(ifdi_media_status, em_if_media_status), + DEVMETHOD(ifdi_media_change, em_if_media_change), + DEVMETHOD(ifdi_mtu_set, em_if_mtu_set), + DEVMETHOD(ifdi_promisc_set, em_if_set_promisc), + DEVMETHOD(ifdi_timer, em_if_timer), + DEVMETHOD(ifdi_watchdog_reset, em_if_watchdog_reset), + DEVMETHOD(ifdi_vlan_register, em_if_vlan_register), + DEVMETHOD(ifdi_vlan_unregister, em_if_vlan_unregister), + DEVMETHOD(ifdi_get_counter, em_if_get_counter), + DEVMETHOD(ifdi_led_func, em_if_led_func), + DEVMETHOD(ifdi_rx_queue_intr_enable, igb_if_rx_queue_intr_enable), + DEVMETHOD(ifdi_tx_queue_intr_enable, igb_if_tx_queue_intr_enable), + DEVMETHOD(ifdi_debug, em_if_debug), + DEVMETHOD_END +}; + +static driver_t igb_if_driver = { + "igb_if", igb_if_methods, sizeof(struct adapter) +}; + /********************************************************************* * Tunable default values. *********************************************************************/ @@ -525,7 +562,7 @@ static struct if_shared_ctx igb_sctx_init = { .isc_admin_intrcnt = 1, .isc_vendor_info = igb_vendor_info_array, .isc_driver_version = em_driver_version, - .isc_driver = &em_if_driver, + .isc_driver = &igb_if_driver, .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_TSO_INIT_IP | IFLIB_NEED_ZERO_CSUM, .isc_nrxd_min = {EM_MIN_RXD}, @@ -1333,8 +1370,6 @@ em_intr(void *arg) reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR); - if (adapter->intr_type != IFLIB_INTR_LEGACY) - goto skip_stray; /* Hot eject? */ if (reg_icr == 0xffffffff) return FILTER_STRAY; @@ -1351,7 +1386,14 @@ em_intr(void *arg) (reg_icr & E1000_ICR_INT_ASSERTED) == 0) return FILTER_STRAY; -skip_stray: + /* + * Only MSI-X interrupts have one-shot behavior by taking advantage + * of the EIAC register. Thus, explicitly disable interrupts. This + * also works around the MSI message reordering errata on certain + * systems. + */ + IFDI_INTR_DISABLE(ctx); + /* Link status change */ if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { adapter->hw.mac.get_link_status = 1; @@ -1364,53 +1406,43 @@ skip_stray: return (FILTER_SCHEDULE_THREAD); } -static void -igb_rx_enable_queue(struct adapter *adapter, struct em_rx_queue *rxq) +static int +em_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid) { - E1000_WRITE_REG(&adapter->hw, E1000_EIMS, rxq->eims); -} + struct adapter *adapter = iflib_get_softc(ctx); + struct em_rx_queue *rxq = &adapter->rx_queues[rxqid]; -static void -em_rx_enable_queue(struct adapter *adapter, struct em_rx_queue *rxq) -{ E1000_WRITE_REG(&adapter->hw, E1000_IMS, rxq->eims); + return (0); } -static void -igb_tx_enable_queue(struct adapter *adapter, struct em_tx_queue *txq) +static int +em_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid) { - E1000_WRITE_REG(&adapter->hw, E1000_EIMS, txq->eims); -} + struct adapter *adapter = iflib_get_softc(ctx); + struct em_tx_queue *txq = &adapter->tx_queues[txqid]; -static void -em_tx_enable_queue(struct adapter *adapter, struct em_tx_queue *txq) -{ E1000_WRITE_REG(&adapter->hw, E1000_IMS, txq->eims); + return (0); } static int -em_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid) +igb_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid) { struct adapter *adapter = iflib_get_softc(ctx); struct em_rx_queue *rxq = &adapter->rx_queues[rxqid]; - if (adapter->hw.mac.type >= igb_mac_min) - igb_rx_enable_queue(adapter, rxq); - else - em_rx_enable_queue(adapter, rxq); + E1000_WRITE_REG(&adapter->hw, E1000_EIMS, rxq->eims); return (0); } static int -em_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid) +igb_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid) { struct adapter *adapter = iflib_get_softc(ctx); struct em_tx_queue *txq = &adapter->tx_queues[txqid]; - if (adapter->hw.mac.type >= igb_mac_min) - igb_tx_enable_queue(adapter, txq); - else - em_tx_enable_queue(adapter, txq); + E1000_WRITE_REG(&adapter->hw, E1000_EIMS, txq->eims); return (0); } @@ -3374,7 +3406,7 @@ em_setup_vlan_hw_support(struct adapter *adapter) } static void -em_if_enable_intr(if_ctx_t ctx) +em_if_intr_enable(if_ctx_t ctx) { struct adapter *adapter = iflib_get_softc(ctx); struct e1000_hw *hw = &adapter->hw; @@ -3383,30 +3415,51 @@ em_if_enable_intr(if_ctx_t ctx) if (hw->mac.type == e1000_82574) { E1000_WRITE_REG(hw, EM_EIAC, EM_MSIX_MASK); ims_mask |= adapter->ims; - } else if (adapter->intr_type == IFLIB_INTR_MSIX && hw->mac.type >= igb_mac_min) { - u32 mask = (adapter->que_mask | adapter->link_mask); - - E1000_WRITE_REG(&adapter->hw, E1000_EIAC, mask); - E1000_WRITE_REG(&adapter->hw, E1000_EIAM, mask); - E1000_WRITE_REG(&adapter->hw, E1000_EIMS, mask); - ims_mask = E1000_IMS_LSC; } - E1000_WRITE_REG(hw, E1000_IMS, ims_mask); } static void -em_if_disable_intr(if_ctx_t ctx) +em_if_intr_disable(if_ctx_t ctx) { struct adapter *adapter = iflib_get_softc(ctx); struct e1000_hw *hw = &adapter->hw; - if (adapter->intr_type == IFLIB_INTR_MSIX) { - if (hw->mac.type >= igb_mac_min) - E1000_WRITE_REG(&adapter->hw, E1000_EIMC, ~0); - E1000_WRITE_REG(&adapter->hw, E1000_EIAC, 0); + if (hw->mac.type == e1000_82574) + E1000_WRITE_REG(hw, EM_EIAC, 0); + E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); +} + +static void +igb_if_intr_enable(if_ctx_t ctx) +{ + struct adapter *adapter = iflib_get_softc(ctx); + struct e1000_hw *hw = &adapter->hw; + u32 mask; + + if (__predict_true(adapter->intr_type == IFLIB_INTR_MSIX)) { + mask = (adapter->que_mask | adapter->link_mask); + E1000_WRITE_REG(hw, E1000_EIAC, mask); + E1000_WRITE_REG(hw, E1000_EIAM, mask); + E1000_WRITE_REG(hw, E1000_EIMS, mask); + E1000_WRITE_REG(hw, E1000_IMS, E1000_IMS_LSC); + } else + E1000_WRITE_REG(hw, E1000_IMS, IMS_ENABLE_MASK); + E1000_WRITE_FLUSH(hw); +} + +static void +igb_if_intr_disable(if_ctx_t ctx) +{ + struct adapter *adapter = iflib_get_softc(ctx); + struct e1000_hw *hw = &adapter->hw; + + if (__predict_true(adapter->intr_type == IFLIB_INTR_MSIX)) { + E1000_WRITE_REG(hw, E1000_EIMC, 0xffffffff); + E1000_WRITE_REG(hw, E1000_EIAC, 0); } - E1000_WRITE_REG(&adapter->hw, E1000_IMC, 0xffffffff); + E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); + E1000_WRITE_FLUSH(hw); } /* From owner-svn-src-all@freebsd.org Tue May 7 10:01:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5958515A58B2; Tue, 7 May 2019 10:01:46 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2F43829DF; Tue, 7 May 2019 10:01:45 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCEBB1CB66; Tue, 7 May 2019 10:01:45 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47A1j1q067507; Tue, 7 May 2019 10:01:45 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47A1jQe067506; Tue, 7 May 2019 10:01:45 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905071001.x47A1jQe067506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 7 May 2019 10:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347223 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 347223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F2F43829DF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 10:01:46 -0000 Author: tsoome Date: Tue May 7 10:01:45 2019 New Revision: 347223 URL: https://svnweb.freebsd.org/changeset/base/347223 Log: command_bcache() does not use argv Therefore mark argv __unused. Modified: head/stand/common/bcache.c Modified: head/stand/common/bcache.c ============================================================================== --- head/stand/common/bcache.c Tue May 7 08:31:54 2019 (r347222) +++ head/stand/common/bcache.c Tue May 7 10:01:45 2019 (r347223) @@ -467,7 +467,7 @@ bcache_invalidate(struct bcache *bc, daddr_t blkno) COMMAND_SET(bcachestat, "bcachestat", "get disk block cache stats", command_bcache); static int -command_bcache(int argc, char *argv[]) +command_bcache(int argc, char *argv[] __unused) { if (argc != 1) { command_errmsg = "wrong number of arguments"; From owner-svn-src-all@freebsd.org Tue May 7 10:45:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94B6815A66C3; Tue, 7 May 2019 10:45:07 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27FD883E33; Tue, 7 May 2019 10:45:07 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt1-x836.google.com with SMTP id k24so1197957qtq.7; Tue, 07 May 2019 03:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=COYGTlj4Gv1Vhy4HJozUu3l4oQsZ9fimFqsKdVSae/M=; b=vVv8sUC/k81nvd+p7C1ukcK486aMD6HKSAjPevt9EM1bgfSRJsNZG2yN4JYBreT55+ DNXXmO+JEtb9+Y5Qi1ZpNkWtzt4KzGdJmIQqIHqXjs8EeyZrnp9mLEG+7gkrN1Ev5Y0N a2EDO12cHQSmuRA/CkxO8mCRMuFWgJJVxozYND4K54LwT7iDC1anJNjUy0vAhWGDaj5g 71SnIlhyrJQNTHnPwkBIYpWwfdZI+/UtirNZWEbXffONn15j7xCh0ihGAx8h8xE2lTHx lA5eFgJiOX0brYiuPcROH6gZqScV905S7Q8qLT9k8DNAvyfNVQ4kSs3fYQEqsmio/c3O HHJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=COYGTlj4Gv1Vhy4HJozUu3l4oQsZ9fimFqsKdVSae/M=; b=HMao6LpYl/yw1blGf8VGUGWbtWHGM4Ow0EycVyDprGfmUdcvuI2Kub8cqx36bC/FNu E+8gSshhSFaiouUqwKwPTARDO/Kr2sVKErTYqUcpMdqUvqNJKWlJRdZmqf/3kDbvZSEp F4ubQgbYKsqzNSjQRUCZUltc6iSewcyE9RuJCntamtKKNrGwVMvmrDeG2Xu61BKXdbXF hCz+K/15w7wXZZCOpo2QHXlgeZrNnsRKO5An1xuOX4FnnQa/WZycTVS2purwdkw6XAim VyMUSnODd9Efz/kBa7U0KQIOJHLhHx4O6x3ELQJgkg0Cqx6MNlOhfn+xMW1kDxgjfyoc YUJQ== X-Gm-Message-State: APjAAAW37c8iO5RQodix6qJ4TRCz2RxPpGXqSGNB6u7Dg5jt1M0R9tvj gBHCsrmTAZsr3GR61y0hukTa+6Fj X-Google-Smtp-Source: APXvYqx4ChpliiJGS6O7lqMAwXiTev4ytE9GyVrKKSUZtq62ih0DelKxa7IL0J5rZIqyh/k2e6N1nA== X-Received: by 2002:ad4:53a6:: with SMTP id j6mr15191209qvv.170.1557225906104; Tue, 07 May 2019 03:45:06 -0700 (PDT) Received: from mbp.home ([2804:f1c:800:fc00:31c3:c159:2aea:f0b5]) by smtp.gmail.com with ESMTPSA id q56sm10141147qtk.72.2019.05.07.03.45.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 03:45:05 -0700 (PDT) Sender: Renato Botelho Subject: Re: svn commit: r347218 - head/sys/compat/linsysfs To: Dmitry Chagin , rgrimes@freebsd.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers References: <201905070508.x4758DW5015688@repo.freebsd.org> <201905070531.x475VuIY010069@gndrsh.dnsmgr.net> From: Renato Botelho Openpgp: preference=signencrypt Autocrypt: addr=garga@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAG0LFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+iQFXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/ULkBDQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABiQE8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: <57ea4a23-c78e-1871-e06b-baf4f78882fd@FreeBSD.org> Date: Tue, 7 May 2019 07:45:01 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27FD883E33 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 10:45:07 -0000 On 07/05/19 02:45, Dmitry Chagin wrote: > вт, 7 мая 2019 г. в 08:32, Rodney W. Grimes : > >>> Author: dchagin >>> Date: Tue May 7 05:08:13 2019 >>> New Revision: 347218 >>> URL: https://svnweb.freebsd.org/changeset/base/347218 >>> >>> Log: >>> Remove wrong copyright line. Discussed with Carlos Neira. >>> >>> Reported by: Rodney W. Grimes >> normally just use a committers username, aka rgrimes or rgrimes@ >> for these types of things. >> >> > ah, I see only: Rodney W. Grimes > > > >>> MFC after: 2 weeks >>> Differential Revision: https://reviews.freebsd.org/D13656 >> >> Hang on, now you removed his copyright? >> I see he said that was ok, but that was not the desired intent here. >> It would of been fine to have the copyright read: >> >> * Copyright (c) 2006 IronPort Systems >> * All rights reserved. >> * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com >> >> As a heads up to other committers you should never insert your >> copyright between another copyright and the "All rights reserved." text, >> if you wish to assert the all rights reserved you should duplicate >> it like: >> >> * Copyright (c) 2006 IronPort Systems >> * All rights reserved. >> * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com >> * All rights reserved. >> >> preferably on the line with your copyright as in: >> * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com All rights >> reserved. >> >> But if at all possible it would be best if we could not add any >> more of these, and remove them when possible. >> >> > and that actually I did. thanks Rod was saying to remove "All rights reserved" when possible, not the Copyright line. -- Renato Botelho From owner-svn-src-all@freebsd.org Tue May 7 13:04:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29FA7158553B; Tue, 7 May 2019 13:04:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4D4988793; Tue, 7 May 2019 13:04:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F6A91E9ED; Tue, 7 May 2019 13:04:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47D4Q2Y065128; Tue, 7 May 2019 13:04:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47D4Q8t065127; Tue, 7 May 2019 13:04:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905071304.x47D4Q8t065127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 7 May 2019 13:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347224 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 347224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4D4988793 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 13:04:27 -0000 Author: emaste Date: Tue May 7 13:04:26 2019 New Revision: 347224 URL: https://svnweb.freebsd.org/changeset/base/347224 Log: Use @generated tag in generated files Multiple tools use @generated to identify generated files (for example, in a review Phabricator will by default hide diffs in generated files). Use the @generated tag in makeobjops.awk and vnode_if.awk as we've done for other generated files. Sponsored by: The FreeBSD Foundation Modified: head/sys/tools/makeobjops.awk head/sys/tools/vnode_if.awk Modified: head/sys/tools/makeobjops.awk ============================================================================== --- head/sys/tools/makeobjops.awk Tue May 7 10:01:45 2019 (r347223) +++ head/sys/tools/makeobjops.awk Tue May 7 13:04:26 2019 (r347224) @@ -424,7 +424,7 @@ for (file_i = 0; file_i < num_files; file_i++) { common_head = \ "/*\n" \ - " * This file is produced automatically.\n" \ + " * This file is @generated automatically.\n" \ " * Do not modify anything in here by hand.\n" \ " *\n" \ " * Created from source file\n" \ Modified: head/sys/tools/vnode_if.awk ============================================================================== --- head/sys/tools/vnode_if.awk Tue May 7 10:01:45 2019 (r347223) +++ head/sys/tools/vnode_if.awk Tue May 7 13:04:26 2019 (r347224) @@ -141,7 +141,7 @@ if (!srcfile) common_head = \ "/*\n" \ - " * This file is produced automatically.\n" \ + " * This file is @generated automatically.\n" \ " * Do not modify anything in here by hand.\n" \ " *\n" \ " * Created from $FreeBSD$\n" \ From owner-svn-src-all@freebsd.org Tue May 7 13:41:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F4791587744; Tue, 7 May 2019 13:41:45 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4077289BD0; Tue, 7 May 2019 13:41:45 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2CE71EFD6; Tue, 7 May 2019 13:41:44 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47Dfiq8081687; Tue, 7 May 2019 13:41:44 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47DfiER081679; Tue, 7 May 2019 13:41:44 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905071341.x47DfiER081679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 7 May 2019 13:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347225 - in head/sys: conf riscv/include riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf riscv/include riscv/riscv X-SVN-Commit-Revision: 347225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4077289BD0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 13:41:45 -0000 Author: br Date: Tue May 7 13:41:43 2019 New Revision: 347225 URL: https://svnweb.freebsd.org/changeset/base/347225 Log: Provide a template for busdma code for RISC-V. RISC-V ISA specifies no cache management instructions so leave cache operations in cpufunc.h as no-op for now. Note some new hardware comes with their own memory-mapped cache management controller. Tested on HiFive Unleashed board with cgem(4). Reviewed by: markj Obtained from: arm64 Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20126 Added: head/sys/riscv/include/bus_dma_impl.h (contents, props changed) head/sys/riscv/riscv/busdma_bounce.c (contents, props changed) Modified: head/sys/conf/files.riscv head/sys/riscv/include/bus_dma.h head/sys/riscv/include/cpufunc.h head/sys/riscv/riscv/busdma_machdep.c head/sys/riscv/riscv/machdep.c Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Tue May 7 13:04:26 2019 (r347224) +++ head/sys/conf/files.riscv Tue May 7 13:41:43 2019 (r347225) @@ -28,6 +28,7 @@ libkern/memset.c standard riscv/riscv/autoconf.c standard riscv/riscv/bus_machdep.c standard riscv/riscv/bus_space_asm.S standard +riscv/riscv/busdma_bounce.c standard riscv/riscv/busdma_machdep.c standard riscv/riscv/clock.c standard riscv/riscv/copyinout.S standard Modified: head/sys/riscv/include/bus_dma.h ============================================================================== --- head/sys/riscv/include/bus_dma.h Tue May 7 13:04:26 2019 (r347224) +++ head/sys/riscv/include/bus_dma.h Tue May 7 13:41:43 2019 (r347225) @@ -3,7 +3,139 @@ #ifndef _MACHINE_BUS_DMA_H_ #define _MACHINE_BUS_DMA_H_ +#define WANT_INLINE_DMAMAP #include -#include + +#include + +/* + * Allocate a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static inline int +bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->map_create(dmat, flags, mapp)); +} + +/* + * Destroy a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static inline int +bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->map_destroy(dmat, map)); +} + +/* + * Allocate a piece of memory that can be efficiently mapped into + * bus device space based on the constraints listed in the dma tag. + * A dmamap to for use with dmamap_load is also allocated. + */ +static inline int +bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->mem_alloc(dmat, vaddr, flags, mapp)); +} + +/* + * Free a piece of memory and it's allociated dmamap, that was allocated + * via bus_dmamem_alloc. Make the same choice for free/contigfree. + */ +static inline void +bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + tc->impl->mem_free(dmat, vaddr, map); +} + +/* + * Release the mapping held by map. + */ +static inline void +bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + tc->impl->map_unload(dmat, map); +} + +static inline void +bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + tc->impl->map_sync(dmat, map, op); +} + +static inline int +_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, + bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->load_phys(dmat, map, buf, buflen, flags, segs, + segp)); +} + +static inline int +_bus_dmamap_load_ma(bus_dma_tag_t dmat, bus_dmamap_t map, struct vm_page **ma, + bus_size_t tlen, int ma_offs, int flags, bus_dma_segment_t *segs, + int *segp) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->load_ma(dmat, map, ma, tlen, ma_offs, flags, + segs, segp)); +} + +static inline int +_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, + bus_size_t buflen, struct pmap *pmap, int flags, bus_dma_segment_t *segs, + int *segp) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->load_buffer(dmat, map, buf, buflen, pmap, flags, segs, + segp)); +} + +static inline void +_bus_dmamap_waitok(bus_dma_tag_t dmat, bus_dmamap_t map, + struct memdesc *mem, bus_dmamap_callback_t *callback, void *callback_arg) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + tc->impl->map_waitok(dmat, map, mem, callback, callback_arg); +} + +static inline bus_dma_segment_t * +_bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, int error) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->map_complete(dmat, map, segs, nsegs, error)); +} #endif /* !_MACHINE_BUS_DMA_H_ */ Added: head/sys/riscv/include/bus_dma_impl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/include/bus_dma_impl.h Tue May 7 13:41:43 2019 (r347225) @@ -0,0 +1,96 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_BUS_DMA_IMPL_H_ +#define _MACHINE_BUS_DMA_IMPL_H_ + +struct bus_dma_tag_common { + struct bus_dma_impl *impl; + struct bus_dma_tag_common *parent; + bus_size_t alignment; + bus_addr_t boundary; + bus_addr_t lowaddr; + bus_addr_t highaddr; + bus_dma_filter_t *filter; + void *filterarg; + bus_size_t maxsize; + u_int nsegments; + bus_size_t maxsegsz; + int flags; + bus_dma_lock_t *lockfunc; + void *lockfuncarg; + int ref_count; +}; + +struct bus_dma_impl { + int (*tag_create)(bus_dma_tag_t parent, + bus_size_t alignment, bus_addr_t boundary, bus_addr_t lowaddr, + bus_addr_t highaddr, bus_dma_filter_t *filter, + void *filterarg, bus_size_t maxsize, int nsegments, + bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat); + int (*tag_destroy)(bus_dma_tag_t dmat); + int (*map_create)(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp); + int (*map_destroy)(bus_dma_tag_t dmat, bus_dmamap_t map); + int (*mem_alloc)(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp); + void (*mem_free)(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map); + int (*load_ma)(bus_dma_tag_t dmat, bus_dmamap_t map, + struct vm_page **ma, bus_size_t tlen, int ma_offs, int flags, + bus_dma_segment_t *segs, int *segp); + int (*load_phys)(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags, + bus_dma_segment_t *segs, int *segp); + int (*load_buffer)(bus_dma_tag_t dmat, bus_dmamap_t map, + void *buf, bus_size_t buflen, struct pmap *pmap, int flags, + bus_dma_segment_t *segs, int *segp); + void (*map_waitok)(bus_dma_tag_t dmat, bus_dmamap_t map, + struct memdesc *mem, bus_dmamap_callback_t *callback, + void *callback_arg); + bus_dma_segment_t *(*map_complete)(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, int error); + void (*map_unload)(bus_dma_tag_t dmat, bus_dmamap_t map); + void (*map_sync)(bus_dma_tag_t dmat, bus_dmamap_t map, + bus_dmasync_op_t op); +}; + +void bus_dma_dflt_lock(void *arg, bus_dma_lock_op_t op); +int bus_dma_run_filter(struct bus_dma_tag_common *dmat, bus_addr_t paddr); +int common_bus_dma_tag_create(struct bus_dma_tag_common *parent, + bus_size_t alignment, + bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, + bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, + int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, size_t sz, void **dmat); + +extern struct bus_dma_impl bus_dma_bounce_impl; + +#endif Modified: head/sys/riscv/include/cpufunc.h ============================================================================== --- head/sys/riscv/include/cpufunc.h Tue May 7 13:04:26 2019 (r347224) +++ head/sys/riscv/include/cpufunc.h Tue May 7 13:41:43 2019 (r347225) @@ -109,6 +109,17 @@ sfence_vma_page(uintptr_t addr) #define rdinstret() csr_read64(instret) #define rdhpmcounter(n) csr_read64(hpmcounter##n) +extern int64_t dcache_line_size; +extern int64_t icache_line_size; + +#define cpu_dcache_wbinv_range(a, s) +#define cpu_dcache_inv_range(a, s) +#define cpu_dcache_wb_range(a, s) + +#define cpu_idcache_wbinv_range(a, s) +#define cpu_icache_sync_range(a, s) +#define cpu_icache_sync_range_checked(a, s) + static __inline void load_satp(uint64_t val) { Added: head/sys/riscv/riscv/busdma_bounce.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/riscv/busdma_bounce.c Tue May 7 13:41:43 2019 (r347225) @@ -0,0 +1,1330 @@ +/*- + * Copyright (c) 1997, 1998 Justin T. Gibbs. + * Copyright (c) 2015-2016 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Andrew Turner + * under sponsorship of the FreeBSD Foundation. + * + * Portions of this software were developed by Semihalf + * under sponsorship of the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define MAX_BPAGES 4096 + +enum { + BF_COULD_BOUNCE = 0x01, + BF_MIN_ALLOC_COMP = 0x02, + BF_KMEM_ALLOC = 0x04, + BF_COHERENT = 0x10, +}; + +struct bounce_zone; + +struct bus_dma_tag { + struct bus_dma_tag_common common; + int map_count; + int bounce_flags; + bus_dma_segment_t *segments; + struct bounce_zone *bounce_zone; +}; + +struct bounce_page { + vm_offset_t vaddr; /* kva of bounce buffer */ + bus_addr_t busaddr; /* Physical address */ + vm_offset_t datavaddr; /* kva of client data */ + vm_page_t datapage; /* physical page of client data */ + vm_offset_t dataoffs; /* page offset of client data */ + bus_size_t datacount; /* client data count */ + STAILQ_ENTRY(bounce_page) links; +}; + +int busdma_swi_pending; + +struct bounce_zone { + STAILQ_ENTRY(bounce_zone) links; + STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; + int total_bpages; + int free_bpages; + int reserved_bpages; + int active_bpages; + int total_bounced; + int total_deferred; + int map_count; + bus_size_t alignment; + bus_addr_t lowaddr; + char zoneid[8]; + char lowaddrid[20]; + struct sysctl_ctx_list sysctl_tree; + struct sysctl_oid *sysctl_tree_top; +}; + +static struct mtx bounce_lock; +static int total_bpages; +static int busdma_zonecount; +static STAILQ_HEAD(, bounce_zone) bounce_zone_list; + +static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, + "Total bounce pages"); + +struct sync_list { + vm_offset_t vaddr; /* kva of client data */ + bus_addr_t paddr; /* physical address */ + vm_page_t pages; /* starting page of client data */ + bus_size_t datacount; /* client data count */ +}; + +struct bus_dmamap { + struct bp_list bpages; + int pagesneeded; + int pagesreserved; + bus_dma_tag_t dmat; + struct memdesc mem; + bus_dmamap_callback_t *callback; + void *callback_arg; + STAILQ_ENTRY(bus_dmamap) links; + u_int flags; +#define DMAMAP_COULD_BOUNCE (1 << 0) +#define DMAMAP_FROM_DMAMEM (1 << 1) + int sync_count; + struct sync_list slist[]; +}; + +static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; + +static void init_bounce_pages(void *dummy); +static int alloc_bounce_zone(bus_dma_tag_t dmat); +static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); +static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int commit); +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_offset_t vaddr, bus_addr_t addr, bus_size_t size); +static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); +int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); +static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + pmap_t pmap, void *buf, bus_size_t buflen, int flags); +static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags); +static int _bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int flags); + +/* + * Allocate a device specific dma_tag. + */ +static int +bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, + bus_addr_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, + bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, + int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat) +{ + bus_dma_tag_t newtag; + int error; + + *dmat = NULL; + error = common_bus_dma_tag_create(parent != NULL ? &parent->common : + NULL, alignment, boundary, lowaddr, highaddr, filter, filterarg, + maxsize, nsegments, maxsegsz, flags, lockfunc, lockfuncarg, + sizeof (struct bus_dma_tag), (void **)&newtag); + if (error != 0) + return (error); + + newtag->common.impl = &bus_dma_bounce_impl; + newtag->map_count = 0; + newtag->segments = NULL; + + if ((flags & BUS_DMA_COHERENT) != 0) + newtag->bounce_flags |= BF_COHERENT; + + if (parent != NULL) { + if ((newtag->common.filter != NULL || + (parent->bounce_flags & BF_COULD_BOUNCE) != 0)) + newtag->bounce_flags |= BF_COULD_BOUNCE; + + /* Copy some flags from the parent */ + newtag->bounce_flags |= parent->bounce_flags & BF_COHERENT; + } + + if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || + newtag->common.alignment > 1) + newtag->bounce_flags |= BF_COULD_BOUNCE; + + if (((newtag->bounce_flags & BF_COULD_BOUNCE) != 0) && + (flags & BUS_DMA_ALLOCNOW) != 0) { + struct bounce_zone *bz; + + /* Must bounce */ + if ((error = alloc_bounce_zone(newtag)) != 0) { + free(newtag, M_DEVBUF); + return (error); + } + bz = newtag->bounce_zone; + + if (ptoa(bz->total_bpages) < maxsize) { + int pages; + + pages = atop(maxsize) - bz->total_bpages; + + /* Add pages to our bounce pool */ + if (alloc_bounce_pages(newtag, pages) < pages) + error = ENOMEM; + } + /* Performed initial allocation */ + newtag->bounce_flags |= BF_MIN_ALLOC_COMP; + } else + error = 0; + + if (error != 0) + free(newtag, M_DEVBUF); + else + *dmat = newtag; + CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", + __func__, newtag, (newtag != NULL ? newtag->common.flags : 0), + error); + return (error); +} + +static int +bounce_bus_dma_tag_destroy(bus_dma_tag_t dmat) +{ + bus_dma_tag_t dmat_copy, parent; + int error; + + error = 0; + dmat_copy = dmat; + + if (dmat != NULL) { + if (dmat->map_count != 0) { + error = EBUSY; + goto out; + } + while (dmat != NULL) { + parent = (bus_dma_tag_t)dmat->common.parent; + atomic_subtract_int(&dmat->common.ref_count, 1); + if (dmat->common.ref_count == 0) { + if (dmat->segments != NULL) + free(dmat->segments, M_DEVBUF); + free(dmat, M_DEVBUF); + /* + * Last reference count, so + * release our reference + * count on our parent. + */ + dmat = parent; + } else + dmat = NULL; + } + } +out: + CTR3(KTR_BUSDMA, "%s tag %p error %d", __func__, dmat_copy, error); + return (error); +} + +static bus_dmamap_t +alloc_dmamap(bus_dma_tag_t dmat, int flags) +{ + u_long mapsize; + bus_dmamap_t map; + + mapsize = sizeof(*map); + mapsize += sizeof(struct sync_list) * dmat->common.nsegments; + map = malloc(mapsize, M_DEVBUF, flags | M_ZERO); + if (map == NULL) + return (NULL); + + /* Initialize the new map */ + STAILQ_INIT(&map->bpages); + + return (map); +} + +/* + * Allocate a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static int +bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) +{ + struct bounce_zone *bz; + int error, maxpages, pages; + + error = 0; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->common.nsegments, + M_DEVBUF, M_NOWAIT); + if (dmat->segments == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + } + + *mapp = alloc_dmamap(dmat, M_NOWAIT); + if (*mapp == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + + /* + * Bouncing might be required if the driver asks for an active + * exclusion region, a data alignment that is stricter than 1, and/or + * an active address boundary. + */ + if (dmat->bounce_flags & BF_COULD_BOUNCE) { + /* Must bounce */ + if (dmat->bounce_zone == NULL) { + if ((error = alloc_bounce_zone(dmat)) != 0) { + free(*mapp, M_DEVBUF); + return (error); + } + } + bz = dmat->bounce_zone; + + (*mapp)->flags = DMAMAP_COULD_BOUNCE; + + /* + * Attempt to add pages to our pool on a per-instance + * basis up to a sane limit. + */ + if (dmat->common.alignment > 1) + maxpages = MAX_BPAGES; + else + maxpages = MIN(MAX_BPAGES, Maxmem - + atop(dmat->common.lowaddr)); + if ((dmat->bounce_flags & BF_MIN_ALLOC_COMP) == 0 || + (bz->map_count > 0 && bz->total_bpages < maxpages)) { + pages = MAX(atop(dmat->common.maxsize), 1); + pages = MIN(maxpages - bz->total_bpages, pages); + pages = MAX(pages, 1); + if (alloc_bounce_pages(dmat, pages) < pages) + error = ENOMEM; + if ((dmat->bounce_flags & BF_MIN_ALLOC_COMP) + == 0) { + if (error == 0) { + dmat->bounce_flags |= + BF_MIN_ALLOC_COMP; + } + } else + error = 0; + } + bz->map_count++; + } + if (error == 0) + dmat->map_count++; + else + free(*mapp, M_DEVBUF); + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, error); + return (error); +} + +/* + * Destroy a handle for mapping from kva/uva/physical + * address space into bus device space. + */ +static int +bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) +{ + + /* Check we are destroying the correct map type */ + if ((map->flags & DMAMAP_FROM_DMAMEM) != 0) + panic("bounce_bus_dmamap_destroy: Invalid map freed\n"); + + if (STAILQ_FIRST(&map->bpages) != NULL || map->sync_count != 0) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, EBUSY); + return (EBUSY); + } + if (dmat->bounce_zone) { + KASSERT((map->flags & DMAMAP_COULD_BOUNCE) != 0, + ("%s: Bounce zone when cannot bounce", __func__)); + dmat->bounce_zone->map_count--; + } + free(map, M_DEVBUF); + dmat->map_count--; + CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); + return (0); +} + + +/* + * Allocate a piece of memory that can be efficiently mapped into + * bus device space based on the constraints lited in the dma tag. + * A dmamap to for use with dmamap_load is also allocated. + */ +static int +bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, + bus_dmamap_t *mapp) +{ + /* + * XXX ARM64TODO: + * This bus_dma implementation requires IO-Coherent architecutre. + * If IO-Coherency is not guaranteed, the BUS_DMA_COHERENT flag has + * to be implented using non-cacheable memory. + */ + + vm_memattr_t attr; + int mflags; + + if (flags & BUS_DMA_NOWAIT) + mflags = M_NOWAIT; + else + mflags = M_WAITOK; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->common.nsegments, + M_DEVBUF, mflags); + if (dmat->segments == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, ENOMEM); + return (ENOMEM); + } + } + if (flags & BUS_DMA_ZERO) + mflags |= M_ZERO; + if (flags & BUS_DMA_NOCACHE) + attr = VM_MEMATTR_UNCACHEABLE; + else if ((flags & BUS_DMA_COHERENT) != 0 && + (dmat->bounce_flags & BF_COHERENT) == 0) + /* + * If we have a non-coherent tag, and are trying to allocate + * a coherent block of memory it needs to be uncached. + */ + attr = VM_MEMATTR_UNCACHEABLE; + else + attr = VM_MEMATTR_DEFAULT; + + /* + * Create the map, but don't set the could bounce flag as + * this allocation should never bounce; + */ + *mapp = alloc_dmamap(dmat, mflags); + if (*mapp == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, ENOMEM); + return (ENOMEM); + } + (*mapp)->flags = DMAMAP_FROM_DMAMEM; + + /* + * Allocate the buffer from the malloc(9) allocator if... + * - It's small enough to fit into a single power of two sized bucket. + * - The alignment is less than or equal to the maximum size + * - The low address requirement is fulfilled. + * else allocate non-contiguous pages if... + * - The page count that could get allocated doesn't exceed + * nsegments also when the maximum segment size is less + * than PAGE_SIZE. + * - The alignment constraint isn't larger than a page boundary. + * - There are no boundary-crossing constraints. + * else allocate a block of contiguous pages because one or more of the + * constraints is something that only the contig allocator can fulfill. + * + * NOTE: The (dmat->common.alignment <= dmat->maxsize) check + * below is just a quick hack. The exact alignment guarantees + * of malloc(9) need to be nailed down, and the code below + * should be rewritten to take that into account. + * + * In the meantime warn the user if malloc gets it wrong. + */ + if ((dmat->common.maxsize <= PAGE_SIZE) && + (dmat->common.alignment <= dmat->common.maxsize) && + dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && + attr == VM_MEMATTR_DEFAULT) { + *vaddr = malloc(dmat->common.maxsize, M_DEVBUF, mflags); + } else if (dmat->common.nsegments >= + howmany(dmat->common.maxsize, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && + dmat->common.alignment <= PAGE_SIZE && + (dmat->common.boundary % PAGE_SIZE) == 0) { + /* Page-based multi-segment allocations allowed */ + *vaddr = (void *)kmem_alloc_attr(dmat->common.maxsize, mflags, + 0ul, dmat->common.lowaddr, attr); + dmat->bounce_flags |= BF_KMEM_ALLOC; + } else { + *vaddr = (void *)kmem_alloc_contig(dmat->common.maxsize, mflags, + 0ul, dmat->common.lowaddr, dmat->common.alignment != 0 ? + dmat->common.alignment : 1ul, dmat->common.boundary, attr); + dmat->bounce_flags |= BF_KMEM_ALLOC; + } + if (*vaddr == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, ENOMEM); + free(*mapp, M_DEVBUF); + return (ENOMEM); + } else if (vtophys(*vaddr) & (dmat->common.alignment - 1)) { + printf("bus_dmamem_alloc failed to align memory properly.\n"); + } + dmat->map_count++; + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->common.flags, 0); + return (0); +} + +/* + * Free a piece of memory and it's allociated dmamap, that was allocated + * via bus_dmamem_alloc. Make the same choice for free/contigfree. + */ +static void +bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) +{ + + /* + * Check the map came from bounce_bus_dmamem_alloc, so the map + * should be NULL and the BF_KMEM_ALLOC flag cleared if malloc() + * was used and set if kmem_alloc_contig() was used. + */ + if ((map->flags & DMAMAP_FROM_DMAMEM) == 0) + panic("bus_dmamem_free: Invalid map freed\n"); + if ((dmat->bounce_flags & BF_KMEM_ALLOC) == 0) + free(vaddr, M_DEVBUF); + else + kmem_free((vm_offset_t)vaddr, dmat->common.maxsize); + free(map, M_DEVBUF); + dmat->map_count--; + CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, + dmat->bounce_flags); +} + +static void +_bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, + bus_size_t buflen, int flags) +{ + bus_addr_t curaddr; + bus_size_t sgsize; + + if ((map->flags & DMAMAP_COULD_BOUNCE) != 0 && map->pagesneeded == 0) { + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + curaddr = buf; + while (buflen != 0) { + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = MIN(sgsize, + PAGE_SIZE - (curaddr & PAGE_MASK)); + map->pagesneeded++; + } + curaddr += sgsize; + buflen -= sgsize; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } +} + +static void +_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags) +{ + vm_offset_t vaddr; + vm_offset_t vendaddr; + bus_addr_t paddr; + bus_size_t sg_len; + + if ((map->flags & DMAMAP_COULD_BOUNCE) != 0 && map->pagesneeded == 0) { + CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " + "alignment= %d", dmat->common.lowaddr, + ptoa((vm_paddr_t)Maxmem), + dmat->common.boundary, dmat->common.alignment); + CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", map, + map->pagesneeded); + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + vaddr = (vm_offset_t)buf; + vendaddr = (vm_offset_t)buf + buflen; + + while (vaddr < vendaddr) { + sg_len = PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK); + if (pmap == kernel_pmap) + paddr = pmap_kextract(vaddr); + else + paddr = pmap_extract(pmap, vaddr); + if (bus_dma_run_filter(&dmat->common, paddr) != 0) { + sg_len = roundup2(sg_len, + dmat->common.alignment); + map->pagesneeded++; + } + vaddr += sg_len; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } +} + +static int +_bus_dmamap_reserve_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int flags) +{ + + /* Reserve Necessary Bounce Pages */ + mtx_lock(&bounce_lock); + if (flags & BUS_DMA_NOWAIT) { + if (reserve_bounce_pages(dmat, map, 0) != 0) { + mtx_unlock(&bounce_lock); + return (ENOMEM); + } + } else { + if (reserve_bounce_pages(dmat, map, 1) != 0) { + /* Queue us for resources */ + STAILQ_INSERT_TAIL(&bounce_map_waitinglist, map, links); + mtx_unlock(&bounce_lock); + return (EINPROGRESS); + } + } + mtx_unlock(&bounce_lock); + + return (0); +} + +/* + * Add a single contiguous physical range to the segment list. + */ +static int +_bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr, + bus_size_t sgsize, bus_dma_segment_t *segs, int *segp) +{ + bus_addr_t baddr, bmask; + int seg; + + /* + * Make sure we don't cross any boundaries. + */ + bmask = ~(dmat->common.boundary - 1); + if (dmat->common.boundary > 0) { + baddr = (curaddr + dmat->common.boundary) & bmask; + if (sgsize > (baddr - curaddr)) + sgsize = (baddr - curaddr); + } + + /* + * Insert chunk into a segment, coalescing with + * previous segment if possible. + */ + seg = *segp; + if (seg == -1) { + seg = 0; + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + } else { + if (curaddr == segs[seg].ds_addr + segs[seg].ds_len && + (segs[seg].ds_len + sgsize) <= dmat->common.maxsegsz && + (dmat->common.boundary == 0 || + (segs[seg].ds_addr & bmask) == (curaddr & bmask))) + segs[seg].ds_len += sgsize; + else { + if (++seg >= dmat->common.nsegments) + return (0); + segs[seg].ds_addr = curaddr; + segs[seg].ds_len = sgsize; + } + } + *segp = seg; + return (sgsize); +} + +/* + * Utility function to load a physical buffer. segp contains + * the starting segment on entrace, and the ending segment on exit. + */ +static int +bounce_bus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t buf, bus_size_t buflen, int flags, bus_dma_segment_t *segs, + int *segp) +{ + struct sync_list *sl; + bus_size_t sgsize; + bus_addr_t curaddr, sl_end; + int error; + + if (segs == NULL) + segs = dmat->segments; + + if ((dmat->bounce_flags & BF_COULD_BOUNCE) != 0) { + _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); + if (map->pagesneeded != 0) { + error = _bus_dmamap_reserve_pages(dmat, map, flags); + if (error) + return (error); + } + } + + sl = map->slist + map->sync_count - 1; + sl_end = 0; + + while (buflen > 0) { + curaddr = buf; + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (((dmat->bounce_flags & BF_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && + bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = MIN(sgsize, PAGE_SIZE - (curaddr & PAGE_MASK)); + curaddr = add_bounce_page(dmat, map, 0, curaddr, + sgsize); + } else if ((dmat->bounce_flags & BF_COHERENT) == 0) { + if (map->sync_count > 0) + sl_end = sl->paddr + sl->datacount; + + if (map->sync_count == 0 || curaddr != sl_end) { + if (++map->sync_count > dmat->common.nsegments) + break; + sl++; + sl->vaddr = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 7 14:32:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47D521588E8A; Tue, 7 May 2019 14:32:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF3D68B7B0; Tue, 7 May 2019 14:32:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEBAD1F9B3; Tue, 7 May 2019 14:32:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47EWHS3012347; Tue, 7 May 2019 14:32:17 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47EWHYH012346; Tue, 7 May 2019 14:32:17 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905071432.x47EWHYH012346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 7 May 2019 14:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347226 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 347226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF3D68B7B0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 14:32:18 -0000 Author: br Date: Tue May 7 14:32:17 2019 New Revision: 347226 URL: https://svnweb.freebsd.org/changeset/base/347226 Log: Disable interrupts first and then set spinlock_count to 1. Otherwise interrupt can be generated just after setting spinlock_count and before disabling interrupts. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/machdep.c Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Tue May 7 13:41:43 2019 (r347225) +++ head/sys/riscv/riscv/machdep.c Tue May 7 14:32:17 2019 (r347226) @@ -457,11 +457,13 @@ void spinlock_enter(void) { struct thread *td; + register_t reg; td = curthread; if (td->td_md.md_spinlock_count == 0) { + reg = intr_disable(); td->td_md.md_spinlock_count = 1; - td->td_md.md_saved_sstatus_ie = intr_disable(); + td->td_md.md_saved_sstatus_ie = reg; } else td->td_md.md_spinlock_count++; critical_enter(); From owner-svn-src-all@freebsd.org Tue May 7 15:03:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15A391589F0B; Tue, 7 May 2019 15:03:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB9F28CA26; Tue, 7 May 2019 15:03:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B2B81FEE5; Tue, 7 May 2019 15:03:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47F3Quu028591; Tue, 7 May 2019 15:03:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47F3QKv028590; Tue, 7 May 2019 15:03:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905071503.x47F3QKv028590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 May 2019 15:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347227 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347227 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AB9F28CA26 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 15:03:27 -0000 Author: markj Date: Tue May 7 15:03:26 2019 New Revision: 347227 URL: https://svnweb.freebsd.org/changeset/base/347227 Log: Simplify the test against maxproc in fork1(). Previously nprocs_new would be tested against maxprocs twice when nprocs_new < maxprocs - 10. Eliminate the unnecessary comparison. Submitted by: Wuyang Chung GitHub PR: https://github.com/freebsd/freebsd/pull/397 MFC after: 1 week Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Tue May 7 14:32:17 2019 (r347226) +++ head/sys/kern/kern_fork.c Tue May 7 15:03:26 2019 (r347227) @@ -883,18 +883,20 @@ fork1(struct thread *td, struct fork_req *fr) * processes; don't let root exceed the limit. */ nprocs_new = atomic_fetchadd_int(&nprocs, 1) + 1; - if ((nprocs_new >= maxproc - 10 && - priv_check_cred(td->td_ucred, PRIV_MAXPROC) != 0) || - nprocs_new >= maxproc) { - error = EAGAIN; - sx_xlock(&allproc_lock); - if (ppsratecheck(&lastfail, &curfail, 1)) { - printf("maxproc limit exceeded by uid %u (pid %d); " - "see tuning(7) and login.conf(5)\n", - td->td_ucred->cr_ruid, p1->p_pid); + if (nprocs_new >= maxproc - 10) { + if (priv_check_cred(td->td_ucred, PRIV_MAXPROC) != 0 || + nprocs_new >= maxproc) { + error = EAGAIN; + sx_xlock(&allproc_lock); + if (ppsratecheck(&lastfail, &curfail, 1)) { + printf("maxproc limit exceeded by uid %u " + "(pid %d); see tuning(7) and " + "login.conf(5)\n", + td->td_ucred->cr_ruid, p1->p_pid); + } + sx_xunlock(&allproc_lock); + goto fail2; } - sx_xunlock(&allproc_lock); - goto fail2; } /* From owner-svn-src-all@freebsd.org Tue May 7 15:45:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 735B3158B98A; Tue, 7 May 2019 15:45:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id BC48A8EBB6; Tue, 7 May 2019 15:45:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id EC7EDD32A; Wed, 8 May 2019 01:45:42 +1000 (AEST) Date: Wed, 8 May 2019 01:45:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347063 - head/sys/kern In-Reply-To: <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> Message-ID: <20190508001838.B1127@besplex.bde.org> References: <201905032126.x43LQilu092655@repo.freebsd.org> <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> <20190506184502.GA35464@raichu> <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=tpgNXukc0hzhgi0M79IA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: BC48A8EBB6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.981,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 15:45:53 -0000 On Mon, 6 May 2019, John Baldwin wrote: > On 5/6/19 11:45 AM, Mark Johnston wrote: >> On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: >>> On 5/3/19 2:26 PM, Mark Johnston wrote: >>>> Author: markj >>>> Date: Fri May 3 21:26:44 2019 >>>> New Revision: 347063 >>>> URL: https://svnweb.freebsd.org/changeset/base/347063 >>>> >>>> Log: >>>> Disallow excessively small times of day in clock_settime(2). This actually disallows negative timespecs in clock_settime(), with collateral disallowment for small positive times. I don't like disallowing either. The bounds checking in the clock code is badly implemented, so it crashes on such times even if the clock hardware supports them, but clock_settime() is privileged and root never makes mistakes. This breaks: - testing of setting negative times - my enclosed test to demonstrate bugs in the bounds checking. >>>> >>>> Reported by: syzkaller >>>> Reviewed by: cem, kib >>>> MFC after: 1 week >>>> Sponsored by: The FreeBSD Foundation >>>> Differential Revision: https://reviews.freebsd.org/D20151 >>>> >>>> Modified: >>>> head/sys/kern/kern_time.c >>>> >>>> Modified: head/sys/kern/kern_time.c >>>> ============================================================================== >>>> --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 (r347062) >>>> +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 (r347063) >>>> @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t clock_ >>>> if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || >>>> ats->tv_sec < 0) >>>> return (EINVAL); >>>> - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60) >>>> + if (!allow_insane_settime && >>>> + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || >>>> + ats->tv_sec < utc_offset())) >>>> return (EINVAL); The test of the upper bound is broken. It not only uses the long long abomination, but uses large unsigned type which gives unsigned poisoning for all supported sizes of time_t. So negative times were already broken here (without allow_insane_settime). They are converted to large positive times so are treated as insanely large. utc_offset() uses a too-small signed type with no bounds checking so it has overflow bugs but doesn't give unsigned poisoning. time_t is signed on all supported arches. It could be uint32_t so as to work until 2106 on 32-bit arches, but this would give unsigned poisoning and there is too much broken code for changing it to that to just work. So the new code doesn't have unsigned poisoning, and it disallows most negative values even when utc_offset() is negative. >>>> /* XXX Don't convert nsec->usec and back */ >>>> TIMESPEC_TO_TIMEVAL(&atv, ats); >>> >>> Pardon my ignorance, but I can't see why you are checking against utc_offset() >>> vs some small constant? None of the discussion in the review mentioned the >>> reason for using this particular value, and I didn't see any comparisons >>> against utc_offset or kernadjtz in kern_clock_setttime() or settime() that >>> would have underflowed or panicked. Can you give a bit more detail on why >>> utc_offset() is the lower bound? Thanks. >> >> I chose it because we subtract utc_offset() from the time passed in to >> clock_settime(); see settime_task_func(). That subtraction caused the >> underflow that later caused the observed panics. Not underflow, but overflow. Underflow is when rounding a small nonzero floating point value gives a denormal value of 0. This was the main overflow bug demonstrated by my test program. > Ok, thanks. A few things I didn't see anyone else note in the review then: > > 1) This subtraction is actually not done for all rtc drivers, so it seems > like we might block small times for RTC clocks that set > CLOCKF_GETTIME_NO_ADJ. It is probably bogus to check it for them. The check is misplaced for them -- this level can't know the details. > 2) utc_offset can be negative for machines using local time in timezones > "before" UTC. This is why it is less bad to check utc_offset() than 0. Otherwise, it would be impossible to test setting the time to the Epoch in these timezones. Hmm, the offset is confusing, especially its sign. In these timezones, when the time is the Epoch, the local time is before the Epoch so the RTC hardware needs to be able to represent year 1969 even if utc_offset() is sane. But some clock drivers convery 1969 to 2069, and the sanity check in clock_ct_to_ts() is insane -- it doesn't allow years before 1970, although signed time_t has no problems before year 1901. So testing of setting the time to the Epoch in such timezones would show that even if the RTC can be set to 1969, the kernel time can't be restored to the Epoch from the RTC. I don't know of any panics from buggy bounds checks for this. The worst that can happen is that adjkerntz is preposterous. Then utc_offset() is preposterous and adding it can change a 32-bit time_t to anything and a 64-bit time_t by a lot > I suppose we don't think any FreeBSD machines actually need to set the > running clock to 0 anyway so fixing it here rather than rejecting invalid > values only for RTCs that can't handle it is probably ok, but the > connection doesn't feel obvious that we are rejecting times that might > be non-representable in RTCs. We do some up-front checks because the layering for passing up details for individual RTCs would be onerous. I only like the up-front check for the year being <= 2037 even with 64-bit time_t, and some for hours/minutes/seconds/etc being in range. libkern still has horrible inline functions for bcd conversions, with errors mishandled by KASSERT()s, because passing up the errors would be to hard. But the KASSERT()s are worse. I think they are (mostly?) unnecessary now, since most bcd conversions are in clock_bcd_to_ts() which does correct bounds checking resulting in error EINVAL. Move all the bcd conversions to there after the validbcd() checks and it would be obvious that the KASSERT()s are not needed. Here is my test program. It was last edited on Dec 14 1901 (sic), after using itself to set the time back to then. I didn't report the bug then, but reported it a year or 2 ago. XX #include XX #include XX XX int XX main(void) XX { XX struct timeval tv; XX struct timezone tz; XX int r; XX XX r = gettimeofday(&tv, &tz); XX if (r != 0) XX err(1, "gettimeofday"); XX tv.tv_usec = 0; XX #ifdef NEG Compile with -DNEG to get the panic in old versions. XX tv.tv_sec = 0; XX /* XX * The RTC time wants to be tv_sec + adjkerntz - tz_minuteswest. XX * Make this go negative (and panic) by putting a positive value XX * in tz_minuteswest large enough to kill any non-perverse value XX * in adjkerntz. We can get the panic (and lots of races) more XX * easily using sysctl to put perverse values in adjkerntz before XX * calling settimeofday. XX */ XX tz.tz_minuteswest = 24 * 60; /* 1 day before 1970 */ Someone axed tz, so before this commit, to get the panic it was necessary to set adjkerntz using its sysctl instead of setting tz using settimeofday(). After this commit, I think the panic is "fixed". Set adjkerntz to test the fix. XX #elif YETANOTHERBUG XX tv.tv_sec = INT_MAX - 2; /* works */ XX tv.tv_sec = INT_MAX - 1; /* should give 2038; actually 1901 */ XX tv.tv_sec = INT_MAX; /* should give 2038; actually 1901 */ XX tz.tz_minuteswest = 0; XX #else XX tv.tv_sec = INT_MAX - 2; XX tz.tz_minuteswest = -24 * 60; /* 1 day after end of 32-bit time_t */ XX #endif XX r = settimeofday(&tv, &tz); Everything needs to use adjkerntz instead of tz. tz.tz_minuteswest gave extra possibilities for overflow, but the above only sets it to +- 1 day so give a small nonzero combined setting after adding any sane value adjkerntz, to avoid touching adjkerntz directly. Without tz, just use adjkerntz instead. XX if (r != 0) XX err(1, "1st settimeofday"); XX /* XX * One of many bugs in settimeofday() is that its tz_minuteswest XX * setting doesn't apply until the next call. Make this call. XX */ XX r = settimeofday(&tv, &tz); Another bug that was fixed by removing tz. XX if (r != 0) XX err(1, "2nd settimeofday"); XX return (0); XX } Insane values in adjkerntz can be used to overflow to negative years: set the RTC to year 2037, or just leave it as 2019 and use a larger adjkerntz. Then adding 1 year in adjkerntz gives 2038 which overflows to ~1901. Or start near midnight in 2037; then even a sane positive utc_offset() gives year 2038, but doesn't overflow 32-bit time_t since the overflow occurs in the middle of the year. This overflow is in the misnamed function subr_rtc.c:read_clocks(). It blindly adds the unchecked utc_offset() to the checked CLOCK_GETTIME() timespec. Root never makes mistakes, but can probably demonstrate panics here even more easily that using clock_settime(), since sysctl(8) is much easier to use than clock_settime(2). Bruce From owner-svn-src-all@freebsd.org Tue May 7 16:17:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AD78158C712; Tue, 7 May 2019 16:17:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A51748FBA5; Tue, 7 May 2019 16:17:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 773ED20B10; Tue, 7 May 2019 16:17:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47GHXaO065439; Tue, 7 May 2019 16:17:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47GHXB0065438; Tue, 7 May 2019 16:17:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905071617.x47GHXB0065438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 7 May 2019 16:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347228 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A51748FBA5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 16:17:34 -0000 Author: emaste Date: Tue May 7 16:17:33 2019 New Revision: 347228 URL: https://svnweb.freebsd.org/changeset/base/347228 Log: makesyscalls: use @generated tag in generated files Multiple tools use @generated to identify generated files (for example, in a review Phabricator will by default hide diffs in generated files). Use the @generated tag in makesyscalls.sh as we've done for other generated files. Reviewed by: cem MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20183 Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Tue May 7 15:03:26 2019 (r347227) +++ head/sys/kern/makesyscalls.sh Tue May 7 16:17:33 2019 (r347228) @@ -142,18 +142,21 @@ sed -e ' capenabled_string = \"$capenabled\" "' + # Avoid a literal generated file tag here. + generated = "@" "generated"; + split(capenabled_string, capenabled, ","); printf "\n/* The casts are bogus but will do for now. */\n" > sysent printf "struct sysent %s[] = {\n",switchname > sysent printf "/*\n * System call switch table.\n *\n" > syssw - printf " * DO NOT EDIT-- this file is automatically generated.\n" > syssw + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > syssw printf " * $%s$\n", "FreeBSD" > syssw printf " */\n\n" > syssw printf "/*\n * System call prototypes.\n *\n" > sysarg - printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysarg + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > sysarg printf " * $%s$\n", "FreeBSD" > sysarg printf " */\n\n" > sysarg printf "#ifndef %s\n", sysproto_h > sysarg @@ -187,23 +190,23 @@ sed -e ' printf "\n#ifdef %s\n\n", compat11 > syscompat11 printf "/*\n * System call names.\n *\n" > sysnames - printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > sysnames printf " * $%s$\n", "FreeBSD" > sysnames printf " */\n\n" > sysnames printf "const char *%s[] = {\n", namesname > sysnames printf "/*\n * System call numbers.\n *\n" > syshdr - printf " * DO NOT EDIT-- this file is automatically generated.\n" > syshdr + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > syshdr printf " * $%s$\n", "FreeBSD" > syshdr printf " */\n\n" > syshdr printf "# FreeBSD system call object files.\n" > sysmk - printf "# DO NOT EDIT-- this file is automatically generated.\n" > sysmk + printf "# DO NOT EDIT-- this file is automatically " generated ".\n" > sysmk printf "# $%s$\n", "FreeBSD" > sysmk printf "MIASM = " > sysmk printf "/*\n * System call argument to DTrace register array converstion.\n *\n" > systrace - printf " * DO NOT EDIT-- this file is automatically generated.\n" > systrace + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > systrace printf " * $%s$\n", "FreeBSD" > systrace printf " * This file is part of the DTrace syscall provider.\n */\n\n" > systrace printf "static void\nsystrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)\n{\n" > systrace From owner-svn-src-all@freebsd.org Tue May 7 16:40:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45CF2158CE05; Tue, 7 May 2019 16:40:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF7916A3BE; Tue, 7 May 2019 16:40:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 144BD1F617; Tue, 7 May 2019 16:40:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r347063 - head/sys/kern To: Bruce Evans Cc: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905032126.x43LQilu092655@repo.freebsd.org> <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> <20190506184502.GA35464@raichu> <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> <20190508001838.B1127@besplex.bde.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Tue, 7 May 2019 09:40:18 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190508001838.B1127@besplex.bde.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DF7916A3BE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 16:40:21 -0000 On 5/7/19 8:45 AM, Bruce Evans wrote: > On Mon, 6 May 2019, John Baldwin wrote: > >> On 5/6/19 11:45 AM, Mark Johnston wrote: >>> On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: >>>> On 5/3/19 2:26 PM, Mark Johnston wrote: >>>>> Author: markj >>>>> Date: Fri May 3 21:26:44 2019 >>>>> New Revision: 347063 >>>>> URL: https://svnweb.freebsd.org/changeset/base/347063 >>>>> >>>>> Log: >>>>> Disallow excessively small times of day in clock_settime(2). > > This actually disallows negative timespecs in clock_settime(), with > collateral disallowment for small positive times. FWIW, clock_settime already disallows negative times due to the existing check in the previous two lines: if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || ats->tv_sec < 0) return (EINVAL); I would probably lean towards not disallowing negative times as I said in one of my earlier replies, but given we have that blanket check already in place, the current patch doesn't seem to make things much worse. -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 7 17:00:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38D09158D507; Tue, 7 May 2019 17:00:10 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D479D6B054; Tue, 7 May 2019 17:00:09 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.15] (c-71-198-162-232.hsd1.ca.comcast.net [71.198.162.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 1A2B31F855; Tue, 7 May 2019 17:00:09 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.18.0.190414 Date: Tue, 07 May 2019 10:00:05 -0700 Subject: Re: svn commit: r347228 - head/sys/kern From: Ravi Pokala To: Ed Maste , , , Message-ID: Thread-Topic: svn commit: r347228 - head/sys/kern References: <201905071617.x47GHXB0065438@repo.freebsd.org> In-Reply-To: <201905071617.x47GHXB0065438@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-Rspamd-Queue-Id: D479D6B054 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.918,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 17:00:10 -0000 > + # Avoid a literal generated file tag here. > + generated =3D "@" "generated"; > + Why is that needed here, but not in r347224? -Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Ed Maste Date: 2019-05-07, Tuesday at 09:17 To: , , Subject: svn commit: r347228 - head/sys/kern Author: emaste Date: Tue May 7 16:17:33 2019 New Revision: 347228 URL: https://svnweb.freebsd.org/changeset/base/347228 Log: makesyscalls: use @generated tag in generated files =20 Multiple tools use @generated to identify generated files (for example, in a review Phabricator will by default hide diffs in generated files). Use the @generated tag in makesyscalls.sh as we've done for other generated files. =20 Reviewed by: cem MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20183 Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- head/sys/kern/makesyscalls.sh Tue May 7 15:03:26 2019 (r347227) +++ head/sys/kern/makesyscalls.sh Tue May 7 16:17:33 2019 (r347228) @@ -142,18 +142,21 @@ sed -e ' capenabled_string =3D \"$capenabled\" "' =20 + # Avoid a literal generated file tag here. + generated =3D "@" "generated"; + split(capenabled_string, capenabled, ","); =20 printf "\n/* The casts are bogus but will do for now. */\n" > sysent printf "struct sysent %s[] =3D {\n",switchname > sysent =20 printf "/*\n * System call switch table.\n *\n" > syssw - printf " * DO NOT EDIT-- this file is automatically generated.\n" > syss= w + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > = syssw printf " * $%s$\n", "FreeBSD" > syssw printf " */\n\n" > syssw =20 printf "/*\n * System call prototypes.\n *\n" > sysarg - printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysa= rg + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > = sysarg printf " * $%s$\n", "FreeBSD" > sysarg printf " */\n\n" > sysarg printf "#ifndef %s\n", sysproto_h > sysarg @@ -187,23 +190,23 @@ sed -e ' printf "\n#ifdef %s\n\n", compat11 > syscompat11 =20 printf "/*\n * System call names.\n *\n" > sysnames - printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysn= ames + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > = sysnames printf " * $%s$\n", "FreeBSD" > sysnames printf " */\n\n" > sysnames printf "const char *%s[] =3D {\n", namesname > sysnames =20 printf "/*\n * System call numbers.\n *\n" > syshdr - printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysh= dr + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > = syshdr printf " * $%s$\n", "FreeBSD" > syshdr printf " */\n\n" > syshdr =20 printf "# FreeBSD system call object files.\n" > sysmk - printf "# DO NOT EDIT-- this file is automatically generated.\n" > sysmk + printf "# DO NOT EDIT-- this file is automatically " generated ".\n" > s= ysmk printf "# $%s$\n", "FreeBSD" > sysmk printf "MIASM =3D " > sysmk =20 printf "/*\n * System call argument to DTrace register array converstion= .\n *\n" > systrace - printf " * DO NOT EDIT-- this file is automatically generated.\n" > syst= race + printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > = systrace printf " * $%s$\n", "FreeBSD" > systrace printf " * This file is part of the DTrace syscall provider.\n */\n\n" >= systrace printf "static void\nsystrace_args(int sysnum, void *params, uint64_t *u= arg, int *n_args)\n{\n" > systrace From owner-svn-src-all@freebsd.org Tue May 7 17:44:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0005158EBCC; Tue, 7 May 2019 17:44:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4571E6D1FB; Tue, 7 May 2019 17:44:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 7FE883DB491; Wed, 8 May 2019 03:44:01 +1000 (AEST) Date: Wed, 8 May 2019 03:44:00 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Bruce Evans , Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347063 - head/sys/kern In-Reply-To: Message-ID: <20190508025608.B1874@besplex.bde.org> References: <201905032126.x43LQilu092655@repo.freebsd.org> <335d828e-ac61-bc59-bac3-f80f27b951c7@FreeBSD.org> <20190506184502.GA35464@raichu> <52484f6b-fdae-565b-6c03-37a63d56ad30@FreeBSD.org> <20190508001838.B1127@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=ZeAthX8GMysWMYlmZyQA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 4571E6D1FB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.918,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 17:44:06 -0000 On Tue, 7 May 2019, John Baldwin wrote: > On 5/7/19 8:45 AM, Bruce Evans wrote: >> On Mon, 6 May 2019, John Baldwin wrote: >> >>> On 5/6/19 11:45 AM, Mark Johnston wrote: >>>> On Mon, May 06, 2019 at 11:07:18AM -0700, John Baldwin wrote: >>>>> On 5/3/19 2:26 PM, Mark Johnston wrote: >>>>>> Author: markj >>>>>> Date: Fri May 3 21:26:44 2019 >>>>>> New Revision: 347063 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/347063 >>>>>> >>>>>> Log: >>>>>> Disallow excessively small times of day in clock_settime(2). >> >> This actually disallows negative timespecs in clock_settime(), with >> collateral disallowment for small positive times. > > FWIW, clock_settime already disallows negative times due to the > existing check in the previous two lines: > > if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || > ats->tv_sec < 0) > return (EINVAL); > > I would probably lean towards not disallowing negative times as I > said in one of my earlier replies, but given we have that blanket > check already in place, the current patch doesn't seem to make > things much worse. This check was correctly missing in FreeBSD-5. This check doesn't actually work. I rememeber another detail in my test program. It sets the time to INT_MAX - 2 == INT32_MAX - 2 to get an overflow 2 seconds later with 32-bit time_t. This is how I got a file time of 1901. The check for large times on the line after the above is broken in another way. It has an upper limit of approx. 8000ULL years. This limit is unreachable for 32-bit time_t (except for the unsign extension bug for negative times which is unreachable due to the above check). So the check only works to prevent overflow to a negative time with 64-bit time_t. Other parts of the system are or were more careful about this: - setitimer() and alarm() used to have a limit of 10**8 seconds to prevent overflow of 32-bit time_t when adding this number to the current time. 10**8 seconds is 3.16 years, so this works up to about 2035. This was broken by silently removing the check for 10**8 in itimerfix() as part of implementing POSIX itimers but the man pages still document the limit. This is not allowed by POSIX. POSIX requires times to work up to the limit of a time_t. Some APIs return the residual time after a timeout, so this cannot be implemented by clamping the time to a reasonably small value. POSIX itimers have a different implementation that is closer to not needing this limit and more broken having it. setitimer() is also broken for negative times (doesn't allow them). IIRC, POSIX requires this bug. This just give more work for applications. Small negative differences can easily occur as the result of subtracting times. Applications must either check for them after calculating differences, or handle the error for them from setimer(). Usually the correct handling is to treat negative timeouts as 0. - sbintimes have 32 bits for the seconds part, so they have similar problems to 32-bit time_t. Some places handle these problems by limiting the timeouts to INT32_MAX / 2. The timeout is sometimes added to the current time, but since the current time is the monotonic time it is at most a few years so the limit for the timeout could be a bit larger than INT32_MAX / 2. Oops, sbintimes are now used for for setitimer(), and setitimer() is one of the few places with the INT32_MAX / 2 limit. This gives the following bugs for setitimer() and alarm(): - these syscalls still have a limit which is not allowed by POSIX - the limit is INT32_MAX / 2 seconds (+ maximal usec?), not the documented one. 64_bit time_t's mostly just increase the overflow bugs. Applications can probe for bugs using INT64_MAX in tv_sec. This overflows all 32-bit calculations and most signed 64-bit calculations. The kernel has to reduce to 32 bits in seconds for all uses of sbintimes. The kernel does do this for nanosleep(). Bruce From owner-svn-src-all@freebsd.org Tue May 7 17:47:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F1EB158ECA5; Tue, 7 May 2019 17:47:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2F706D3B4; Tue, 7 May 2019 17:47:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B76A821A9B; Tue, 7 May 2019 17:47:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47HlMI3012171; Tue, 7 May 2019 17:47:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47HlKTh012163; Tue, 7 May 2019 17:47:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905071747.x47HlKTh012163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 7 May 2019 17:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347229 - in head: lib/libsbuf lib/libsbuf/tests share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: lib/libsbuf lib/libsbuf/tests share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 347229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2F706D3B4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 17:47:23 -0000 Author: cem Date: Tue May 7 17:47:20 2019 New Revision: 347229 URL: https://svnweb.freebsd.org/changeset/base/347229 Log: device_printf: Use sbuf for more coherent prints on SMP device_printf does multiple calls to printf allowing other console messages to be inserted between the device name, and the rest of the message. This change uses sbuf to compose to two into a single buffer, and prints it all at once. It exposes an sbuf drain function (drain-to-printf) for common use. Update documentation to match; some unit tests included. Submitted by: jmg Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16690 Modified: head/lib/libsbuf/Symbol.map head/lib/libsbuf/tests/sbuf_core_test.c head/lib/libsbuf/tests/sbuf_stdio_test.c head/share/man/man9/Makefile head/share/man/man9/sbuf.9 head/sys/kern/kern_sysctl.c head/sys/kern/subr_bus.c head/sys/kern/subr_prf.c head/sys/sys/sbuf.h Modified: head/lib/libsbuf/Symbol.map ============================================================================== --- head/lib/libsbuf/Symbol.map Tue May 7 16:17:33 2019 (r347228) +++ head/lib/libsbuf/Symbol.map Tue May 7 17:47:20 2019 (r347229) @@ -37,5 +37,6 @@ FBSD_1.4 { FBSD_1.5 { sbuf_putbuf; + sbuf_printf_drain; }; Modified: head/lib/libsbuf/tests/sbuf_core_test.c ============================================================================== --- head/lib/libsbuf/tests/sbuf_core_test.c Tue May 7 16:17:33 2019 (r347228) +++ head/lib/libsbuf/tests/sbuf_core_test.c Tue May 7 17:47:20 2019 (r347229) @@ -63,6 +63,9 @@ ATF_TC_BODY(sbuf_clear_test, tc) */ child_proc = atf_utils_fork(); if (child_proc == 0) { + ATF_REQUIRE_EQ_MSG(0, sbuf_finish(sb), "sbuf_finish failed: %s", + strerror(errno)); + sbuf_putbuf(sb); exit(0); } @@ -100,6 +103,34 @@ ATF_TC_BODY(sbuf_done_and_sbuf_finish_test, tc) sbuf_delete(sb); } +static int +drain_ret0(void *arg, const char *data, int len) +{ + + (void)arg; + (void)data; + (void)len; + + return (0); +} + +ATF_TC_WITHOUT_HEAD(sbuf_drain_ret0_test); +ATF_TC_BODY(sbuf_drain_ret0_test, tc) +{ + struct sbuf *sb; + + sb = sbuf_new_auto(); + + sbuf_set_drain(sb, drain_ret0, NULL); + + sbuf_cat(sb, test_string); + + ATF_CHECK_EQ_MSG(-1, sbuf_finish(sb), + "required to return error when drain func returns 0"); + ATF_CHECK_EQ_MSG(EDEADLK, errno, + "errno required to be EDEADLK when drain func returns 0"); +} + ATF_TC_WITHOUT_HEAD(sbuf_len_test); ATF_TC_BODY(sbuf_len_test, tc) { @@ -131,6 +162,34 @@ ATF_TC_BODY(sbuf_len_test, tc) sbuf_delete(sb); } +ATF_TC_WITHOUT_HEAD(sbuf_new_fixedlen); +ATF_TC_BODY(sbuf_new_fixedlen, tc) +{ + char buf[strlen(test_string) + 1]; + struct sbuf sb; + pid_t child_proc; + + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); + + sbuf_cat(&sb, test_string); + + child_proc = atf_utils_fork(); + if (child_proc == 0) { + ATF_REQUIRE_EQ_MSG(0, sbuf_finish(&sb), "sbuf_finish failed: %s", + strerror(errno)); + + sbuf_putbuf(&sb); + exit(0); + } + atf_utils_wait(child_proc, 0, test_string, ""); + + sbuf_putc(&sb, ' '); + + ATF_CHECK_EQ_MSG(-1, sbuf_finish(&sb), "failed to return error on overflow"); + + sbuf_delete(&sb); +} + ATF_TC_WITHOUT_HEAD(sbuf_setpos_test); ATF_TC_BODY(sbuf_setpos_test, tc) { @@ -190,7 +249,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, sbuf_clear_test); ATF_TP_ADD_TC(tp, sbuf_done_and_sbuf_finish_test); + ATF_TP_ADD_TC(tp, sbuf_drain_ret0_test); ATF_TP_ADD_TC(tp, sbuf_len_test); + ATF_TP_ADD_TC(tp, sbuf_new_fixedlen); #if 0 /* TODO */ #ifdef HAVE_SBUF_CLEAR_FLAGS Modified: head/lib/libsbuf/tests/sbuf_stdio_test.c ============================================================================== --- head/lib/libsbuf/tests/sbuf_stdio_test.c Tue May 7 16:17:33 2019 (r347228) +++ head/lib/libsbuf/tests/sbuf_stdio_test.c Tue May 7 17:47:20 2019 (r347229) @@ -59,6 +59,60 @@ sbuf_vprintf_helper(struct sbuf *sb, const char * rest return (rc); } +ATF_TC_WITHOUT_HEAD(sbuf_printf_drain_null_test); +ATF_TC_BODY(sbuf_printf_drain_null_test, tc) +{ + struct sbuf *sb; + char buf[2]; + pid_t child_proc; + + sb = sbuf_new(NULL, buf, sizeof(buf), SBUF_FIXEDLEN); + ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", + strerror(errno)); + + child_proc = atf_utils_fork(); + if (child_proc == 0) { + sbuf_set_drain(sb, sbuf_printf_drain, NULL); + + ATF_REQUIRE_EQ_MSG(0, sbuf_cat(sb, test_string), + "sbuf_cat failed"); + + ATF_CHECK_EQ(0, sbuf_finish(sb)); + exit(0); + } + atf_utils_wait(child_proc, 0, test_string, ""); + + sbuf_delete(sb); +} + +ATF_TC_WITHOUT_HEAD(sbuf_printf_drain_test); +ATF_TC_BODY(sbuf_printf_drain_test, tc) +{ + struct sbuf *sb; + char buf[2]; + pid_t child_proc; + size_t cnt = 0; + + sb = sbuf_new(NULL, buf, sizeof(buf), SBUF_FIXEDLEN); + ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", + strerror(errno)); + + child_proc = atf_utils_fork(); + if (child_proc == 0) { + sbuf_set_drain(sb, sbuf_printf_drain, &cnt); + + ATF_REQUIRE_EQ_MSG(0, sbuf_cat(sb, test_string), + "sbuf_cat failed"); + + ATF_CHECK_EQ(0, sbuf_finish(sb)); + ATF_CHECK_EQ(strlen(test_string), cnt); + exit(0); + } + atf_utils_wait(child_proc, 0, test_string, ""); + + sbuf_delete(sb); +} + ATF_TC_WITHOUT_HEAD(sbuf_printf_test); ATF_TC_BODY(sbuf_printf_test, tc) { @@ -106,6 +160,7 @@ ATF_TC_BODY(sbuf_putbuf_test, tc) child_proc = atf_utils_fork(); if (child_proc == 0) { + ATF_CHECK_EQ(0, sbuf_finish(sb)); sbuf_putbuf(sb); exit(0); } @@ -152,6 +207,8 @@ ATF_TC_BODY(sbuf_vprintf_test, tc) ATF_TP_ADD_TCS(tp) { + ATF_TP_ADD_TC(tp, sbuf_printf_drain_null_test); + ATF_TP_ADD_TC(tp, sbuf_printf_drain_test); ATF_TP_ADD_TC(tp, sbuf_printf_test); ATF_TP_ADD_TC(tp, sbuf_putbuf_test); ATF_TP_ADD_TC(tp, sbuf_vprintf_test); Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue May 7 16:17:33 2019 (r347228) +++ head/share/man/man9/Makefile Tue May 7 17:47:20 2019 (r347229) @@ -1780,6 +1780,8 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_new_auto.9 \ sbuf.9 sbuf_new_for_sysctl.9 \ sbuf.9 sbuf_printf.9 \ + sbuf.9 sbuf_printf_drain.9 \ + sbuf.9 sbuf_putbuf.9 \ sbuf.9 sbuf_putc.9 \ sbuf.9 sbuf_set_drain.9 \ sbuf.9 sbuf_set_flags.9 \ Modified: head/share/man/man9/sbuf.9 ============================================================================== --- head/share/man/man9/sbuf.9 Tue May 7 16:17:33 2019 (r347228) +++ head/share/man/man9/sbuf.9 Tue May 7 17:47:20 2019 (r347229) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2018 +.Dd May 7, 2019 .Dt SBUF 9 .Os .Sh NAME @@ -58,6 +58,7 @@ .Nm sbuf_start_section , .Nm sbuf_end_section , .Nm sbuf_hexdump , +.Nm sbuf_printf_drain , .Nm sbuf_putbuf .Nd safe string composition .Sh SYNOPSIS @@ -191,6 +192,12 @@ .Fa "const char *hdr" .Fa "int flags" .Fc +.Ft int +.Fo sbuf_printf_drain +.Fa "void *arg" +.Fa "const char *data" +.Fa "int len" +.Fc .Ft void .Fo sbuf_putbuf .Fa "struct sbuf *s" @@ -278,7 +285,9 @@ as a record boundary marker that will be used during d records being split. If a record grows sufficiently large such that it fills the .Fa sbuf -and therefore cannot be drained without being split, an error of EDEADLK is set. +and therefore cannot be drained without being split, an error of +.Er EDEADLK +is set. .El .Pp Note that if @@ -419,7 +428,9 @@ many bytes were drained. If negative, the return value indicates the negative error code which will be returned from this or a later call to .Fn sbuf_finish . -The returned drained length cannot be zero. +If the returned drained length is 0, an error of +.Er EDEADLK +is set. To do unbuffered draining, initialize the sbuf with a two-byte buffer. The drain will be called for every byte added to the sbuf. The @@ -492,7 +503,9 @@ The .Fn sbuf_error function returns any error value that the .Fa sbuf -may have accumulated, either from the drain function, or ENOMEM if the +may have accumulated, either from the drain function, or +.Er ENOMEM +if the .Fa sbuf overflowed. This function is generally not needed and instead the error code from @@ -574,9 +587,29 @@ See the man page for more details on the interface. .Pp The +.Fn sbuf_printf_drain +function is a drain function that will call printf, or log to the console. +The argument +.Fa arg +must be either +.Dv NULL , +or a valid pointer to a +.Vt size_t . +If +.Fa arg +is not +.Dv NULL , +the total bytes drained will be added to the value pointed to by +.Fa arg . +.Pp +The .Fn sbuf_putbuf function printfs the sbuf to stdout if in userland, and to the console and log if in the kernel. +The +.Fa sbuf +must be finished before calling +.Fn sbuf_putbuf . It does not drain the buffer or update any pointers. .Sh NOTES If an operation caused an @@ -655,8 +688,9 @@ function returns the section length or \-1 if the buff .Pp The .Fn sbuf_finish 9 -function (the kernel version) returns ENOMEM if the sbuf overflowed before -being finished, +function (the kernel version) returns +.Er ENOMEM +if the sbuf overflowed before being finished, or returns the error code from the drain if one is attached. .Pp The Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Tue May 7 16:17:33 2019 (r347228) +++ head/sys/kern/kern_sysctl.c Tue May 7 17:47:20 2019 (r347229) @@ -322,13 +322,6 @@ sysctl_load_tunable_by_oid_locked(struct sysctl_oid *o freeenv(penv); } -static int -sbuf_printf_drain(void *arg __unused, const char *data, int len) -{ - - return (printf("%.*s", len, data)); -} - /* * Locate the path to a given oid. Returns the length of the resulting path, * or -1 if the oid was not found. nodes must have room for CTL_MAXNAME Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue May 7 16:17:33 2019 (r347228) +++ head/sys/kern/subr_bus.c Tue May 7 17:47:20 2019 (r347229) @@ -2431,13 +2431,31 @@ device_print_prettyname(device_t dev) int device_printf(device_t dev, const char * fmt, ...) { + char buf[128]; + struct sbuf sb; + const char *name; va_list ap; - int retval; + size_t retval; - retval = device_print_prettyname(dev); + retval = 0; + + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); + sbuf_set_drain(&sb, sbuf_printf_drain, &retval); + + name = device_get_name(dev); + + if (name == NULL) + sbuf_cat(&sb, "unknown: "); + else + sbuf_printf(&sb, "%s%d: ", name, device_get_unit(dev)); + va_start(ap, fmt); - retval += vprintf(fmt, ap); + sbuf_vprintf(&sb, fmt, ap); va_end(ap); + + sbuf_finish(&sb); + sbuf_delete(&sb); + return (retval); } Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Tue May 7 16:17:33 2019 (r347228) +++ head/sys/kern/subr_prf.c Tue May 7 17:47:20 2019 (r347229) @@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#else /* !_KERNEL */ +#include #endif #include #include @@ -1254,3 +1256,42 @@ sbuf_putbuf(struct sbuf *sb) printf("%s", sbuf_data(sb)); } #endif + +int +sbuf_printf_drain(void *arg, const char *data, int len) +{ + size_t *retvalptr; + int r; +#ifdef _KERNEL + char *dataptr; + char oldchr; + + /* + * This is allowed as an extra byte is always resvered for + * terminating NUL byte. Save and restore the byte because + * we might be flushing a record, and there may be valid + * data after the buffer. + */ + oldchr = data[len]; + dataptr = __DECONST(char *, data); + dataptr[len] = '\0'; + + prf_putbuf(dataptr, TOLOG | TOCONS, -1); + r = len; + + dataptr[len] = oldchr; + +#else /* !_KERNEL */ + + r = printf("%.*s", len, data); + if (r < 0) + return (-errno); + +#endif + + retvalptr = arg; + if (retvalptr != NULL) + *retvalptr += r; + + return (r); +} Modified: head/sys/sys/sbuf.h ============================================================================== --- head/sys/sys/sbuf.h Tue May 7 16:17:33 2019 (r347228) +++ head/sys/sys/sbuf.h Tue May 7 17:47:20 2019 (r347229) @@ -103,6 +103,7 @@ void sbuf_start_section(struct sbuf *, ssize_t *); ssize_t sbuf_end_section(struct sbuf *, ssize_t, size_t, int); void sbuf_hexdump(struct sbuf *, const void *, int, const char *, int); +int sbuf_printf_drain(void *arg, const char *data, int len); void sbuf_putbuf(struct sbuf *); #ifdef _KERNEL From owner-svn-src-all@freebsd.org Tue May 7 17:52:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2473158EF59; Tue, 7 May 2019 17:52:23 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02E096D824; Tue, 7 May 2019 17:52:22 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x47HqKYw012717; Tue, 7 May 2019 10:52:20 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x47HqK9n012716; Tue, 7 May 2019 10:52:20 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905071752.x47HqK9n012716@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347229 - in head: lib/libsbuf lib/libsbuf/tests share/man/man9 sys/kern sys/sys In-Reply-To: <201905071747.x47HlKTh012163@repo.freebsd.org> To: Conrad Meyer Date: Tue, 7 May 2019 10:52:20 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 02E096D824 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 17:52:24 -0000 > Author: cem > Date: Tue May 7 17:47:20 2019 > New Revision: 347229 > URL: https://svnweb.freebsd.org/changeset/base/347229 > > Log: > device_printf: Use sbuf for more coherent prints on SMP > > device_printf does multiple calls to printf allowing other console messages to > be inserted between the device name, and the rest of the message. This change > uses sbuf to compose to two into a single buffer, and prints it all at once. > > It exposes an sbuf drain function (drain-to-printf) for common use. > > Update documentation to match; some unit tests included. > > Submitted by: jmg > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D16690 Thank you! this has been annoying me for a while, I knew it was going on, but wasnt sure where it was coming from. Does this code MFC back to 12 and 11 easily? > Modified: > head/lib/libsbuf/Symbol.map > head/lib/libsbuf/tests/sbuf_core_test.c > head/lib/libsbuf/tests/sbuf_stdio_test.c > head/share/man/man9/Makefile > head/share/man/man9/sbuf.9 > head/sys/kern/kern_sysctl.c > head/sys/kern/subr_bus.c > head/sys/kern/subr_prf.c > head/sys/sys/sbuf.h > > Modified: head/lib/libsbuf/Symbol.map > ============================================================================== > --- head/lib/libsbuf/Symbol.map Tue May 7 16:17:33 2019 (r347228) > +++ head/lib/libsbuf/Symbol.map Tue May 7 17:47:20 2019 (r347229) > @@ -37,5 +37,6 @@ FBSD_1.4 { > > FBSD_1.5 { > sbuf_putbuf; > + sbuf_printf_drain; > }; > > > Modified: head/lib/libsbuf/tests/sbuf_core_test.c > ============================================================================== > --- head/lib/libsbuf/tests/sbuf_core_test.c Tue May 7 16:17:33 2019 (r347228) > +++ head/lib/libsbuf/tests/sbuf_core_test.c Tue May 7 17:47:20 2019 (r347229) > @@ -63,6 +63,9 @@ ATF_TC_BODY(sbuf_clear_test, tc) > */ > child_proc = atf_utils_fork(); > if (child_proc == 0) { > + ATF_REQUIRE_EQ_MSG(0, sbuf_finish(sb), "sbuf_finish failed: %s", > + strerror(errno)); > + > sbuf_putbuf(sb); > exit(0); > } > @@ -100,6 +103,34 @@ ATF_TC_BODY(sbuf_done_and_sbuf_finish_test, tc) > sbuf_delete(sb); > } > > +static int > +drain_ret0(void *arg, const char *data, int len) > +{ > + > + (void)arg; > + (void)data; > + (void)len; > + > + return (0); > +} > + > +ATF_TC_WITHOUT_HEAD(sbuf_drain_ret0_test); > +ATF_TC_BODY(sbuf_drain_ret0_test, tc) > +{ > + struct sbuf *sb; > + > + sb = sbuf_new_auto(); > + > + sbuf_set_drain(sb, drain_ret0, NULL); > + > + sbuf_cat(sb, test_string); > + > + ATF_CHECK_EQ_MSG(-1, sbuf_finish(sb), > + "required to return error when drain func returns 0"); > + ATF_CHECK_EQ_MSG(EDEADLK, errno, > + "errno required to be EDEADLK when drain func returns 0"); > +} > + > ATF_TC_WITHOUT_HEAD(sbuf_len_test); > ATF_TC_BODY(sbuf_len_test, tc) > { > @@ -131,6 +162,34 @@ ATF_TC_BODY(sbuf_len_test, tc) > sbuf_delete(sb); > } > > +ATF_TC_WITHOUT_HEAD(sbuf_new_fixedlen); > +ATF_TC_BODY(sbuf_new_fixedlen, tc) > +{ > + char buf[strlen(test_string) + 1]; > + struct sbuf sb; > + pid_t child_proc; > + > + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); > + > + sbuf_cat(&sb, test_string); > + > + child_proc = atf_utils_fork(); > + if (child_proc == 0) { > + ATF_REQUIRE_EQ_MSG(0, sbuf_finish(&sb), "sbuf_finish failed: %s", > + strerror(errno)); > + > + sbuf_putbuf(&sb); > + exit(0); > + } > + atf_utils_wait(child_proc, 0, test_string, ""); > + > + sbuf_putc(&sb, ' '); > + > + ATF_CHECK_EQ_MSG(-1, sbuf_finish(&sb), "failed to return error on overflow"); > + > + sbuf_delete(&sb); > +} > + > ATF_TC_WITHOUT_HEAD(sbuf_setpos_test); > ATF_TC_BODY(sbuf_setpos_test, tc) > { > @@ -190,7 +249,9 @@ ATF_TP_ADD_TCS(tp) > > ATF_TP_ADD_TC(tp, sbuf_clear_test); > ATF_TP_ADD_TC(tp, sbuf_done_and_sbuf_finish_test); > + ATF_TP_ADD_TC(tp, sbuf_drain_ret0_test); > ATF_TP_ADD_TC(tp, sbuf_len_test); > + ATF_TP_ADD_TC(tp, sbuf_new_fixedlen); > #if 0 > /* TODO */ > #ifdef HAVE_SBUF_CLEAR_FLAGS > > Modified: head/lib/libsbuf/tests/sbuf_stdio_test.c > ============================================================================== > --- head/lib/libsbuf/tests/sbuf_stdio_test.c Tue May 7 16:17:33 2019 (r347228) > +++ head/lib/libsbuf/tests/sbuf_stdio_test.c Tue May 7 17:47:20 2019 (r347229) > @@ -59,6 +59,60 @@ sbuf_vprintf_helper(struct sbuf *sb, const char * rest > return (rc); > } > > +ATF_TC_WITHOUT_HEAD(sbuf_printf_drain_null_test); > +ATF_TC_BODY(sbuf_printf_drain_null_test, tc) > +{ > + struct sbuf *sb; > + char buf[2]; > + pid_t child_proc; > + > + sb = sbuf_new(NULL, buf, sizeof(buf), SBUF_FIXEDLEN); > + ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", > + strerror(errno)); > + > + child_proc = atf_utils_fork(); > + if (child_proc == 0) { > + sbuf_set_drain(sb, sbuf_printf_drain, NULL); > + > + ATF_REQUIRE_EQ_MSG(0, sbuf_cat(sb, test_string), > + "sbuf_cat failed"); > + > + ATF_CHECK_EQ(0, sbuf_finish(sb)); > + exit(0); > + } > + atf_utils_wait(child_proc, 0, test_string, ""); > + > + sbuf_delete(sb); > +} > + > +ATF_TC_WITHOUT_HEAD(sbuf_printf_drain_test); > +ATF_TC_BODY(sbuf_printf_drain_test, tc) > +{ > + struct sbuf *sb; > + char buf[2]; > + pid_t child_proc; > + size_t cnt = 0; > + > + sb = sbuf_new(NULL, buf, sizeof(buf), SBUF_FIXEDLEN); > + ATF_REQUIRE_MSG(sb != NULL, "sbuf_new_auto failed: %s", > + strerror(errno)); > + > + child_proc = atf_utils_fork(); > + if (child_proc == 0) { > + sbuf_set_drain(sb, sbuf_printf_drain, &cnt); > + > + ATF_REQUIRE_EQ_MSG(0, sbuf_cat(sb, test_string), > + "sbuf_cat failed"); > + > + ATF_CHECK_EQ(0, sbuf_finish(sb)); > + ATF_CHECK_EQ(strlen(test_string), cnt); > + exit(0); > + } > + atf_utils_wait(child_proc, 0, test_string, ""); > + > + sbuf_delete(sb); > +} > + > ATF_TC_WITHOUT_HEAD(sbuf_printf_test); > ATF_TC_BODY(sbuf_printf_test, tc) > { > @@ -106,6 +160,7 @@ ATF_TC_BODY(sbuf_putbuf_test, tc) > > child_proc = atf_utils_fork(); > if (child_proc == 0) { > + ATF_CHECK_EQ(0, sbuf_finish(sb)); > sbuf_putbuf(sb); > exit(0); > } > @@ -152,6 +207,8 @@ ATF_TC_BODY(sbuf_vprintf_test, tc) > ATF_TP_ADD_TCS(tp) > { > > + ATF_TP_ADD_TC(tp, sbuf_printf_drain_null_test); > + ATF_TP_ADD_TC(tp, sbuf_printf_drain_test); > ATF_TP_ADD_TC(tp, sbuf_printf_test); > ATF_TP_ADD_TC(tp, sbuf_putbuf_test); > ATF_TP_ADD_TC(tp, sbuf_vprintf_test); > > Modified: head/share/man/man9/Makefile > ============================================================================== > --- head/share/man/man9/Makefile Tue May 7 16:17:33 2019 (r347228) > +++ head/share/man/man9/Makefile Tue May 7 17:47:20 2019 (r347229) > @@ -1780,6 +1780,8 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ > sbuf.9 sbuf_new_auto.9 \ > sbuf.9 sbuf_new_for_sysctl.9 \ > sbuf.9 sbuf_printf.9 \ > + sbuf.9 sbuf_printf_drain.9 \ > + sbuf.9 sbuf_putbuf.9 \ > sbuf.9 sbuf_putc.9 \ > sbuf.9 sbuf_set_drain.9 \ > sbuf.9 sbuf_set_flags.9 \ > > Modified: head/share/man/man9/sbuf.9 > ============================================================================== > --- head/share/man/man9/sbuf.9 Tue May 7 16:17:33 2019 (r347228) > +++ head/share/man/man9/sbuf.9 Tue May 7 17:47:20 2019 (r347229) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd May 23, 2018 > +.Dd May 7, 2019 > .Dt SBUF 9 > .Os > .Sh NAME > @@ -58,6 +58,7 @@ > .Nm sbuf_start_section , > .Nm sbuf_end_section , > .Nm sbuf_hexdump , > +.Nm sbuf_printf_drain , > .Nm sbuf_putbuf > .Nd safe string composition > .Sh SYNOPSIS > @@ -191,6 +192,12 @@ > .Fa "const char *hdr" > .Fa "int flags" > .Fc > +.Ft int > +.Fo sbuf_printf_drain > +.Fa "void *arg" > +.Fa "const char *data" > +.Fa "int len" > +.Fc > .Ft void > .Fo sbuf_putbuf > .Fa "struct sbuf *s" > @@ -278,7 +285,9 @@ as a record boundary marker that will be used during d > records being split. > If a record grows sufficiently large such that it fills the > .Fa sbuf > -and therefore cannot be drained without being split, an error of EDEADLK is set. > +and therefore cannot be drained without being split, an error of > +.Er EDEADLK > +is set. > .El > .Pp > Note that if > @@ -419,7 +428,9 @@ many bytes were drained. > If negative, the return value indicates the negative error code which > will be returned from this or a later call to > .Fn sbuf_finish . > -The returned drained length cannot be zero. > +If the returned drained length is 0, an error of > +.Er EDEADLK > +is set. > To do unbuffered draining, initialize the sbuf with a two-byte buffer. > The drain will be called for every byte added to the sbuf. > The > @@ -492,7 +503,9 @@ The > .Fn sbuf_error > function returns any error value that the > .Fa sbuf > -may have accumulated, either from the drain function, or ENOMEM if the > +may have accumulated, either from the drain function, or > +.Er ENOMEM > +if the > .Fa sbuf > overflowed. > This function is generally not needed and instead the error code from > @@ -574,9 +587,29 @@ See the > man page for more details on the interface. > .Pp > The > +.Fn sbuf_printf_drain > +function is a drain function that will call printf, or log to the console. > +The argument > +.Fa arg > +must be either > +.Dv NULL , > +or a valid pointer to a > +.Vt size_t . > +If > +.Fa arg > +is not > +.Dv NULL , > +the total bytes drained will be added to the value pointed to by > +.Fa arg . > +.Pp > +The > .Fn sbuf_putbuf > function printfs the sbuf to stdout if in userland, and to the console > and log if in the kernel. > +The > +.Fa sbuf > +must be finished before calling > +.Fn sbuf_putbuf . > It does not drain the buffer or update any pointers. > .Sh NOTES > If an operation caused an > @@ -655,8 +688,9 @@ function returns the section length or \-1 if the buff > .Pp > The > .Fn sbuf_finish 9 > -function (the kernel version) returns ENOMEM if the sbuf overflowed before > -being finished, > +function (the kernel version) returns > +.Er ENOMEM > +if the sbuf overflowed before being finished, > or returns the error code from the drain if one is attached. > .Pp > The > > Modified: head/sys/kern/kern_sysctl.c > ============================================================================== > --- head/sys/kern/kern_sysctl.c Tue May 7 16:17:33 2019 (r347228) > +++ head/sys/kern/kern_sysctl.c Tue May 7 17:47:20 2019 (r347229) > @@ -322,13 +322,6 @@ sysctl_load_tunable_by_oid_locked(struct sysctl_oid *o > freeenv(penv); > } > > -static int > -sbuf_printf_drain(void *arg __unused, const char *data, int len) > -{ > - > - return (printf("%.*s", len, data)); > -} > - > /* > * Locate the path to a given oid. Returns the length of the resulting path, > * or -1 if the oid was not found. nodes must have room for CTL_MAXNAME > > Modified: head/sys/kern/subr_bus.c > ============================================================================== > --- head/sys/kern/subr_bus.c Tue May 7 16:17:33 2019 (r347228) > +++ head/sys/kern/subr_bus.c Tue May 7 17:47:20 2019 (r347229) > @@ -2431,13 +2431,31 @@ device_print_prettyname(device_t dev) > int > device_printf(device_t dev, const char * fmt, ...) > { > + char buf[128]; > + struct sbuf sb; > + const char *name; > va_list ap; > - int retval; > + size_t retval; > > - retval = device_print_prettyname(dev); > + retval = 0; > + > + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); > + sbuf_set_drain(&sb, sbuf_printf_drain, &retval); > + > + name = device_get_name(dev); > + > + if (name == NULL) > + sbuf_cat(&sb, "unknown: "); > + else > + sbuf_printf(&sb, "%s%d: ", name, device_get_unit(dev)); > + > va_start(ap, fmt); > - retval += vprintf(fmt, ap); > + sbuf_vprintf(&sb, fmt, ap); > va_end(ap); > + > + sbuf_finish(&sb); > + sbuf_delete(&sb); > + > return (retval); > } > > > Modified: head/sys/kern/subr_prf.c > ============================================================================== > --- head/sys/kern/subr_prf.c Tue May 7 16:17:33 2019 (r347228) > +++ head/sys/kern/subr_prf.c Tue May 7 17:47:20 2019 (r347229) > @@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#else /* !_KERNEL */ > +#include > #endif > #include > #include > @@ -1254,3 +1256,42 @@ sbuf_putbuf(struct sbuf *sb) > printf("%s", sbuf_data(sb)); > } > #endif > + > +int > +sbuf_printf_drain(void *arg, const char *data, int len) > +{ > + size_t *retvalptr; > + int r; > +#ifdef _KERNEL > + char *dataptr; > + char oldchr; > + > + /* > + * This is allowed as an extra byte is always resvered for > + * terminating NUL byte. Save and restore the byte because > + * we might be flushing a record, and there may be valid > + * data after the buffer. > + */ > + oldchr = data[len]; > + dataptr = __DECONST(char *, data); > + dataptr[len] = '\0'; > + > + prf_putbuf(dataptr, TOLOG | TOCONS, -1); > + r = len; > + > + dataptr[len] = oldchr; > + > +#else /* !_KERNEL */ > + > + r = printf("%.*s", len, data); > + if (r < 0) > + return (-errno); > + > +#endif > + > + retvalptr = arg; > + if (retvalptr != NULL) > + *retvalptr += r; > + > + return (r); > +} > > Modified: head/sys/sys/sbuf.h > ============================================================================== > --- head/sys/sys/sbuf.h Tue May 7 16:17:33 2019 (r347228) > +++ head/sys/sys/sbuf.h Tue May 7 17:47:20 2019 (r347229) > @@ -103,6 +103,7 @@ void sbuf_start_section(struct sbuf *, ssize_t *); > ssize_t sbuf_end_section(struct sbuf *, ssize_t, size_t, int); > void sbuf_hexdump(struct sbuf *, const void *, int, const char *, > int); > +int sbuf_printf_drain(void *arg, const char *data, int len); > void sbuf_putbuf(struct sbuf *); > > #ifdef _KERNEL > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 7 18:10:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EAAB158F4C0; Tue, 7 May 2019 18:10:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBF496E2BC; Tue, 7 May 2019 18:10:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F74B21E25; Tue, 7 May 2019 18:10:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47IASw3023105; Tue, 7 May 2019 18:10:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47IAMsh023074; Tue, 7 May 2019 18:10:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905071810.x47IAMsh023074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 7 May 2019 18:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347230 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/freebsd32 i386/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/freebsd32 i386/linux kern sys X-SVN-Commit-Revision: 347230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CBF496E2BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 18:10:29 -0000 Author: emaste Date: Tue May 7 18:10:21 2019 New Revision: 347230 URL: https://svnweb.freebsd.org/changeset/base/347230 Log: make sysent after r347228 Regenerate to add @generated tag in generated files. Modified: head/sys/amd64/linux/linux_proto.h head/sys/amd64/linux/linux_syscall.h head/sys/amd64/linux/linux_syscalls.c head/sys/amd64/linux/linux_sysent.c head/sys/amd64/linux/linux_systrace_args.c head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/arm64/linux/linux_proto.h head/sys/arm64/linux/linux_syscall.h head/sys/arm64/linux/linux_syscalls.c head/sys/arm64/linux/linux_sysent.c head/sys/arm64/linux/linux_systrace_args.c head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_syscalls.c head/sys/i386/linux/linux_sysent.c head/sys/i386/linux/linux_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/amd64/linux/linux_proto.h ============================================================================== --- head/sys/amd64/linux/linux_proto.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/amd64/linux/linux_proto.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call prototypes. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/amd64/linux/linux_syscall.h ============================================================================== --- head/sys/amd64/linux/linux_syscall.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/amd64/linux/linux_syscall.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/amd64/linux/linux_syscalls.c ============================================================================== --- head/sys/amd64/linux/linux_syscalls.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/amd64/linux/linux_syscalls.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call names. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/amd64/linux/linux_sysent.c ============================================================================== --- head/sys/amd64/linux/linux_sysent.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/amd64/linux/linux_sysent.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- head/sys/amd64/linux/linux_systrace_args.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/amd64/linux/linux_systrace_args.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call argument to DTrace register array converstion. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/amd64/linux32/linux32_proto.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call prototypes. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/amd64/linux32/linux32_syscall.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/amd64/linux32/linux32_syscalls.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call names. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/amd64/linux32/linux32_sysent.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/amd64/linux32/linux32_systrace_args.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call argument to DTrace register array converstion. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ Modified: head/sys/arm64/linux/linux_proto.h ============================================================================== --- head/sys/arm64/linux/linux_proto.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/arm64/linux/linux_proto.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call prototypes. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/arm64/linux/linux_syscall.h ============================================================================== --- head/sys/arm64/linux/linux_syscall.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/arm64/linux/linux_syscall.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/arm64/linux/linux_syscalls.c ============================================================================== --- head/sys/arm64/linux/linux_syscalls.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/arm64/linux/linux_syscalls.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call names. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/arm64/linux/linux_sysent.c ============================================================================== --- head/sys/arm64/linux/linux_sysent.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/arm64/linux/linux_sysent.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/arm64/linux/linux_systrace_args.c ============================================================================== --- head/sys/arm64/linux/linux_systrace_args.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/arm64/linux/linux_systrace_args.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call argument to DTrace register array converstion. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/compat/freebsd32/freebsd32_proto.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call prototypes. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call names. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call argument to DTrace register array converstion. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/i386/linux/linux_proto.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call prototypes. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/i386/linux/linux_syscall.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/i386/linux/linux_syscalls.c ============================================================================== --- head/sys/i386/linux/linux_syscalls.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/i386/linux/linux_syscalls.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call names. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/i386/linux/linux_sysent.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/i386/linux/linux_systrace_args.c ============================================================================== --- head/sys/i386/linux/linux_systrace_args.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/i386/linux/linux_systrace_args.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call argument to DTrace register array converstion. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/kern/init_sysent.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/kern/syscalls.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call names. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Tue May 7 17:47:20 2019 (r347229) +++ head/sys/kern/systrace_args.c Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call argument to DTrace register array converstion. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ * This file is part of the DTrace syscall provider. */ Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/sys/syscall.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Tue May 7 17:47:20 2019 (r347229) +++ head/sys/sys/syscall.mk Tue May 7 18:10:21 2019 (r347230) @@ -1,5 +1,5 @@ # FreeBSD system call object files. -# DO NOT EDIT-- this file is automatically generated. +# DO NOT EDIT-- this file is automatically @generated. # $FreeBSD$ MIASM = \ syscall.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Tue May 7 17:47:20 2019 (r347229) +++ head/sys/sys/sysproto.h Tue May 7 18:10:21 2019 (r347230) @@ -1,7 +1,7 @@ /* * System call prototypes. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ */ From owner-svn-src-all@freebsd.org Tue May 7 18:12:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F13F9158F6D9; Tue, 7 May 2019 18:12:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f176.google.com (mail-it1-f176.google.com [209.85.166.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 880BE6E70B; Tue, 7 May 2019 18:12:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f176.google.com with SMTP id l7so931632ite.2; Tue, 07 May 2019 11:12:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=qS+nGxJLFiEVXcx9jRzH2RrCqy1jt3YHLgYO5pdVSvM=; b=nDnIC0jWbzDnqlqdzUcTXaiK2wnb0CqPXfS3YPJMzzUTY/kNtsIAIzA+rlFNXQn7Ci nHQLKuN9+lIFuIYADcug09iLCX/+4ucuUyYa60JBqcwj0Mc0wqp8XHQ6pPpeDA6n+s9i gsRtybU8QSJddGXLwpR+Uvz8N889r48UadVZR9AtAWpMI3TIcMD04ssCI1rUtARNSVrR 5tm9E6ZQqRR2XeayZ/x0NGAR4ENrqYJ0JTRm7Kj6pR1SC5vNMJ445OORdhXcacaFP+IH E1RwII6gSXfdVu5VYU2SQAXYlq6taKxvWlFZJwejsKAgRU7lG327iNNFZfusByqKb9+l sqjA== X-Gm-Message-State: APjAAAVmlcbvHVPV6Y53jrzrPQdL99Kx5+JZooWlEQYSULI1hygsTCcZ dCAJSdFSQqvxLKW5zW/wS8zoYp1V X-Google-Smtp-Source: APXvYqxhYuk4MecfzasERV3Jxp/fwezldFvb7y9jx+v8xzNv2qOjTCKCW0ovo9UTUkdMXXr8h9Si8A== X-Received: by 2002:a02:1dc7:: with SMTP id 190mr22914953jaj.62.1557252750898; Tue, 07 May 2019 11:12:30 -0700 (PDT) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com. [209.85.166.45]) by smtp.gmail.com with ESMTPSA id 70sm3678437itz.42.2019.05.07.11.12.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 11:12:30 -0700 (PDT) Received: by mail-io1-f45.google.com with SMTP id v7so8620772iob.10; Tue, 07 May 2019 11:12:30 -0700 (PDT) X-Received: by 2002:a05:6602:218f:: with SMTP id b15mr2309330iob.233.1557252750398; Tue, 07 May 2019 11:12:30 -0700 (PDT) MIME-Version: 1.0 References: <201905071747.x47HlKTh012163@repo.freebsd.org> In-Reply-To: <201905071747.x47HlKTh012163@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 7 May 2019 11:12:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347229 - in head: lib/libsbuf lib/libsbuf/tests share/man/man9 sys/kern sys/sys To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 880BE6E70B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 18:12:38 -0000 One correction On Tue, May 7, 2019 at 10:47 AM Conrad Meyer wrote: > Author: cem > Date: Tue May 7 17:47:20 2019 > New Revision: 347229 > URL: https://svnweb.freebsd.org/changeset/base/347229 > > Log: > device_printf: Use sbuf for more coherent prints on SMP > > device_printf does multiple calls to printf allowing other console > messages to > be inserted between the device name, and the rest of the message. This > change > uses sbuf to compose to two into a single buffer, and prints it all at > once. > > It exposes an sbuf drain function (drain-to-printf) for common use. > > Update documentation to match; some unit tests included. > > Submitted by: jmg > Sponsored by: Dell EMC Isilon ^^^ Sorry, I added this on autopilot. It was fully jmg@=E2=80=98s work. > Differential Revision: https://reviews.freebsd.org/D16690 > From owner-svn-src-all@freebsd.org Tue May 7 18:22:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01FD4158FEB4; Tue, 7 May 2019 18:22:54 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f172.google.com (mail-it1-f172.google.com [209.85.166.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93EC46EE61; Tue, 7 May 2019 18:22:53 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f172.google.com with SMTP id l10so28092129iti.3; Tue, 07 May 2019 11:22:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wCmkblR0lpTgD8vPo/Hj2Mvztly4B51ZVHHZQ1MOAf4=; b=UOB9PUAlLECqMQRlZvpcG6D31zW+2wtXOZP3pT+1Cvxl6yK4X7sJMLUHDwIGg3u3Te Xda4sgCZe6mor7LRzfchpb1Fm9zmaEMvDZpfm9X3oMQiHcS9k4jHO761v+FrgqWYaXgX GZczucmKJp6vIJmIArCpX4eH29npujAUDbE4BAntEv8IjetJixZrLseumHOCbSXtaIZ+ xRmHragDV/qcvISl5zNbXKmv7S+EemeisFYtO3gFYn7PUz/Oo8SEnjKin+Dad+vIvcog RNmw6Q8cTrAVfX50vP89lYS+Uap339Im0KmHcmtmtXw4NaAz26y6Y4C09Q82yC2t0WH1 CT+w== X-Gm-Message-State: APjAAAWNFo2FBxAG9NQ0nJrgFVaaJItjKB7whjqzLL8uvLM/Kyqs/oXS 6FAQy79DBzhs8luVA3YJ8RWje1sk+Vz9wbz/tI1c+5Bk X-Google-Smtp-Source: APXvYqzilqcHE+pUl9qGDHkdChlkZ2YLXvsgK5tko1i0v3GMKCUQZfHrJ0j6EYjQReVM0MWcU4Izqtsp6/gPXIPW8SM= X-Received: by 2002:a05:6638:606:: with SMTP id g6mr24433384jar.129.1557252903517; Tue, 07 May 2019 11:15:03 -0700 (PDT) MIME-Version: 1.0 References: <201905071617.x47GHXB0065438@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Tue, 7 May 2019 02:03:50 -0400 Message-ID: Subject: Re: svn commit: r347228 - head/sys/kern To: Ravi Pokala Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 93EC46EE61 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.91)[-0.907,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 18:22:54 -0000 On Tue, 7 May 2019 at 13:00, Ravi Pokala wrote: > > > + # Avoid a literal generated file tag here. > > + generated = "@" "generated"; > > + > > Why is that needed here, but not in r347224? It is, see https://reviews.freebsd.org/D20182 From owner-svn-src-all@freebsd.org Tue May 7 18:35:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFBE41590378; Tue, 7 May 2019 18:35:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6EF06F4E6; Tue, 7 May 2019 18:35:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x47IZZMV085406 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 7 May 2019 21:35:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x47IZZMV085406 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x47IZZrg085405; Tue, 7 May 2019 21:35:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 7 May 2019 21:35:35 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347229 - in head: lib/libsbuf lib/libsbuf/tests share/man/man9 sys/kern sys/sys Message-ID: <20190507183534.GW2748@kib.kiev.ua> References: <201905071747.x47HlKTh012163@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905071747.x47HlKTh012163@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 18:35:44 -0000 On Tue, May 07, 2019 at 05:47:20PM +0000, Conrad Meyer wrote: > Author: cem > Date: Tue May 7 17:47:20 2019 > New Revision: 347229 > URL: https://svnweb.freebsd.org/changeset/base/347229 > > Log: > device_printf: Use sbuf for more coherent prints on SMP > > device_printf does multiple calls to printf allowing other console messages to > be inserted between the device name, and the rest of the message. This change > uses sbuf to compose to two into a single buffer, and prints it all at once. > > It exposes an sbuf drain function (drain-to-printf) for common use. > > Update documentation to match; some unit tests included. > > Submitted by: jmg > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D16690 > > Modified: > head/lib/libsbuf/Symbol.map > head/lib/libsbuf/tests/sbuf_core_test.c > head/lib/libsbuf/tests/sbuf_stdio_test.c > head/share/man/man9/Makefile > head/share/man/man9/sbuf.9 > head/sys/kern/kern_sysctl.c > head/sys/kern/subr_bus.c > head/sys/kern/subr_prf.c > head/sys/sys/sbuf.h > > Modified: head/lib/libsbuf/Symbol.map > ============================================================================== > --- head/lib/libsbuf/Symbol.map Tue May 7 16:17:33 2019 (r347228) > +++ head/lib/libsbuf/Symbol.map Tue May 7 17:47:20 2019 (r347229) > @@ -37,5 +37,6 @@ FBSD_1.4 { > > FBSD_1.5 { > sbuf_putbuf; > + sbuf_printf_drain; > }; The version is wrong. From owner-svn-src-all@freebsd.org Tue May 7 19:06:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE5F01590C0F; Tue, 7 May 2019 19:06:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8190C7034F; Tue, 7 May 2019 19:06:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 568B622811; Tue, 7 May 2019 19:06:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47J6gx5053487; Tue, 7 May 2019 19:06:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47J6gj3053486; Tue, 7 May 2019 19:06:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905071906.x47J6gj3053486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 7 May 2019 19:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347231 - head/sys/amd64/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/amd64/linux X-SVN-Commit-Revision: 347231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8190C7034F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 19:06:43 -0000 Author: trasz Date: Tue May 7 19:06:41 2019 New Revision: 347231 URL: https://svnweb.freebsd.org/changeset/base/347231 Log: Support PTRACE_GETREGSET w/ NT_PRSTATUS in Linux ptrace(2). While Linux strace(1) doesn't strictly require it - it has a fallback to PTRACE_GETREGS - it's a newer interface, so we better support it before the old one is deprecated. Reviewed by: dchagin MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20152 Modified: head/sys/amd64/linux/linux_ptrace.c Modified: head/sys/amd64/linux/linux_ptrace.c ============================================================================== --- head/sys/amd64/linux/linux_ptrace.c Tue May 7 18:10:21 2019 (r347230) +++ head/sys/amd64/linux/linux_ptrace.c Tue May 7 19:06:41 2019 (r347231) @@ -131,6 +131,36 @@ struct linux_pt_reg { l_ulong ss; }; +struct linux_pt_regset { + l_ulong r15; + l_ulong r14; + l_ulong r13; + l_ulong r12; + l_ulong rbp; + l_ulong rbx; + l_ulong r11; + l_ulong r10; + l_ulong r9; + l_ulong r8; + l_ulong rax; + l_ulong rcx; + l_ulong rdx; + l_ulong rsi; + l_ulong rdi; + l_ulong orig_rax; + l_ulong rip; + l_ulong cs; + l_ulong eflags; + l_ulong rsp; + l_ulong ss; + l_ulong fs_base; + l_ulong gs_base; + l_ulong ds; + l_ulong es; + l_ulong fs; + l_ulong gs; +}; + /* * Translate amd64 ptrace registers between Linux and FreeBSD formats. * The translation is pretty straighforward, for all registers but @@ -164,6 +194,40 @@ map_regs_to_linux(struct reg *b_reg, struct linux_pt_r } static void +map_regs_to_linux_regset(struct reg *b_reg, unsigned long fs_base, + unsigned long gs_base, struct linux_pt_regset *l_regset) +{ + + l_regset->r15 = b_reg->r_r15; + l_regset->r14 = b_reg->r_r14; + l_regset->r13 = b_reg->r_r13; + l_regset->r12 = b_reg->r_r12; + l_regset->rbp = b_reg->r_rbp; + l_regset->rbx = b_reg->r_rbx; + l_regset->r11 = b_reg->r_r11; + l_regset->r10 = b_reg->r_r10; + l_regset->r9 = b_reg->r_r9; + l_regset->r8 = b_reg->r_r8; + l_regset->rax = b_reg->r_rax; + l_regset->rcx = b_reg->r_rcx; + l_regset->rdx = b_reg->r_rdx; + l_regset->rsi = b_reg->r_rsi; + l_regset->rdi = b_reg->r_rdi; + l_regset->orig_rax = b_reg->r_rax; + l_regset->rip = b_reg->r_rip; + l_regset->cs = b_reg->r_cs; + l_regset->eflags = b_reg->r_rflags; + l_regset->rsp = b_reg->r_rsp; + l_regset->ss = b_reg->r_ss; + l_regset->fs_base = fs_base; + l_regset->gs_base = gs_base; + l_regset->ds = b_reg->r_ds; + l_regset->es = b_reg->r_es; + l_regset->fs = b_reg->r_fs; + l_regset->gs = b_reg->r_gs; +} + +static void map_regs_from_linux(struct reg *b_reg, struct linux_pt_reg *l_reg) { b_reg->r_r15 = l_reg->r15; @@ -306,14 +370,75 @@ linux_ptrace_setregs(struct thread *td, pid_t pid, voi } static int +linux_ptrace_getregset_prstatus(struct thread *td, pid_t pid, l_ulong data) +{ + struct ptrace_lwpinfo lwpinfo; + struct reg b_reg; + struct linux_pt_regset l_regset; + struct iovec iov; + struct pcb *pcb; + unsigned long fsbase, gsbase; + size_t len; + int error; + + error = copyin((const void *)data, &iov, sizeof(iov)); + if (error != 0) { + printf("%s: copyin error %d\n", __func__, error); + return (error); + } + + error = kern_ptrace(td, PT_GETREGS, pid, &b_reg, 0); + if (error != 0) + return (error); + + pcb = td->td_pcb; + if (td == curthread) + update_pcb_bases(pcb); + fsbase = pcb->pcb_fsbase; + gsbase = pcb->pcb_gsbase; + + map_regs_to_linux_regset(&b_reg, fsbase, gsbase, &l_regset); + + /* + * The strace(1) utility depends on RAX being set to -ENOSYS + * on syscall entry; otherwise it loops printing those: + * + * [ Process PID=928 runs in 64 bit mode. ] + * [ Process PID=928 runs in x32 mode. ] + */ + error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); + if (error != 0) { + printf("%s: PT_LWPINFO failed with error %d\n", + __func__, error); + return (error); + } + if (lwpinfo.pl_flags & PL_FLAG_SCE) + l_regset.rax = -38; // XXX: Don't hardcode? + + len = MIN(iov.iov_len, sizeof(l_regset)); + error = copyout(&l_regset, (void *)iov.iov_base, len); + if (error != 0) { + printf("%s: copyout error %d\n", __func__, error); + return (error); + } + + iov.iov_len -= len; + error = copyout(&iov, (void *)data, sizeof(iov)); + if (error != 0) { + printf("%s: iov copyout error %d\n", __func__, error); + return (error); + } + + return (error); +} + +static int linux_ptrace_getregset(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) { switch (addr) { case LINUX_NT_PRSTATUS: - printf("%s: NT_PRSTATUS not implemented; returning EINVAL\n", - __func__); - return (EINVAL); + return (linux_ptrace_getregset_prstatus(td, pid, data)); default: printf("%s: PTRACE_GETREGSET request %ld not implemented; " "returning EINVAL\n", __func__, addr); From owner-svn-src-all@freebsd.org Tue May 7 19:48:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14E6E15920BF; Tue, 7 May 2019 19:48:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B054D7205F; Tue, 7 May 2019 19:48:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8492422EC4; Tue, 7 May 2019 19:48:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47JmeOf075023; Tue, 7 May 2019 19:48:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47Jmefc075022; Tue, 7 May 2019 19:48:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905071948.x47Jmefc075022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 7 May 2019 19:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347232 - stable/12/crypto/openssh X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/crypto/openssh X-SVN-Commit-Revision: 347232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B054D7205F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 19:48:41 -0000 Author: emaste Date: Tue May 7 19:48:39 2019 New Revision: 347232 URL: https://svnweb.freebsd.org/changeset/base/347232 Log: MFC r345576: Merge r345574 from vendor-crypto: upstream: when checking that filenames sent by the server side match what the client requested, be prepared to handle shell-style brace alternations, e.g. "{foo,bar}". "looks good to me" millert@ + in snaps for the last week courtesy deraadt@ OpenBSD-Commit-ID: 3b1ce7639b0b25b2248e3a30f561a548f6815f3e PR: 234965 Discussed with: des Obtained from: OpenSSH-portable 3d896c157c722bc47adca51a58dca859225b5874 Modified: stable/12/crypto/openssh/scp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/crypto/openssh/scp.c ============================================================================== --- stable/12/crypto/openssh/scp.c Tue May 7 19:06:41 2019 (r347231) +++ stable/12/crypto/openssh/scp.c Tue May 7 19:48:39 2019 (r347232) @@ -1,4 +1,4 @@ -/* $OpenBSD: scp.c,v 1.203 2019/01/27 07:14:11 jmc Exp $ */ +/* $OpenBSD: scp.c,v 1.204 2019/02/10 11:15:52 djm Exp $ */ /* * scp - secure remote copy. This is basically patched BSD rcp which * uses ssh to do the data transfer (instead of using rcmd). @@ -626,6 +626,253 @@ parse_scp_uri(const char *uri, char **userp, char **ho return r; } +/* Appends a string to an array; returns 0 on success, -1 on alloc failure */ +static int +append(char *cp, char ***ap, size_t *np) +{ + char **tmp; + + if ((tmp = reallocarray(*ap, *np + 1, sizeof(*tmp))) == NULL) + return -1; + tmp[(*np)] = cp; + (*np)++; + *ap = tmp; + return 0; +} + +/* + * Finds the start and end of the first brace pair in the pattern. + * returns 0 on success or -1 for invalid patterns. + */ +static int +find_brace(const char *pattern, int *startp, int *endp) +{ + int i; + int in_bracket, brace_level; + + *startp = *endp = -1; + in_bracket = brace_level = 0; + for (i = 0; i < INT_MAX && *endp < 0 && pattern[i] != '\0'; i++) { + switch (pattern[i]) { + case '\\': + /* skip next character */ + if (pattern[i + 1] != '\0') + i++; + break; + case '[': + in_bracket = 1; + break; + case ']': + in_bracket = 0; + break; + case '{': + if (in_bracket) + break; + if (pattern[i + 1] == '}') { + /* Protect a single {}, for find(1), like csh */ + i++; /* skip */ + break; + } + if (*startp == -1) + *startp = i; + brace_level++; + break; + case '}': + if (in_bracket) + break; + if (*startp < 0) { + /* Unbalanced brace */ + return -1; + } + if (--brace_level <= 0) + *endp = i; + break; + } + } + /* unbalanced brackets/braces */ + if (*endp < 0 && (*startp >= 0 || in_bracket)) + return -1; + return 0; +} + +/* + * Assembles and records a successfully-expanded pattern, returns -1 on + * alloc failure. + */ +static int +emit_expansion(const char *pattern, int brace_start, int brace_end, + int sel_start, int sel_end, char ***patternsp, size_t *npatternsp) +{ + char *cp; + int o = 0, tail_len = strlen(pattern + brace_end + 1); + + if ((cp = malloc(brace_start + (sel_end - sel_start) + + tail_len + 1)) == NULL) + return -1; + + /* Pattern before initial brace */ + if (brace_start > 0) { + memcpy(cp, pattern, brace_start); + o = brace_start; + } + /* Current braced selection */ + if (sel_end - sel_start > 0) { + memcpy(cp + o, pattern + sel_start, + sel_end - sel_start); + o += sel_end - sel_start; + } + /* Remainder of pattern after closing brace */ + if (tail_len > 0) { + memcpy(cp + o, pattern + brace_end + 1, tail_len); + o += tail_len; + } + cp[o] = '\0'; + if (append(cp, patternsp, npatternsp) != 0) { + free(cp); + return -1; + } + return 0; +} + +/* + * Expand the first encountered brace in pattern, appending the expanded + * patterns it yielded to the *patternsp array. + * + * Returns 0 on success or -1 on allocation failure. + * + * Signals whether expansion was performed via *expanded and whether + * pattern was invalid via *invalid. + */ +static int +brace_expand_one(const char *pattern, char ***patternsp, size_t *npatternsp, + int *expanded, int *invalid) +{ + int i; + int in_bracket, brace_start, brace_end, brace_level; + int sel_start, sel_end; + + *invalid = *expanded = 0; + + if (find_brace(pattern, &brace_start, &brace_end) != 0) { + *invalid = 1; + return 0; + } else if (brace_start == -1) + return 0; + + in_bracket = brace_level = 0; + for (i = sel_start = brace_start + 1; i < brace_end; i++) { + switch (pattern[i]) { + case '{': + if (in_bracket) + break; + brace_level++; + break; + case '}': + if (in_bracket) + break; + brace_level--; + break; + case '[': + in_bracket = 1; + break; + case ']': + in_bracket = 0; + break; + case '\\': + if (i < brace_end - 1) + i++; /* skip */ + break; + } + if (pattern[i] == ',' || i == brace_end - 1) { + if (in_bracket || brace_level > 0) + continue; + /* End of a selection, emit an expanded pattern */ + + /* Adjust end index for last selection */ + sel_end = (i == brace_end - 1) ? brace_end : i; + if (emit_expansion(pattern, brace_start, brace_end, + sel_start, sel_end, patternsp, npatternsp) != 0) + return -1; + /* move on to the next selection */ + sel_start = i + 1; + continue; + } + } + if (in_bracket || brace_level > 0) { + *invalid = 1; + return 0; + } + /* success */ + *expanded = 1; + return 0; +} + +/* Expand braces from pattern. Returns 0 on success, -1 on failure */ +static int +brace_expand(const char *pattern, char ***patternsp, size_t *npatternsp) +{ + char *cp, *cp2, **active = NULL, **done = NULL; + size_t i, nactive = 0, ndone = 0; + int ret = -1, invalid = 0, expanded = 0; + + *patternsp = NULL; + *npatternsp = 0; + + /* Start the worklist with the original pattern */ + if ((cp = strdup(pattern)) == NULL) + return -1; + if (append(cp, &active, &nactive) != 0) { + free(cp); + return -1; + } + while (nactive > 0) { + cp = active[nactive - 1]; + nactive--; + if (brace_expand_one(cp, &active, &nactive, + &expanded, &invalid) == -1) { + free(cp); + goto fail; + } + if (invalid) + fatal("%s: invalid brace pattern \"%s\"", __func__, cp); + if (expanded) { + /* + * Current entry expanded to new entries on the + * active list; discard the progenitor pattern. + */ + free(cp); + continue; + } + /* + * Pattern did not expand; append the finename component to + * the completed list + */ + if ((cp2 = strrchr(cp, '/')) != NULL) + *cp2++ = '\0'; + else + cp2 = cp; + if (append(xstrdup(cp2), &done, &ndone) != 0) { + free(cp); + goto fail; + } + free(cp); + } + /* success */ + *patternsp = done; + *npatternsp = ndone; + done = NULL; + ndone = 0; + ret = 0; + fail: + for (i = 0; i < nactive; i++) + free(active[i]); + free(active); + for (i = 0; i < ndone; i++) + free(done[i]); + free(done); + return ret; +} + void toremote(int argc, char **argv) { @@ -989,7 +1236,8 @@ sink(int argc, char **argv, const char *src) unsigned long long ull; int setimes, targisdir, wrerrno = 0; char ch, *cp, *np, *targ, *why, *vect[1], buf[2048], visbuf[2048]; - char *src_copy = NULL, *restrict_pattern = NULL; + char **patterns = NULL; + size_t n, npatterns = 0; struct timeval tv[2]; #define atime tv[0] @@ -1019,16 +1267,13 @@ sink(int argc, char **argv, const char *src) * Prepare to try to restrict incoming filenames to match * the requested destination file glob. */ - if ((src_copy = strdup(src)) == NULL) - fatal("strdup failed"); - if ((restrict_pattern = strrchr(src_copy, '/')) != NULL) { - *restrict_pattern++ = '\0'; - } + if (brace_expand(src, &patterns, &npatterns) != 0) + fatal("%s: could not expand pattern", __func__); } for (first = 1;; first = 0) { cp = buf; if (atomicio(read, remin, cp, 1) != 1) - return; + goto done; if (*cp++ == '\n') SCREWUP("unexpected "); do { @@ -1054,7 +1299,7 @@ sink(int argc, char **argv, const char *src) } if (buf[0] == 'E') { (void) atomicio(vwrite, remout, "", 1); - return; + goto done; } if (ch == '\n') *--cp = 0; @@ -1129,9 +1374,14 @@ sink(int argc, char **argv, const char *src) run_err("error: unexpected filename: %s", cp); exit(1); } - if (restrict_pattern != NULL && - fnmatch(restrict_pattern, cp, 0) != 0) - SCREWUP("filename does not match request"); + if (npatterns > 0) { + for (n = 0; n < npatterns; n++) { + if (fnmatch(patterns[n], cp, 0) == 0) + break; + } + if (n >= npatterns) + SCREWUP("filename does not match request"); + } if (targisdir) { static char *namebuf; static size_t cursize; @@ -1290,7 +1540,15 @@ bad: run_err("%s: %s", np, strerror(errno)); break; } } +done: + for (n = 0; n < npatterns; n++) + free(patterns[n]); + free(patterns); + return; screwup: + for (n = 0; n < npatterns; n++) + free(patterns[n]); + free(patterns); run_err("protocol error: %s", why); exit(1); } From owner-svn-src-all@freebsd.org Tue May 7 20:28:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 909461592E2C; Tue, 7 May 2019 20:28:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 363F373280; Tue, 7 May 2019 20:28:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D49A23591; Tue, 7 May 2019 20:28:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47KSCLH096244; Tue, 7 May 2019 20:28:12 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47KSCn7096242; Tue, 7 May 2019 20:28:12 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905072028.x47KSCn7096242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 7 May 2019 20:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347233 - head/sys/dev/virtio/network X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/dev/virtio/network X-SVN-Commit-Revision: 347233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 363F373280 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 20:28:13 -0000 Author: tuexen Date: Tue May 7 20:28:12 2019 New Revision: 347233 URL: https://svnweb.freebsd.org/changeset/base/347233 Log: Remove non-functional SCTP checksum offload support for virtio. Checksum offloading for SCTP is not currently specified for virtio. If the hypervisor announces checksum offloading support, it means TCP and UDP checksum offload. If an SCTP packet is sent and the host announced checksum offload support, the hypervisor inserts the IP checksum (16-bit) at the correct offset, but this is not the right checksum, which is a CRC32c. This results in all outgoing packets having the wrong checksum and therefore breaking SCTP based communications. This patch removes SCTP checksum offloading support from the virtio network interface. Thanks to Felix Weinrank for making me aware of the issue. Reviewed by: bryanv@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20147 Modified: head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/network/if_vtnetvar.h Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Tue May 7 19:48:39 2019 (r347232) +++ head/sys/dev/virtio/network/if_vtnet.c Tue May 7 20:28:12 2019 (r347233) @@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -1525,9 +1524,6 @@ vtnet_rxq_csum_by_offset(struct vtnet_rxq *rxq, struct m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xFFFF; break; - case offsetof(struct sctphdr, checksum): - m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; - break; default: sc->vtnet_stats.rx_csum_bad_offset++; return (1); @@ -1584,11 +1580,6 @@ vtnet_rxq_csum_by_parse(struct vtnet_rxq *rxq, struct return (1); m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xFFFF; - break; - case IPPROTO_SCTP: - if (__predict_false(m->m_len < offset + sizeof(struct sctphdr))) - return (1); - m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; break; default: /* Modified: head/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Tue May 7 19:48:39 2019 (r347232) +++ head/sys/dev/virtio/network/if_vtnetvar.h Tue May 7 20:28:12 2019 (r347233) @@ -268,8 +268,8 @@ struct vtnet_mac_filter { CTASSERT(sizeof(struct vtnet_mac_filter) <= PAGE_SIZE); #define VTNET_TX_TIMEOUT 5 -#define VTNET_CSUM_OFFLOAD (CSUM_TCP | CSUM_UDP | CSUM_SCTP) -#define VTNET_CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_SCTP_IPV6) +#define VTNET_CSUM_OFFLOAD (CSUM_TCP | CSUM_UDP) +#define VTNET_CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6) #define VTNET_CSUM_ALL_OFFLOAD \ (VTNET_CSUM_OFFLOAD | VTNET_CSUM_OFFLOAD_IPV6 | CSUM_TSO) From owner-svn-src-all@freebsd.org Tue May 7 20:39:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B84B81593534; Tue, 7 May 2019 20:39:40 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D8B873B51; Tue, 7 May 2019 20:39:40 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CC5723744; Tue, 7 May 2019 20:39:40 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47KddLL001916; Tue, 7 May 2019 20:39:39 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47Kdd5e001915; Tue, 7 May 2019 20:39:39 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905072039.x47Kdd5e001915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 7 May 2019 20:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347234 - head/lib/libpam/modules/pam_login_access X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libpam/modules/pam_login_access X-SVN-Commit-Revision: 347234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D8B873B51 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 20:39:40 -0000 Author: cy Date: Tue May 7 20:39:39 2019 New Revision: 347234 URL: https://svnweb.freebsd.org/changeset/base/347234 Log: Improve the legibility of the login.access.5 man page by separating each argument into its own paragraph. MFC after: 3 days Modified: head/lib/libpam/modules/pam_login_access/login.access.5 Modified: head/lib/libpam/modules/pam_login_access/login.access.5 ============================================================================== --- head/lib/libpam/modules/pam_login_access/login.access.5 Tue May 7 20:28:12 2019 (r347233) +++ head/lib/libpam/modules/pam_login_access/login.access.5 Tue May 7 20:39:39 2019 (r347234) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2006 +.Dd May 7, 2019 .Dt LOGIN.ACCESS 5 .Os .Sh NAME @@ -29,8 +29,10 @@ character: .Pp The first field should be a "+" (access granted) or "-" (access denied) character. +.Pp The second field should be a list of one or more login names, group names, or ALL (always matches). +.Pp The third field should be a list of one or more tty names (for non-networked logins), host names, domain names (begin with "."), host addresses, internet network numbers (end From owner-svn-src-all@freebsd.org Tue May 7 21:15:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91A9A15942ED; Tue, 7 May 2019 21:15:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A3637546E; Tue, 7 May 2019 21:15:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07A3F23E60; Tue, 7 May 2019 21:15:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x47LFBTF022672; Tue, 7 May 2019 21:15:11 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x47LFBAr022670; Tue, 7 May 2019 21:15:11 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905072115.x47LFBAr022670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 7 May 2019 21:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347235 - head/lib/libsbuf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libsbuf X-SVN-Commit-Revision: 347235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A3637546E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2019 21:15:12 -0000 Author: cem Date: Tue May 7 21:15:11 2019 New Revision: 347235 URL: https://svnweb.freebsd.org/changeset/base/347235 Log: Fix libsbuf sbuf_printf_drain symbol version (Introduced incorrectly in r347229 earlier today.) As pointed out by kevans, 1.6 should be used for FreeBSD 13, like r340383. Submitted by: kevans Reported by: kib Reviewed by: jilles X-MFC-with: r347229 Differential Revision: https://reviews.freebsd.org/D20187 Modified: head/lib/libsbuf/Symbol.map head/lib/libsbuf/Version.def Modified: head/lib/libsbuf/Symbol.map ============================================================================== --- head/lib/libsbuf/Symbol.map Tue May 7 20:39:39 2019 (r347234) +++ head/lib/libsbuf/Symbol.map Tue May 7 21:15:11 2019 (r347235) @@ -37,6 +37,9 @@ FBSD_1.4 { FBSD_1.5 { sbuf_putbuf; - sbuf_printf_drain; }; +/* Added in FreeBSD 13.x */ +FBSD_1.6 { + sbuf_printf_drain; +}; Modified: head/lib/libsbuf/Version.def ============================================================================== --- head/lib/libsbuf/Version.def Tue May 7 20:39:39 2019 (r347234) +++ head/lib/libsbuf/Version.def Tue May 7 21:15:11 2019 (r347235) @@ -11,3 +11,7 @@ FBSD_1.4 { FBSD_1.5 { } FBSD_1.4; + +# This version was first added to 13.0-current. +FBSD_1.6 { +} FBSD_1.5; From owner-svn-src-all@freebsd.org Wed May 8 00:09:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA8701597B91; Wed, 8 May 2019 00:09:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E2FD82506; Wed, 8 May 2019 00:09:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23B0E25B44; Wed, 8 May 2019 00:09:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4809AMd011607; Wed, 8 May 2019 00:09:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4809AYs011605; Wed, 8 May 2019 00:09:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905080009.x4809AYs011605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 8 May 2019 00:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347237 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 347237 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E2FD82506 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 00:09:11 -0000 Author: imp Date: Wed May 8 00:09:10 2019 New Revision: 347237 URL: https://svnweb.freebsd.org/changeset/base/347237 Log: Add missing newline to debug printf. Modified: head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mps/mps_sas_lsi.c Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Tue May 7 22:38:13 2019 (r347236) +++ head/sys/dev/mpr/mpr_sas_lsi.c Wed May 8 00:09:10 2019 (r347237) @@ -1206,7 +1206,7 @@ mprsas_get_sata_identify(struct mpr_softc *sc, u16 han * reset */ mpr_dprint(sc, MPR_INFO|MPR_FAULT|MPR_MAPPING, - "Request for SATA PASSTHROUGH page completed with error %d", + "Request for SATA PASSTHROUGH page completed with error %d\n", error); error = ENXIO; goto out; Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Tue May 7 22:38:13 2019 (r347236) +++ head/sys/dev/mps/mps_sas_lsi.c Wed May 8 00:09:10 2019 (r347237) @@ -979,7 +979,7 @@ mpssas_get_sata_identify(struct mps_softc *sc, u16 han * reset */ mps_dprint(sc, MPS_INFO|MPS_FAULT|MPS_MAPPING, - "Request for SATA PASSTHROUGH page completed with error %d", + "Request for SATA PASSTHROUGH page completed with error %d\n", error); error = ENXIO; goto out; From owner-svn-src-all@freebsd.org Wed May 8 00:40:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CB3B15985B3; Wed, 8 May 2019 00:40:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A841083691; Wed, 8 May 2019 00:40:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FAAC260ED; Wed, 8 May 2019 00:40:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x480e8sW027130; Wed, 8 May 2019 00:40:08 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x480e8G5027129; Wed, 8 May 2019 00:40:08 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905080040.x480e8G5027129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 8 May 2019 00:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347238 - head/sys/amd64/vmm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/amd64/vmm X-SVN-Commit-Revision: 347238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A841083691 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 00:40:09 -0000 Author: cem Date: Wed May 8 00:40:08 2019 New Revision: 347238 URL: https://svnweb.freebsd.org/changeset/base/347238 Log: vmm(4): Pass through RDSEED feature bit to guests Reviewed by: jhb Approved by: #bhyve (jhb) MFC after: 2 leapseconds Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20194 Modified: head/sys/amd64/vmm/x86.c Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Wed May 8 00:09:10 2019 (r347237) +++ head/sys/amd64/vmm/x86.c Wed May 8 00:40:08 2019 (r347238) @@ -432,6 +432,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, CPUID_STDEXT_AVX2 | CPUID_STDEXT_BMI2 | CPUID_STDEXT_ERMS | CPUID_STDEXT_RTM | CPUID_STDEXT_AVX512F | + CPUID_STDEXT_RDSEED | CPUID_STDEXT_AVX512PF | CPUID_STDEXT_AVX512ER | CPUID_STDEXT_AVX512CD | CPUID_STDEXT_SHA); From owner-svn-src-all@freebsd.org Wed May 8 00:45:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A1B815987FD; Wed, 8 May 2019 00:45:17 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4BDD83BE9; Wed, 8 May 2019 00:45:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B08F5262AA; Wed, 8 May 2019 00:45:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x480jGQ6032141; Wed, 8 May 2019 00:45:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x480jGpo032140; Wed, 8 May 2019 00:45:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905080045.x480jGpo032140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 8 May 2019 00:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347239 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 347239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D4BDD83BE9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 00:45:17 -0000 Author: cem Date: Wed May 8 00:45:16 2019 New Revision: 347239 URL: https://svnweb.freebsd.org/changeset/base/347239 Log: random: x86 driver: Prefer RDSEED over RDRAND when available Per https://software.intel.com/en-us/blogs/2012/11/17/the-difference-between-rdrand-and-rdseed , RDRAND is a PRNG seeded from the same source as RDSEED. The source is more suitable as PRNG seed material, so prefer it when the RDSEED intrinsic is available (indicated in CPU feature bits). Reviewed by: delphij, jhb, imp (earlier version) Approved by: secteam(delphij) Security: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20192 Modified: head/sys/dev/random/ivy.c Modified: head/sys/dev/random/ivy.c ============================================================================== --- head/sys/dev/random/ivy.c Wed May 8 00:40:08 2019 (r347238) +++ head/sys/dev/random/ivy.c Wed May 8 00:45:16 2019 (r347239) @@ -44,11 +44,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #define RETRY_COUNT 10 +static bool has_rdrand, has_rdseed; static u_int random_ivy_read(void *, u_int); static struct random_source random_ivy = { @@ -57,10 +59,9 @@ static struct random_source random_ivy = { .rs_read = random_ivy_read }; -static inline int -ivy_rng_store(u_long *buf) +static int +x86_rdrand_store(u_long *buf) { -#ifdef __GNUCLIKE_ASM u_long rndval; int retry; @@ -75,11 +76,40 @@ ivy_rng_store(u_long *buf) : "+r" (retry), "=r" (rndval) : : "cc"); *buf = rndval; return (retry); -#else /* __GNUCLIKE_ASM */ - return (0); -#endif } +static int +x86_rdseed_store(u_long *buf) +{ + u_long rndval; + int retry; + + retry = RETRY_COUNT; + __asm __volatile( + "1:\n\t" + "rdseed %1\n\t" /* read randomness into rndval */ + "jc 2f\n\t" /* CF is set on success, exit retry loop */ + "dec %0\n\t" /* otherwise, retry-- */ + "jne 1b\n\t" /* and loop if retries are not exhausted */ + "2:" + : "+r" (retry), "=r" (rndval) : : "cc"); + *buf = rndval; + return (retry); +} + +DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static) +{ + has_rdrand = (cpu_feature2 & CPUID2_RDRAND); + has_rdseed = (cpu_stdext_feature & CPUID_STDEXT_RDSEED); + + if (has_rdseed) + return (x86_rdseed_store); + else if (has_rdrand) + return (x86_rdrand_store); + else + return (NULL); +} + /* It is required that buf length is a multiple of sizeof(u_long). */ static u_int random_ivy_read(void *buf, u_int c) @@ -90,7 +120,7 @@ random_ivy_read(void *buf, u_int c) KASSERT(c % sizeof(*b) == 0, ("partial read %d", c)); b = buf; for (count = c; count > 0; count -= sizeof(*b)) { - if (ivy_rng_store(&rndval) == 0) + if (x86_rng_store(&rndval) == 0) break; *b++ = rndval; } @@ -104,14 +134,14 @@ rdrand_modevent(module_t mod, int type, void *unused) switch (type) { case MOD_LOAD: - if (cpu_feature2 & CPUID2_RDRAND) { + if (has_rdrand || has_rdseed) { random_source_register(&random_ivy); printf("random: fast provider: \"%s\"\n", random_ivy.rs_ident); } break; case MOD_UNLOAD: - if (cpu_feature2 & CPUID2_RDRAND) + if (has_rdrand || has_rdseed) random_source_deregister(&random_ivy); break; From owner-svn-src-all@freebsd.org Wed May 8 01:07:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 361EC1598DCC; Wed, 8 May 2019 01:07:15 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f171.google.com (mail-it1-f171.google.com [209.85.166.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DEA784564; Wed, 8 May 2019 01:07:14 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f171.google.com with SMTP id m186so1303221itd.4; Tue, 07 May 2019 18:07:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=D6njf2JyUa3+KsopNj2Qvu+rwdhNPlX0LJUCQAZnDHs=; b=kAwcwgExvThIFSYA3XvAD8PkqkfNz+YwfaeOiKsG5cDPsMH5aBu4t3Slbq5VZtOb00 zS2+e4ibQTOCh8CvWtfenS/+v+VDBwAX63LJO6Y6oAichlos8WHHTb0jPG2/Hg/pCHTD AdrbEn+ZTylnd1CgvHTjGhp867DueadNWvfZpbdSixfo2Gkir/CnL2jdwrtB1DCpPKsF fUy9DVextzros4rf9mOXaB5G2sm/sG8fTIo7aFQw0+emBOVxWKl36VVDFGourmRXNqcj NMOgUJtBu8bxtQyXvG+MR4C66R4mafVBzZl8N9FUDfAXTZeRfeRUc786CEPM4fNIFsmQ IWyA== X-Gm-Message-State: APjAAAWsI1+aET9ApoYjcrtiBvlNbaz9+krJk6Sko/0eKGzNhSiVVP+F YxXlFkBTw+QMd7WIBfpQJ1PjH35D X-Google-Smtp-Source: APXvYqxiuoVwBJeOzuwrTcZEjOgURIiOCFM9OpQbAiL9n8pOmyrkKiM1/jRwcAYH89RyxsJ0TAEi2w== X-Received: by 2002:a24:6416:: with SMTP id t22mr1265639itc.176.1557277632953; Tue, 07 May 2019 18:07:12 -0700 (PDT) Received: from mail-it1-f176.google.com (mail-it1-f176.google.com. [209.85.166.176]) by smtp.gmail.com with ESMTPSA id m142sm379458itb.31.2019.05.07.18.07.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 18:07:12 -0700 (PDT) Received: by mail-it1-f176.google.com with SMTP id m186so1303179itd.4; Tue, 07 May 2019 18:07:12 -0700 (PDT) X-Received: by 2002:a05:660c:130f:: with SMTP id f15mr1191069itb.166.1557277632375; Tue, 07 May 2019 18:07:12 -0700 (PDT) MIME-Version: 1.0 References: <201905032154.x43LsFae008760@repo.freebsd.org> In-Reply-To: <201905032154.x43LsFae008760@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 7 May 2019 18:07:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347066 - in head: sbin/fsck_ffs sys/ufs/ufs To: Kirk McKusick Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 3DEA784564 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.171 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.51 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.54)[ip: (-6.65), ipnet: 209.85.128.0/17(-3.75), asn: 15169(-2.26), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[171.166.85.209.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 01:07:15 -0000 Hi Kirk, Coverity points out that namlen may be used uninitialized in the following sequence (CID 1401317): On Fri, May 3, 2019 at 2:54 PM Kirk McKusick wrote: > > Author: mckusick > Date: Fri May 3 21:54:14 2019 > New Revision: 347066 > URL: https://svnweb.freebsd.org/changeset/base/347066 > > Log: > This update eliminates a kernel stack disclosure bug in UFS/FFS > directory entries that is caused by uninitialized directory entry > padding written to the disk. > ... > --- head/sbin/fsck_ffs/dir.c Fri May 3 21:48:42 2019 (r347065) > +++ head/sbin/fsck_ffs/dir.c Fri May 3 21:54:14 2019 (r347066) > ... > @@ -209,15 +230,39 @@ dircheck(struct inodesc *idesc, struct direct *dp) > char *cp; > u_char type; > u_int8_t namlen; > - int spaceleft; > + int spaceleft, modified, unused; > > + modified = 0; > spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); > if (dp->d_reclen == 0 || > dp->d_reclen > spaceleft || > - (dp->d_reclen & 0x3) != 0) > + (dp->d_reclen & (DIR_ROUNDUP - 1)) != 0) > goto bad; > - if (dp->d_ino == 0) > - return (1); > + if (dp->d_ino == 0) { In this case, namlen may never be initialized. > + /* > + * Special case of an unused directory entry. Normally > + * the kernel would coalesce unused space with the previous > + * entry by extending its d_reclen, but there are situations > + * (e.g. fsck) where that doesn't occur. > + * If we're clearing out directory cruft (-z flag), then make > + * sure this entry gets fully cleared as well. > + */ > + if (zflag && fswritefd >= 0) { > + if (dp->d_type != 0) { > + dp->d_type = 0; > + modified = 1; > + } > + if (dp->d_namlen != 0) { > + dp->d_namlen = 0; > + modified = 1; > + } > + if (dp->d_name[0] != '\0') { > + dp->d_name[0] = '\0'; > + modified = 1; > + } > + } > + goto good; Then we jump 'good'. > + } > size = DIRSIZ(0, dp); > namlen = dp->d_namlen; > type = dp->d_type; > @@ -231,7 +276,37 @@ dircheck(struct inodesc *idesc, struct direct *dp) > goto bad; > if (*cp != '\0') > goto bad; > + > +good: > + if (zflag && fswritefd >= 0) { > + /* > + * Clear unused directory entry space, including the d_name > + * padding. > + */ > + /* First figure the number of pad bytes. */ > + unused = roundup2(namlen + 1, DIR_ROUNDUP) - (namlen + 1); And here we access uninitialized 'namlen'. Best, Conrad From owner-svn-src-all@freebsd.org Wed May 8 01:13:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE9D715990D2; Wed, 8 May 2019 01:13:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f171.google.com (mail-it1-f171.google.com [209.85.166.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EDC0849D8; Wed, 8 May 2019 01:13:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f171.google.com with SMTP id u16so963516itc.0; Tue, 07 May 2019 18:13:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=gvCqz2WyJtoT1Wv2s5Mh8DNr0QmdiL+pQ68I5Hogjpw=; b=NU7XCgYBdygzhLQHWkc82YYY5O0RlcCFZMcanm84b8fHXT9C8lj77ORGuCy5hMXvgz fIz1c578Eo37XzcaNjnztHQV9LGAkqADe91iSYvwEDihm3v4JQnAMYAe/+Ywb3lRmSoN H6xKIyWYeyypLzqRusZ/3GxU3eDXINJWNGvz+iCkmrq5N19QsWFae7qWghNKK5wRUbag 1bQSyz5uEQloidfrOZhnLUAmde/yUNNYeX+F4Ry3RPtIF9kQ/8YaboR+LgECmNpGLFyA ygXv85Nc784pNBC7B3ibvfdm6lEu1vf9+sziyyTq1LSrkqBLSpXtkxwgtPh1hLMKIFWM Gs4g== X-Gm-Message-State: APjAAAVz1810gWAmcF5a079pyfOSjKpLI0W3CM9Kdi1Q6Dx4t/ZN0iot iPeZYDNqQ6+QUwgs+q4M3hDJ5aq3 X-Google-Smtp-Source: APXvYqz+c+vV78VOVWq0Zd0cSmsfvRqfNIhMhdFmATNmDTHCqbu6c6gzNbgfRgRMugUgO+qLwwQJKg== X-Received: by 2002:a24:5711:: with SMTP id u17mr1226769ita.31.1557277997900; Tue, 07 May 2019 18:13:17 -0700 (PDT) Received: from mail-it1-f170.google.com (mail-it1-f170.google.com. [209.85.166.170]) by smtp.gmail.com with ESMTPSA id d195sm435365itc.21.2019.05.07.18.13.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 18:13:17 -0700 (PDT) Received: by mail-it1-f170.google.com with SMTP id q19so1338262itk.3; Tue, 07 May 2019 18:13:17 -0700 (PDT) X-Received: by 2002:a02:2949:: with SMTP id p70mr26989598jap.104.1557277997553; Tue, 07 May 2019 18:13:17 -0700 (PDT) MIME-Version: 1.0 References: <201904242030.x3OKUkgN073331@repo.freebsd.org> In-Reply-To: <201904242030.x3OKUkgN073331@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 7 May 2019 18:13:06 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346645 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys To: Tycho Nightingale Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 2EDC0849D8 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.171 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.49 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.52)[ip: (-6.54), ipnet: 209.85.128.0/17(-3.75), asn: 15169(-2.26), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[171.166.85.209.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 01:13:20 -0000 Hi Tycho, On Wed, Apr 24, 2019 at 1:31 PM Tycho Nightingale wrote: > > Author: tychon > Date: Wed Apr 24 20:30:45 2019 > New Revision: 346645 > URL: https://svnweb.freebsd.org/changeset/base/346645 > > Log: > LinuxKPI should use bus_dma(9) to be compatible with an IOMMU > > Reviewed by: hselasky, kib > Tested by: greg@unrelenting.technology > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D19845 >... > Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c > ============================================================================== > --- head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 19:56:02 2019 (r346644) > +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 20:30:45 2019 (r346645) > ... > +linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) > +{ > ... > + nseg = -1; > + mtx_lock(&priv->dma_lock); > + if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, phys, len, > + BUS_DMA_NOWAIT, &seg, &nseg) != 0) { > + bus_dmamap_destroy(priv->dmat, obj->dmamap); > + mtx_unlock(&priv->dma_lock); > + uma_zfree(linux_dma_obj_zone, obj); > + return (0); > + } > + mtx_unlock(&priv->dma_lock); > + > + KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg)); This construct is a bit odd. Coverity produces the (perhaps spurious) warning (CID 1401319) that the KASSERT (which can be compiled out in !INVARIANTS builds) has a side effect (++nseg). While true, nseg is never used afterwards, so perhaps we can use the equivalent expression with no side effect instead? I.e., something like: KASSERT(nseg == 0, ("More than one segment (nseg=%d)", nseg + 1)); Does that make sense? It is a false positive of sorts, but performing side effects in compiled-out assert is a pretty strong antipattern so I'd just as soon "fix" the warning. Thanks, Conrad From owner-svn-src-all@freebsd.org Wed May 8 01:25:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3173B15996DF; Wed, 8 May 2019 01:25:06 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6CA285102; Wed, 8 May 2019 01:25:05 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 9A84C14E159; Tue, 7 May 2019 21:24:59 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=sasl; bh= htkg6BhtvsGYdOgDXZmA1a8dSiY=; b=SjxRq3UzMZOuqT+x+c6Yne+xE4e8cVZH zcEhWAnFoZ88KMDDLenUv/TEtUf1FLjJF0q9WTQ0AM0gprsK2SXNTzDZJUA1fTE0 9ZoKgS9JgxJbav8HGxqfyQZpKn950B6XqQZiVRGsMdyJsIjvkPl/vuOPZJgbYuT6 tHmbmVWzv9c= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 916E914E158; Tue, 7 May 2019 21:24:59 -0400 (EDT) Received: from [10.0.1.195] (unknown [146.115.68.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id BC32E14E155; Tue, 7 May 2019 21:24:58 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r346645 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys From: Tycho Nightingale In-Reply-To: Date: Tue, 7 May 2019 21:24:57 -0400 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <6991C64C-D105-423F-B66A-4E2B2924565F@freebsd.org> References: <201904242030.x3OKUkgN073331@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3445.9.1) X-Pobox-Relay-ID: 18212434-7130-11E9-A6BF-46F8B7964D18-09779102!pb-smtp1.pobox.com X-Rspamd-Queue-Id: C6CA285102 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.948,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 01:25:06 -0000 Hi, > On May 7, 2019, at 9:13 PM, Conrad Meyer wrote: >=20 > Hi Tycho, >=20 > On Wed, Apr 24, 2019 at 1:31 PM Tycho Nightingale = wrote: >>=20 >> Author: tychon >> Date: Wed Apr 24 20:30:45 2019 >> New Revision: 346645 >> URL: https://svnweb.freebsd.org/changeset/base/346645 >>=20 >> Log: >> LinuxKPI should use bus_dma(9) to be compatible with an IOMMU >>=20 >> Reviewed by: hselasky, kib >> Tested by: greg@unrelenting.technology >> Sponsored by: Dell EMC Isilon >> Differential Revision: https://reviews.freebsd.org/D19845 >> ... >> Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 = 19:56:02 2019 (r346644) >> +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 = 20:30:45 2019 (r346645) >> ... >> +linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) >> +{ >> ... >> + nseg =3D -1; >> + mtx_lock(&priv->dma_lock); >> + if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, phys, len, >> + BUS_DMA_NOWAIT, &seg, &nseg) !=3D 0) { >> + bus_dmamap_destroy(priv->dmat, obj->dmamap); >> + mtx_unlock(&priv->dma_lock); >> + uma_zfree(linux_dma_obj_zone, obj); >> + return (0); >> + } >> + mtx_unlock(&priv->dma_lock); >> + >> + KASSERT(++nseg =3D=3D 1, ("More than one segment (nseg=3D%d)", = nseg)); >=20 > This construct is a bit odd. Coverity produces the (perhaps spurious) > warning (CID 1401319) that the KASSERT (which can be compiled out in > !INVARIANTS builds) has a side effect (++nseg). While true, nseg is > never used afterwards, so perhaps we can use the equivalent expression > with no side effect instead? I.e., something like: >=20 > KASSERT(nseg =3D=3D 0, ("More than one segment (nseg=3D%d)", nseg + = 1)); >=20 > Does that make sense? It is a false positive of sorts, but performing > side effects in compiled-out assert is a pretty strong antipattern so > I'd just as soon "fix" the warning. The construct is indeed a little odd and mimics how other callers of = _bus_dmamap_load_phys() handle the bizarre way nseg is treated. There = isn=E2=80=99t any reason for it and in hindsight I prefer your version = =E2=80=94 especially if it eliminates this Coverity issue. Tycho= From owner-svn-src-all@freebsd.org Wed May 8 01:35:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B0491599B0E; Wed, 8 May 2019 01:35:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4FB685702; Wed, 8 May 2019 01:35:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AC7426AE8; Wed, 8 May 2019 01:35:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x481Zh9o058171; Wed, 8 May 2019 01:35:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x481ZhPS058170; Wed, 8 May 2019 01:35:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905080135.x481ZhPS058170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 8 May 2019 01:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347240 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 347240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4FB685702 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 01:35:44 -0000 Author: mav Date: Wed May 8 01:35:43 2019 New Revision: 347240 URL: https://svnweb.freebsd.org/changeset/base/347240 Log: Fix dataset name comparison in zfs_compare(). The code never returned match comparing two datasets (not snapshots). As result, uu_avl_find(), called from zfs_callback(), never succeeded, allowing to add same dataset into the list multiple times, for example: # zfs get name pers pers pers@z pers@z NAME PROPERTY VALUE SOURCE pers name pers - pers name pers - pers@z name pers@z - With the patch: # zfs get name pers pers pers@z pers@z NAME PROPERTY VALUE SOURCE pers name pers - pers@z name pers@z - MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Wed May 8 00:45:16 2019 (r347239) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c Wed May 8 01:35:43 2019 (r347240) @@ -225,7 +225,7 @@ zfs_compare(const void *larg, const void *rarg, void * *rat = '\0'; ret = strcmp(lname, rname); - if (ret == 0) { + if (ret == 0 && (lat != NULL || rat != NULL)) { /* * If we're comparing a dataset to one of its snapshots, we * always make the full dataset first. From owner-svn-src-all@freebsd.org Wed May 8 02:32:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D88FD159A7AC; Wed, 8 May 2019 02:32:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82B7C86D33; Wed, 8 May 2019 02:32:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5419627518; Wed, 8 May 2019 02:32:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x482WG45088588; Wed, 8 May 2019 02:32:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x482WBXN088564; Wed, 8 May 2019 02:32:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905080232.x482WBXN088564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 May 2019 02:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347241 - in head: . sbin/ifconfig share/man/man4 sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules sys/modules/if_tap sys/modules/if_tun sys/m... X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . sbin/ifconfig share/man/man4 sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules sys/modules/if_tap sys/modules/if_tun sys/modules/if_tuntap sys/net ... X-SVN-Commit-Revision: 347241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 82B7C86D33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 02:32:17 -0000 Author: kevans Date: Wed May 8 02:32:11 2019 New Revision: 347241 URL: https://svnweb.freebsd.org/changeset/base/347241 Log: tun/tap: merge and rename to `tuntap` tun(4) and tap(4) share the same general management interface and have a lot in common. Bugs exist in tap(4) that have been fixed in tun(4), and vice-versa. Let's reduce the maintenance requirements by merging them together and using flags to differentiate between the three interface types (tun, tap, vmnet). This fixes a couple of tap(4)/vmnet(4) issues right out of the gate: - tap devices may no longer be destroyed while they're open [0] - VIMAGE issues already addressed in tun by kp [0] emaste had removed an easy-panic-button in r240938 due to devdrn blocking. A naive glance over this leads me to believe that this isn't quite complete -- destroy_devl will only block while executing d_* functions, but doesn't block the device from being destroyed while a process has it open. The latter is the intent of the condvar in tun, so this is "fixed" (for certain definitions of the word -- it wasn't really broken in tap, it just wasn't quite ideal). ifconfig(8) also grew the ability to map an interface name to a kld, so that `ifconfig {tun,tap}0` can continue to autoload the correct module, and `ifconfig vmnet0 create` will now autoload the correct module. This is a low overhead addition. (MFC commentary) This may get MFC'd if many bugs in tun(4)/tap(4) are discovered after this, and how critical they are. Changes after this are likely easily MFC'd without taking this merge, but the merge will be easier. I have no plans to do this MFC as of now. Reviewed by: bcr (manpages), tuexen (testing, syzkaller/packetdrill) Input also from: melifaro Relnotes: yes Differential Revision: https://reviews.freebsd.org/D20044 Added: head/sys/modules/if_tuntap/ head/sys/modules/if_tuntap/Makefile (contents, props changed) head/sys/net/if_tuntap.c - copied, changed from r347240, head/sys/net/if_tun.c Deleted: head/sys/modules/if_tap/Makefile head/sys/modules/if_tun/Makefile head/sys/net/if_tap.c head/sys/net/if_tapvar.h head/sys/net/if_tun.c Modified: head/UPDATING head/sbin/ifconfig/ifconfig.c head/share/man/man4/tap.4 head/share/man/man4/tun.4 head/sys/amd64/conf/GENERIC head/sys/amd64/conf/MINIMAL head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/IMX53 head/sys/arm/conf/IMX6 head/sys/arm/conf/TEGRA124 head/sys/arm64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/i386/conf/MINIMAL head/sys/mips/conf/ERL head/sys/mips/conf/OCTEON1 head/sys/modules/Makefile head/sys/net/if_tap.h head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/MPC85XXSPE head/sys/powerpc/conf/QORIQ64 head/sys/riscv/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed May 8 01:35:43 2019 (r347240) +++ head/UPDATING Wed May 8 02:32:11 2019 (r347241) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20190507: + The tap(4) driver has been folded into tun(4), and the module has been + renamed to tuntap. You should update any kld_load="if_tap" or + kld_load="if_tun" entries in /etc/rc.conf, if_tap_load="YES" or + if_tun_load="YES" entries in /boot/loader.conf to load the if_tuntap + module instead, and "device tap" or "device tun" entries in kernel + config files to select the tuntap device instead. + 20190418: The following knobs have been added related to tradeoffs between safe use of the random device and availability in the absence of Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Wed May 8 01:35:43 2019 (r347240) +++ head/sbin/ifconfig/ifconfig.c Wed May 8 02:32:11 2019 (r347241) @@ -130,6 +130,25 @@ struct ifa_order_elt { TAILQ_HEAD(ifa_queue, ifa_order_elt); +static struct module_map_entry { + const char *ifname; + const char *kldname; +} module_map[] = { + { + .ifname = "tun", + .kldname = "if_tuntap", + }, + { + .ifname = "tap", + .kldname = "if_tuntap", + }, + { + .ifname = "vmnet", + .kldname = "if_tuntap", + }, +}; + + void opt_register(struct option *p) { @@ -1413,9 +1432,10 @@ ifmaybeload(const char *name) { #define MOD_PREFIX_LEN 3 /* "if_" */ struct module_stat mstat; - int fileid, modid; - char ifkind[IFNAMSIZ + MOD_PREFIX_LEN], ifname[IFNAMSIZ], *dp; + int i, fileid, modid; + char ifname[IFNAMSIZ], *ifkind, *dp; const char *cp; + struct module_map_entry *mme; /* loading suppressed by the user */ if (noload) @@ -1429,10 +1449,27 @@ ifmaybeload(const char *name) break; } - /* turn interface and unit into module name */ - strlcpy(ifkind, "if_", sizeof(ifkind)); - strlcat(ifkind, ifname, sizeof(ifkind)); + /* Either derive it from the map or guess otherwise */ + ifkind = NULL; + for (i = 0; i < nitems(module_map); ++i) { + mme = &module_map[i]; + if (strcmp(mme->ifname, ifname) == 0) { + ifkind = strdup(mme->kldname); + if (ifkind == NULL) + err(EXIT_FAILURE, "ifmaybeload"); + break; + } + } + /* We didn't have an alias for it... we'll guess. */ + if (ifkind == NULL) { + ifkind = malloc(IFNAMSIZ + MOD_PREFIX_LEN); + + /* turn interface and unit into module name */ + strlcpy(ifkind, "if_", sizeof(ifkind)); + strlcat(ifkind, ifname, sizeof(ifkind)); + } + /* scan files in kernel */ mstat.version = sizeof(struct module_stat); for (fileid = kldnext(0); fileid > 0; fileid = kldnext(fileid)) { @@ -1450,7 +1487,7 @@ ifmaybeload(const char *name) /* already loaded? */ if (strcmp(ifname, cp) == 0 || strcmp(ifkind, cp) == 0) - return; + goto out; } } @@ -1459,6 +1496,8 @@ ifmaybeload(const char *name) * infer the names of all drivers (eg mlx4en(4)). */ (void) kldload(ifkind); +out: + free(ifkind); } static struct cmd basic_cmds[] = { Modified: head/share/man/man4/tap.4 ============================================================================== --- head/share/man/man4/tap.4 Wed May 8 01:35:43 2019 (r347240) +++ head/share/man/man4/tap.4 Wed May 8 02:32:11 2019 (r347241) @@ -1,14 +1,14 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd November 29, 2017 +.Dd April 29, 2019 .Dt TAP 4 .Os .Sh NAME .Nm tap .Nd Ethernet tunnel software network interface .Sh SYNOPSIS -.Cd device tap +.Cd device tuntap .Sh DESCRIPTION The .Nm @@ -51,7 +51,7 @@ The network interfaces are named .Dq Li tap1 , etc., one for each control device that has been opened. These Ethernet network interfaces persist until -.Pa if_tap.ko +.Pa if_tuntap.ko module is unloaded, or until removed with "ifconfig destroy" (see below). .Pp .Nm @@ -96,7 +96,7 @@ It therefore defaults to being enabled until further n .Ef .Pp Control devices (once successfully opened) persist until -.Pa if_tap.ko +.Pa if_tuntap.ko is unloaded or the interface is destroyed. .Pp Each interface supports the usual Ethernet network interface @@ -296,27 +296,6 @@ device can also be used with the VMware port as a repl for the old .Em VMnet device driver. -The driver uses the minor number -to select between -.Nm -and -.Nm vmnet -devices. -.Em VMnet -minor numbers begin at -.Va 0x800000 -+ -.Va N ; -where -.Va N -is a -.Em VMnet -unit number. -In this case the control device is expected to be -.Pa /dev/vmnet Ns Sy N , -and the network interface will be -.Sy vmnet Ns Ar N . -Additionally, .Em VMnet devices do not .Xr ifconfig 8 Modified: head/share/man/man4/tun.4 ============================================================================== --- head/share/man/man4/tun.4 Wed May 8 01:35:43 2019 (r347240) +++ head/share/man/man4/tun.4 Wed May 8 02:32:11 2019 (r347241) @@ -2,14 +2,14 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd November 29, 2017 +.Dd April 29, 2019 .Dt TUN 4 .Os .Sh NAME .Nm tun .Nd tunnel software network interface .Sh SYNOPSIS -.Cd device tun +.Cd device tuntap .Sh DESCRIPTION The .Nm @@ -52,7 +52,7 @@ The network interfaces are named .Dq Li tun1 , etc., one for each control device that has been opened. These network interfaces persist until the -.Pa if_tun.ko +.Pa if_tuntap.ko module is unloaded, or until removed with the .Xr ifconfig 8 command. @@ -99,7 +99,7 @@ It therefore defaults to being enabled until further n .Ef .Pp Control devices (once successfully opened) persist until -.Pa if_tun.ko +.Pa if_tuntap.ko is unloaded in the same way that network interfaces persist (see above). .Pp Each interface supports the usual network-interface Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed May 8 01:35:43 2019 (r347240) +++ head/sys/amd64/conf/GENERIC Wed May 8 02:32:11 2019 (r347241) @@ -323,7 +323,7 @@ device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support device vlan # 802.1Q VLAN support -device tun # Packet tunnel. +device tuntap # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module Modified: head/sys/amd64/conf/MINIMAL ============================================================================== --- head/sys/amd64/conf/MINIMAL Wed May 8 01:35:43 2019 (r347240) +++ head/sys/amd64/conf/MINIMAL Wed May 8 02:32:11 2019 (r347241) @@ -136,7 +136,7 @@ device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support device vlan # 802.1Q VLAN support -device tun # Packet tunnel. +device tuntap # Packet tunnel. device gif # IPv6 and IPv4 tunneling # The `bpf' device enables the Berkeley Packet Filter. Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Wed May 8 01:35:43 2019 (r347240) +++ head/sys/arm/conf/DOCKSTAR Wed May 8 02:32:11 2019 (r347241) @@ -69,7 +69,7 @@ device loop # Network loopback device md # Memory/malloc disk device pty # BSD-style compatibility pseudo ttys device random # Entropy device -device tun # Packet tunnel. +device tuntap # Packet tunnel. device ether # Required for all ethernet devices device vlan # 802.1Q VLAN support device wlan # 802.11 WLAN support Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Wed May 8 01:35:43 2019 (r347240) +++ head/sys/arm/conf/DREAMPLUG-1001 Wed May 8 02:32:11 2019 (r347241) @@ -72,7 +72,7 @@ device loop # Network loopback device md # Memory/malloc disk device pty # BSD-style compatibility pseudo ttys device random # Entropy device -device tun # Packet tunnel. +device tuntap # Packet tunnel. device ether # Required for all ethernet devices device vlan # 802.1Q VLAN support device wlan # 802.11 WLAN support Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Wed May 8 01:35:43 2019 (r347240) +++ head/sys/arm/conf/EFIKA_MX Wed May 8 02:32:11 2019 (r347241) @@ -60,7 +60,7 @@ device loop # Network loopback device random # Entropy device device ether # Ethernet support #device vlan # 802.1Q VLAN support -#device tun # Packet tunnel. +#device tuntap # Packet tunnel. #device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling #device firmware # firmware assist module Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Wed May 8 01:35:43 2019 (r347240) +++ head/sys/arm/conf/IMX53 Wed May 8 02:32:11 2019 (r347241) @@ -47,7 +47,7 @@ device loop # Network loopback device random # Entropy device device ether # Ethernet support #device vlan # 802.1Q VLAN support -#device tun # Packet tunnel. +#device tuntap # Packet tunnel. device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling #device firmware # firmware assist module Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Wed May 8 01:35:43 2019 (r347240) +++ head/sys/arm/conf/IMX6 Wed May 8 02:32:11 2019 (r347241) @@ -51,7 +51,7 @@ device mpcore_timer device loop # Network loopback device random # Entropy device device vlan # 802.1Q VLAN support -device tun # Packet tunnel. +device tuntap # Packet tunnel. device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling #device firmware # firmware assist module Modified: head/sys/arm/conf/TEGRA124 ============================================================================== --- head/sys/arm/conf/TEGRA124 Wed May 8 01:35:43 2019 (r347240) +++ head/sys/arm/conf/TEGRA124 Wed May 8 02:32:11 2019 (r347241) @@ -45,7 +45,7 @@ device regulator device loop # Network loopback device random # Entropy device device vlan # 802.1Q VLAN support -#device tun # Packet tunnel. +#device tuntap # Packet tunnel. device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed May 8 01:35:43 2019 (r347240) +++ head/sys/arm64/conf/GENERIC Wed May 8 02:32:11 2019 (r347241) @@ -296,7 +296,7 @@ device loop # Network loopback device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support -device tun # Packet tunnel. +device tuntap # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed May 8 01:35:43 2019 (r347240) +++ head/sys/conf/NOTES Wed May 8 02:32:11 2019 (r347241) @@ -898,11 +898,9 @@ device epair # which discards all packets sent and receives none. device edsc -# The `tap' device is a pty-like virtual Ethernet interface -device tap - -# The `tun' device implements (user-)ppp and nos-tun(8) -device tun +# The `tuntap' device implements (user-)ppp, nos-tun(8) and a pty-like virtual +# Ethernet interface +device tuntap # The `gif' device implements IPv6 over IP4 tunneling, # IPv4 over IPv6 tunneling, IPv4 over IPv4 tunneling and Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed May 8 01:35:43 2019 (r347240) +++ head/sys/conf/files Wed May 8 02:32:11 2019 (r347241) @@ -4079,8 +4079,7 @@ net/if_mib.c standard net/if_spppfr.c optional sppp | netgraph_sppp net/if_spppsubr.c optional sppp | netgraph_sppp net/if_stf.c optional stf inet inet6 -net/if_tun.c optional tun -net/if_tap.c optional tap +net/if_tuntap.c optional tuntap net/if_vlan.c optional vlan net/if_vxlan.c optional vxlan inet | vxlan inet6 net/ifdi_if.m optional ether pci iflib Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Wed May 8 01:35:43 2019 (r347240) +++ head/sys/i386/conf/GENERIC Wed May 8 02:32:11 2019 (r347241) @@ -316,7 +316,7 @@ device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support device vlan # 802.1Q VLAN support -device tun # Packet tunnel. +device tuntap # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module Modified: head/sys/i386/conf/MINIMAL ============================================================================== --- head/sys/i386/conf/MINIMAL Wed May 8 01:35:43 2019 (r347240) +++ head/sys/i386/conf/MINIMAL Wed May 8 02:32:11 2019 (r347241) @@ -137,7 +137,7 @@ device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG device ether # Ethernet support device vlan # 802.1Q VLAN support -device tun # Packet tunnel. +device tuntap # Packet tunnel. device gif # IPv6 and IPv4 tunneling # The `bpf' device enables the Berkeley Packet Filter. Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Wed May 8 01:35:43 2019 (r347240) +++ head/sys/mips/conf/ERL Wed May 8 02:32:11 2019 (r347241) @@ -152,7 +152,7 @@ device loop # Network loopback device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support -device tun # Packet tunnel. +device tuntap # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Wed May 8 01:35:43 2019 (r347240) +++ head/sys/mips/conf/OCTEON1 Wed May 8 02:32:11 2019 (r347241) @@ -187,7 +187,7 @@ device loop # Network loopback device random # Entropy device device ether # Ethernet support device vlan # 802.1Q VLAN support -device tun # Packet tunnel. +device tuntap # Packet tunnel. device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed May 8 01:35:43 2019 (r347240) +++ head/sys/modules/Makefile Wed May 8 02:32:11 2019 (r347241) @@ -163,8 +163,7 @@ SUBDIR= \ if_lagg \ ${_if_ndis} \ ${_if_stf} \ - if_tap \ - if_tun \ + if_tuntap \ if_vlan \ if_vxlan \ iflib \ Added: head/sys/modules/if_tuntap/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/if_tuntap/Makefile Wed May 8 02:32:11 2019 (r347241) @@ -0,0 +1,35 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/net + +KMOD= if_tuntap +SRCS= if_tuntap.c opt_inet.h opt_inet6.h + +# Symlink for backwards compatibility with systems installed at 12.0 or older +.if ${MACHINE_CPUARCH} != "powerpc" +SYMLINKS= ${KMOD}.ko ${KMODDIR}/if_tun.ko \ + ${KMOD}.ko ${KMODDIR}/if_tap.ko +.else +# Some PPC systems use msdosfs for /boot, which can't handle links or symlinks +afterinstall: alias alias_debug +alias: .PHONY + ${INSTALL} -T release -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ + ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}/if_tun.ko + ${INSTALL} -T release -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ + ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}/if_tap.ko +.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && \ + "${MK_KERNEL_SYMBOLS}" != "no" +alias_debug: .PHONY + ${INSTALL} -T debug -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ + ${_INSTALLFLAGS} ${PROG}.debug \ + ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/if_tun.ko + ${INSTALL} -T debug -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ + ${_INSTALLFLAGS} ${PROG}.debug \ + ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/if_tap.ko +.else +alias_debug: .PHONY +.endif +.endif + + +.include Modified: head/sys/net/if_tap.h ============================================================================== --- head/sys/net/if_tap.h Wed May 8 01:35:43 2019 (r347240) +++ head/sys/net/if_tap.h Wed May 8 02:32:11 2019 (r347241) @@ -40,23 +40,21 @@ #ifndef _NET_IF_TAP_H_ #define _NET_IF_TAP_H_ -/* refer to if_tapvar.h for the softc stuff */ +#include /* maximum receive packet size (hard limit) */ #define TAPMRU 16384 -struct tapinfo { - int baudrate; /* linespeed */ - short mtu; /* maximum transmission unit */ - u_char type; /* ethernet, tokenring, etc. */ - u_char dummy; /* place holder */ -}; +#define tapinfo tuninfo -/* ioctl's for get/set debug */ -#define TAPSDEBUG _IOW('t', 90, int) -#define TAPGDEBUG _IOR('t', 89, int) -#define TAPSIFINFO _IOW('t', 91, struct tapinfo) -#define TAPGIFINFO _IOR('t', 92, struct tapinfo) +/* + * ioctl's for get/set debug; these are aliases of TUN* ioctls, see net/if_tun.h + * for details. + */ +#define TAPSDEBUG TUNSDEBUG +#define TAPGDEBUG TUNGDEBUG +#define TAPSIFINFO TUNSIFINFO +#define TAPGIFINFO TUNGIFINFO #define TAPGIFNAME _IOR('t', 93, struct ifreq) /* VMware ioctl's */ Copied and modified: head/sys/net/if_tuntap.c (from r347240, head/sys/net/if_tun.c) ============================================================================== --- head/sys/net/if_tun.c Wed May 8 01:35:43 2019 (r347240, copy source) +++ head/sys/net/if_tuntap.c Wed May 8 02:32:11 2019 (r347241) @@ -1,6 +1,36 @@ /* $NetBSD: if_tun.c,v 1.14 1994/06/29 06:36:25 cgd Exp $ */ - /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 1999-2000 by Maksim Yevmenkin + * All rights reserved. + * Copyright (c) 2019 Kyle Evans + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * BASED ON: + * ------------------------------------------------------------------------- + * * Copyright (c) 1988, Julian Onions * Nottingham University 1987. * @@ -45,9 +75,12 @@ #include #include +#include #include #include #include +#include +#include #include #include #include @@ -56,20 +89,22 @@ #include #endif #include +#include #include #include #include - #include +struct tuntap_driver; + /* * tun_list is protected by global tunmtx. Other mutable fields are * protected by tun->tun_mtx, or by their owning subsystem. tun_dev is * static for the duration of a tunnel interface. */ -struct tun_softc { - TAILQ_ENTRY(tun_softc) tun_list; +struct tuntap_softc { + TAILQ_ENTRY(tuntap_softc) tun_list; struct cdev *tun_dev; u_short tun_flags; /* misc flags */ #define TUN_OPEN 0x0001 @@ -82,60 +117,88 @@ struct tun_softc { #define TUN_ASYNC 0x0080 #define TUN_IFHEAD 0x0100 #define TUN_DYING 0x0200 +#define TUN_L2 0x0400 +#define TUN_VMNET 0x0800 #define TUN_READY (TUN_OPEN | TUN_INITED) pid_t tun_pid; /* owning pid */ struct ifnet *tun_ifp; /* the interface */ struct sigio *tun_sigio; /* information for async I/O */ + struct tuntap_driver *tun_drv; /* appropriate driver */ struct selinfo tun_rsel; /* read select */ struct mtx tun_mtx; /* protect mutable softc fields */ struct cv tun_cv; /* protect against ref'd dev destroy */ + struct ether_addr tun_ether; /* remote address */ }; #define TUN2IFP(sc) ((sc)->tun_ifp) #define TUNDEBUG if (tundebug) if_printf +#define TUN_LOCK(tp) mtx_lock(&(tp)->tun_mtx) +#define TUN_UNLOCK(tp) mtx_unlock(&(tp)->tun_mtx) + +#define TUN_VMIO_FLAG_MASK 0x0fff + /* * All mutable global variables in if_tun are locked using tunmtx, with - * the exception of tundebug, which is used unlocked, and tunclones, - * which is static after setup. + * the exception of tundebug, which is used unlocked, and the drivers' *clones, + * which are static after setup. */ static struct mtx tunmtx; static eventhandler_tag tag; static const char tunname[] = "tun"; +static const char tapname[] = "tap"; +static const char vmnetname[] = "vmnet"; static MALLOC_DEFINE(M_TUN, tunname, "Tunnel Interface"); static int tundebug = 0; static int tundclone = 1; -static struct clonedevs *tunclones; -static TAILQ_HEAD(,tun_softc) tunhead = TAILQ_HEAD_INITIALIZER(tunhead); +static int tap_allow_uopen = 0; /* allow user open() */ +static int tapuponopen = 0; /* IFF_UP on open() */ +static int tapdclone = 1; /* enable devfs cloning */ + +static TAILQ_HEAD(,tuntap_softc) tunhead = TAILQ_HEAD_INITIALIZER(tunhead); SYSCTL_INT(_debug, OID_AUTO, if_tun_debug, CTLFLAG_RW, &tundebug, 0, ""); static struct sx tun_ioctl_sx; SX_SYSINIT(tun_ioctl_sx, &tun_ioctl_sx, "tun_ioctl"); SYSCTL_DECL(_net_link); +/* tun */ static SYSCTL_NODE(_net_link, OID_AUTO, tun, CTLFLAG_RW, 0, "IP tunnel software network interface."); SYSCTL_INT(_net_link_tun, OID_AUTO, devfs_cloning, CTLFLAG_RWTUN, &tundclone, 0, "Enable legacy devfs interface creation."); +/* tap */ +static SYSCTL_NODE(_net_link, OID_AUTO, tap, CTLFLAG_RW, 0, + "Ethernet tunnel software network interface"); +SYSCTL_INT(_net_link_tap, OID_AUTO, user_open, CTLFLAG_RW, &tap_allow_uopen, 0, + "Allow user to open /dev/tap (based on node permissions)"); +SYSCTL_INT(_net_link_tap, OID_AUTO, up_on_open, CTLFLAG_RW, &tapuponopen, 0, + "Bring interface up when /dev/tap is opened"); +SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTLFLAG_RWTUN, &tapdclone, 0, + "Enable legacy devfs interface creation"); +SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tundebug, 0, ""); + +static int tuntap_name2info(const char *name, int *unit, int *flags); static void tunclone(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev); -static void tuncreate(const char *name, struct cdev *dev); +static void tuncreate(struct cdev *dev, struct tuntap_driver *); static int tunifioctl(struct ifnet *, u_long, caddr_t); static void tuninit(struct ifnet *); -static int tunmodevent(module_t, int, void *); +static void tunifinit(void *xtp); +static int tuntapmodevent(module_t, int, void *); static int tunoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *ro); static void tunstart(struct ifnet *); +static void tunstart_l2(struct ifnet *); static int tun_clone_match(struct if_clone *ifc, const char *name); +static int tap_clone_match(struct if_clone *ifc, const char *name); +static int vmnet_clone_match(struct if_clone *ifc, const char *name); static int tun_clone_create(struct if_clone *, char *, size_t, caddr_t); static int tun_clone_destroy(struct if_clone *, struct ifnet *); -static struct unrhdr *tun_unrhdr; -VNET_DEFINE_STATIC(struct if_clone *, tun_cloner); -#define V_tun_cloner VNET(tun_cloner) static d_open_t tunopen; static d_close_t tunclose; @@ -163,58 +226,241 @@ static struct filterops tun_write_filterops = { .f_event = tunkqwrite, }; -static struct cdevsw tun_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_NEEDMINOR, - .d_open = tunopen, - .d_close = tunclose, - .d_read = tunread, - .d_write = tunwrite, - .d_ioctl = tunioctl, - .d_poll = tunpoll, - .d_kqfilter = tunkqfilter, - .d_name = tunname, +#define TUN_DRIVER_IDENT_MASK (TUN_L2 | TUN_VMNET) + +static struct tuntap_driver { + int tun_flags; + struct unrhdr *unrhdr; + struct cdevsw cdevsw; + struct clonedevs *clones; + ifc_match_t *clone_match_fn; + ifc_create_t *clone_create_fn; + ifc_destroy_t *clone_destroy_fn; +} tuntap_drivers[] = { + { + .tun_flags = 0, + .cdevsw = { + .d_version = D_VERSION, + .d_flags = D_NEEDMINOR, + .d_open = tunopen, + .d_close = tunclose, + .d_read = tunread, + .d_write = tunwrite, + .d_ioctl = tunioctl, + .d_poll = tunpoll, + .d_kqfilter = tunkqfilter, + .d_name = tunname, + }, + .clone_match_fn = tun_clone_match, + .clone_create_fn = tun_clone_create, + .clone_destroy_fn = tun_clone_destroy, + }, + { + .tun_flags = TUN_L2, + .cdevsw = { + .d_version = D_VERSION, + .d_flags = D_NEEDMINOR, + .d_open = tunopen, + .d_close = tunclose, + .d_read = tunread, + .d_write = tunwrite, + .d_ioctl = tunioctl, + .d_poll = tunpoll, + .d_kqfilter = tunkqfilter, + .d_name = tapname, + }, + .clone_match_fn = tap_clone_match, + .clone_create_fn = tun_clone_create, + .clone_destroy_fn = tun_clone_destroy, + }, + { + .tun_flags = TUN_L2 | TUN_VMNET, + .cdevsw = { + .d_version = D_VERSION, + .d_flags = D_NEEDMINOR, + .d_open = tunopen, + .d_close = tunclose, + .d_read = tunread, + .d_write = tunwrite, + .d_ioctl = tunioctl, + .d_poll = tunpoll, + .d_kqfilter = tunkqfilter, + .d_name = vmnetname, + }, + .clone_match_fn = vmnet_clone_match, + .clone_create_fn = tun_clone_create, + .clone_destroy_fn = tun_clone_destroy, + }, }; +struct tuntap_driver_cloner { + SLIST_ENTRY(tuntap_driver_cloner) link; + struct tuntap_driver *drv; + struct if_clone *cloner; +}; + +VNET_DEFINE_STATIC(SLIST_HEAD(, tuntap_driver_cloner), tuntap_driver_cloners) = + SLIST_HEAD_INITIALIZER(tuntap_driver_cloners); + +#define V_tuntap_driver_cloners VNET(tuntap_driver_cloners) + +/* + * Sets unit and/or flags given the device name. Must be called with correct + * vnet context. + */ static int +tuntap_name2info(const char *name, int *outunit, int *outflags) +{ + struct tuntap_driver *drv; + struct tuntap_driver_cloner *drvc; + char *dname; + int flags, unit; + bool found; + + if (name == NULL) + return (EINVAL); + + /* + * Needed for dev_stdclone, but dev_stdclone will not modify, it just + * wants to be able to pass back a char * through the second param. We + * will always set that as NULL here, so we'll fake it. + */ + dname = __DECONST(char *, name); + found = false; + + KASSERT(!SLIST_EMPTY(&V_tuntap_driver_cloners), + ("tuntap_driver_cloners failed to initialize")); + SLIST_FOREACH(drvc, &V_tuntap_driver_cloners, link) { + KASSERT(drvc->drv != NULL, + ("tuntap_driver_cloners entry not properly initialized")); + drv = drvc->drv; + + if (strcmp(name, drv->cdevsw.d_name) == 0) { + found = true; + unit = -1; + flags = drv->tun_flags; + break; + } + + if (dev_stdclone(dname, NULL, drv->cdevsw.d_name, &unit) == 1) { + found = true; + flags = drv->tun_flags; + break; + } + } + + if (!found) + return (ENXIO); + + if (outunit != NULL) + *outunit = unit; + if (outflags != NULL) + *outflags = flags; + return (0); +} + +/* + * Get driver information from a set of flags specified. Masks the identifying + * part of the flags and compares it against all of the available + * tuntap_drivers. Must be called with correct vnet context. + */ +static struct tuntap_driver * +tuntap_driver_from_flags(int tun_flags) +{ + struct tuntap_driver *drv; + struct tuntap_driver_cloner *drvc; + + KASSERT(!SLIST_EMPTY(&V_tuntap_driver_cloners), + ("tuntap_driver_cloners failed to initialize")); + SLIST_FOREACH(drvc, &V_tuntap_driver_cloners, link) { + KASSERT(drvc->drv != NULL, + ("tuntap_driver_cloners entry not properly initialized")); + drv = drvc->drv; + if ((tun_flags & TUN_DRIVER_IDENT_MASK) == drv->tun_flags) + return (drv); + } + + return (NULL); +} + + + +static int tun_clone_match(struct if_clone *ifc, const char *name) { - if (strncmp(tunname, name, 3) == 0 && - (name[3] == '\0' || isdigit(name[3]))) - return (1); + int tunflags; + if (tuntap_name2info(name, NULL, &tunflags) == 0) { + if ((tunflags & TUN_L2) == 0) + return (1); + } + return (0); } static int +tap_clone_match(struct if_clone *ifc, const char *name) +{ + int tunflags; + + if (tuntap_name2info(name, NULL, &tunflags) == 0) { + if ((tunflags & (TUN_L2 | TUN_VMNET)) == TUN_L2) + return (1); + } + + return (0); +} + +static int +vmnet_clone_match(struct if_clone *ifc, const char *name) +{ + int tunflags; + + if (tuntap_name2info(name, NULL, &tunflags) == 0) { + if ((tunflags & TUN_VMNET) != 0) + return (1); + } + + return (0); +} + +static int tun_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) { + struct tuntap_driver *drv; struct cdev *dev; - int err, unit, i; + int err, i, tunflags, unit; - err = ifc_name2unit(name, &unit); + tunflags = 0; + /* The name here tells us exactly what we're creating */ + err = tuntap_name2info(name, &unit, &tunflags); if (err != 0) return (err); + drv = tuntap_driver_from_flags(tunflags); + if (drv == NULL) + return (ENXIO); + if (unit != -1) { /* If this unit number is still available that/s okay. */ - if (alloc_unr_specific(tun_unrhdr, unit) == -1) + if (alloc_unr_specific(drv->unrhdr, unit) == -1) return (EEXIST); } else { - unit = alloc_unr(tun_unrhdr); + unit = alloc_unr(drv->unrhdr); } - snprintf(name, IFNAMSIZ, "%s%d", tunname, unit); + snprintf(name, IFNAMSIZ, "%s%d", drv->cdevsw.d_name, unit); /* find any existing device, or allocate new unit number */ - i = clone_create(&tunclones, &tun_cdevsw, &unit, &dev, 0); + i = clone_create(&drv->clones, &drv->cdevsw, &unit, &dev, 0); if (i) { /* No preexisting struct cdev *, create one */ - dev = make_dev(&tun_cdevsw, unit, - UID_UUCP, GID_DIALER, 0600, "%s%d", tunname, unit); + dev = make_dev(&drv->cdevsw, unit, UID_UUCP, GID_DIALER, 0600, + "%s%d", drv->cdevsw.d_name, unit); } - tuncreate(tunname, dev); + tuncreate(dev, drv); + return (0); } @@ -223,33 +469,47 @@ tunclone(void *arg, struct ucred *cred, char *name, in struct cdev **dev) { char devname[SPECNAMELEN + 1]; - int u, i, append_unit; + struct tuntap_driver *drv; + int append_unit, i, u, tunflags; + bool mayclone; if (*dev != NULL) return; + tunflags = 0; + CURVNET_SET(CRED_TO_VNET(cred)); + if (tuntap_name2info(name, &u, &tunflags) != 0) + goto out; /* Not recognized */ + + if (u != -1 && u > IF_MAXUNIT) + goto out; /* Unit number too high */ + + mayclone = priv_check_cred(cred, PRIV_NET_IFCREATE) == 0; + if ((tunflags & TUN_L2) != 0) { + /* tap/vmnet allow user open with a sysctl */ + mayclone = (mayclone || tap_allow_uopen) && tapdclone; + } else { + mayclone = mayclone && tundclone; + } + /* * If tun cloning is enabled, only the superuser can create an * interface. */ - if (!tundclone || priv_check_cred(cred, PRIV_NET_IFCREATE) != 0) - return; + if (!mayclone) + goto out; - if (strcmp(name, tunname) == 0) { - u = -1; - } else if (dev_stdclone(name, NULL, tunname, &u) != 1) - return; /* Don't recognise the name */ - if (u != -1 && u > IF_MAXUNIT) - return; /* Unit number too high */ - if (u == -1) append_unit = 1; else append_unit = 0; - CURVNET_SET(CRED_TO_VNET(cred)); + drv = tuntap_driver_from_flags(tunflags); + if (drv == NULL) + goto out; + /* find any existing device, or allocate new unit number */ - i = clone_create(&tunclones, &tun_cdevsw, &u, dev, 0); + i = clone_create(&drv->clones, &drv->cdevsw, &u, dev, 0); if (i) { if (append_unit) { namelen = snprintf(devname, sizeof(devname), "%s%d", @@ -257,25 +517,26 @@ tunclone(void *arg, struct ucred *cred, char *name, in name = devname; } /* No preexisting struct cdev *, create one */ - *dev = make_dev_credf(MAKEDEV_REF, &tun_cdevsw, u, cred, + *dev = make_dev_credf(MAKEDEV_REF, &drv->cdevsw, u, cred, UID_UUCP, GID_DIALER, 0600, "%s", name); } if_clone_create(name, namelen, NULL); +out: CURVNET_RESTORE(); } static void -tun_destroy(struct tun_softc *tp) +tun_destroy(struct tuntap_softc *tp) { struct cdev *dev; - mtx_lock(&tp->tun_mtx); + TUN_LOCK(tp); tp->tun_flags |= TUN_DYING; if ((tp->tun_flags & TUN_OPEN) != 0) cv_wait_unlock(&tp->tun_cv, &tp->tun_mtx); else - mtx_unlock(&tp->tun_mtx); + TUN_UNLOCK(tp); CURVNET_SET(TUN2IFP(tp)->if_vnet); sx_xlock(&tun_ioctl_sx); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 8 03:15:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70617159B88F; Wed, 8 May 2019 03:15:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16D4B888BE; Wed, 8 May 2019 03:15:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E541827C91; Wed, 8 May 2019 03:15:22 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x483FMlP012058; Wed, 8 May 2019 03:15:22 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x483FM97012057; Wed, 8 May 2019 03:15:22 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905080315.x483FM97012057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 8 May 2019 03:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347242 - head/sys/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/ofw X-SVN-Commit-Revision: 347242 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16D4B888BE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 03:15:23 -0000 Author: jhibbits Date: Wed May 8 03:15:22 2019 New Revision: 347242 URL: https://svnweb.freebsd.org/changeset/base/347242 Log: powerpc: hide innocuous printf behind bootverbose NUMA associativity, and OFW node existence, is completely optional, and shouldn't warn always. Modified: head/sys/powerpc/ofw/ofw_pcibus.c Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Wed May 8 02:32:11 2019 (r347241) +++ head/sys/powerpc/ofw/ofw_pcibus.c Wed May 8 03:15:22 2019 (r347242) @@ -393,7 +393,8 @@ ofw_pcibus_parse_associativity(device_t dev, int *doma int res; if ((node = ofw_bus_get_node(dev)) == -1) { - device_printf(dev, "no ofw node found\n"); + if (bootverbose) + device_printf(dev, "no ofw node found\n"); return (ENXIO); } res = OF_getproplen(node, "ibm,associativity"); From owner-svn-src-all@freebsd.org Wed May 8 03:46:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED5A7159C771; Wed, 8 May 2019 03:46:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81752899DA; Wed, 8 May 2019 03:46:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f49.google.com with SMTP id u2so12545495ioc.4; Tue, 07 May 2019 20:46:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=5bqf4D8rAkq5qw9Mt1nNdVrw//QS+95fvCHkuz1vaug=; b=tJW/aYYOFjuzlOWdSUTU5F4GRXwJiMaM9GvW78o4bXsVn7rC6/lp2Z1e8h7yEf16Q0 I3iJpLIuUc16oB5DgK5sts9jLkWPPR3djfCI+LGKNz2Eflh/uwQGhwxmHIPYhNyj7GGS 5mokQKJ15QbSgX54R0oSWMdpUTjoKzfBBanwyjOyAVwZ+uvXZ1P+ubZzDuJwgqmr056a YKm6FyNpyTUmgJMj34yQfmHur7/TFbs9ubkpHIFKefDr45rfSO84xWH52usVHLnoNRrw RFSLzpHGw+KsMDNurdv0btt+8swQx/dGWSvxmUvUDQ4oQqWrt89SgEOkX+WcQi5/T8XW D4Gg== X-Gm-Message-State: APjAAAXlUlpH3kjyr/CMso8dNpLIABUCZP2RSjbTdLt8xaf993GbTo24 fy8YrLbxF/hwFB4cqYMsBQ2LRG20 X-Google-Smtp-Source: APXvYqyFRHMEc1ZfYCHEZWryZrF3Tv5hdjVydpu4bOFuKUwAhkwQGKSEZzhmhutP8aFEKN3D4fRqkQ== X-Received: by 2002:a6b:ef07:: with SMTP id k7mr12841225ioh.276.1557286748533; Tue, 07 May 2019 20:39:08 -0700 (PDT) Received: from mail-it1-f172.google.com (mail-it1-f172.google.com. [209.85.166.172]) by smtp.gmail.com with ESMTPSA id g4sm5634116ioa.21.2019.05.07.20.39.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 20:39:08 -0700 (PDT) Received: by mail-it1-f172.google.com with SMTP id p18so1197064itm.1; Tue, 07 May 2019 20:39:08 -0700 (PDT) X-Received: by 2002:a24:65cf:: with SMTP id u198mr1710644itb.32.1557286748223; Tue, 07 May 2019 20:39:08 -0700 (PDT) MIME-Version: 1.0 References: <201905070828.x478SZ3t019398@repo.freebsd.org> In-Reply-To: <201905070828.x478SZ3t019398@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 7 May 2019 20:38:57 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347221 - head/sys/net To: Marius Strobl Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 81752899DA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 03:46:01 -0000 Hi Marius, This change seems to break LINT-NOIP tinderbox builds; one reference to tcp_lro_free() is covered by #if defined(INET) || defined(INET6), but the one added in iflib_rx_structures_free() is not. On Tue, May 7, 2019 at 1:28 AM Marius Strobl wrote: > > Author: marius > Date: Tue May 7 08:28:35 2019 > New Revision: 347221 > URL: https://svnweb.freebsd.org/changeset/base/347221 > ... > Modified: head/sys/net/iflib.c > ============================================================================== > --- head/sys/net/iflib.c Tue May 7 08:14:30 2019 (r347220) > +++ head/sys/net/iflib.c Tue May 7 08:28:35 2019 (r347221) > ... The one below is protected by INET or INET6 define: > @@ -5627,14 +5668,14 @@ iflib_rx_structures_setup(if_ctx_t ctx) > #if defined(INET6) || defined(INET) <<<< > fail: > /* > - * Free RX software descriptors allocated so far, we will only handle > + * Free LRO resources allocated so far, we will only handle > * the rings that completed, the failing case will have > - * cleaned up for itself. 'q' failed, so its the terminus. > + * cleaned up for itself. 'q' failed, so its the terminus. > */ > rxq = ctx->ifc_rxqs; > for (i = 0; i < q; ++i, rxq++) { > - iflib_rx_sds_free(rxq); > - rxq->ifr_cq_cidx = 0; > + if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) > + tcp_lro_free(&rxq->ifr_lc); <<< > } > return (err); > #endif <<< But the following one is not: > @@ -5649,9 +5690,12 @@ static void > iflib_rx_structures_free(if_ctx_t ctx) > { > iflib_rxq_t rxq = ctx->ifc_rxqs; > + int i; > > - for (int i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { > + for (i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { > iflib_rx_sds_free(rxq); > + if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) > + tcp_lro_free(&rxq->ifr_lc); ^^^^^^^ > } > free(ctx->ifc_rxqs, M_IFLIB); > ctx->ifc_rxqs = NULL; This fails to compile on kernels without INET and INET6 (which is something we still support, for reasons I cannot fathom) because netinet/tcp_lro.c is conditional on option inet | inet6 in sys/conf/files. Best, Conrad From owner-svn-src-all@freebsd.org Wed May 8 05:45:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72835159E899; Wed, 8 May 2019 05:45:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15D498C915; Wed, 8 May 2019 05:45:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E336D1667; Wed, 8 May 2019 05:45:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x485j0JE089962; Wed, 8 May 2019 05:45:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x485j074089961; Wed, 8 May 2019 05:45:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201905080545.x485j074089961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 8 May 2019 05:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347243 - head/contrib/llvm/lib/Target/ARM X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Target/ARM X-SVN-Commit-Revision: 347243 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 15D498C915 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 05:45:01 -0000 Author: dim Date: Wed May 8 05:45:00 2019 New Revision: 347243 URL: https://svnweb.freebsd.org/changeset/base/347243 Log: Pull in r360099 from upstream llvm trunk (by Eli Friedman): [ARM] Glue register copies to tail calls. This generally follows what other targets do. I don't completely understand why the special case for tail calls existed in the first place; even when the code was committed in r105413, call lowering didn't work in the way described in the comments. Stack protector lowering breaks if the register copies are not glued to a tail call: we have to insert the stack protector check before the tail call, and we choose the location based on the assumption that all physical register dependencies of a tail call are adjacent to the tail call. (See FindSplitPointForStackProtector.) This is sort of fragile, but I don't see any reason to break that assumption. I'm guessing nobody has seen this before just because it's hard to convince the scheduler to actually schedule the code in a way that breaks; even without the glue, the only computation that could actually be scheduled after the register copies is the computation of the call address, and the scheduler usually prefers to schedule that before the copies anyway. Fixes https://bugs.llvm.org/show_bug.cgi?id=41417 Differential Revision: https://reviews.llvm.org/D60427 This should fix several instances of "Bad machine code: Using an undefined physical register", when compiling ports such as multimedia/vlc, audio/alsa-lib and devel/avro-c for armv6, with -fstack-protector-strong. Reported by: jbeich PR: 237074, 237783, 237784 MFC after: 3 days Modified: head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Modified: head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Wed May 8 03:15:22 2019 (r347242) +++ head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Wed May 8 05:45:00 2019 (r347243) @@ -1984,32 +1984,10 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLower // Build a sequence of copy-to-reg nodes chained together with token chain // and flag operands which copy the outgoing args into the appropriate regs. SDValue InFlag; - // Tail call byval lowering might overwrite argument registers so in case of - // tail call optimization the copies to registers are lowered later. - if (!isTailCall) - for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) { - Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first, - RegsToPass[i].second, InFlag); - InFlag = Chain.getValue(1); - } - - // For tail calls lower the arguments to the 'real' stack slot. - if (isTailCall) { - // Force all the incoming stack arguments to be loaded from the stack - // before any new outgoing arguments are stored to the stack, because the - // outgoing stack slots may alias the incoming argument stack slots, and - // the alias isn't otherwise explicit. This is slightly more conservative - // than necessary, because it means that each store effectively depends - // on every argument instead of just those arguments it would clobber. - - // Do not flag preceding copytoreg stuff together with the following stuff. - InFlag = SDValue(); - for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) { - Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first, - RegsToPass[i].second, InFlag); - InFlag = Chain.getValue(1); - } - InFlag = SDValue(); + for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) { + Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first, + RegsToPass[i].second, InFlag); + InFlag = Chain.getValue(1); } // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every From owner-svn-src-all@freebsd.org Wed May 8 08:18:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DD8B15A167A; Wed, 8 May 2019 08:18:09 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0E679115C; Wed, 8 May 2019 08:18:08 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D55DF260321; Wed, 8 May 2019 10:18:00 +0200 (CEST) Subject: Re: svn commit: r346645 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys To: Tycho Nightingale , cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head References: <201904242030.x3OKUkgN073331@repo.freebsd.org> <6991C64C-D105-423F-B66A-4E2B2924565F@freebsd.org> From: Hans Petter Selasky Message-ID: <423baa57-2433-c300-c4a5-c60e64ba664b@selasky.org> Date: Wed, 8 May 2019 10:17:32 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <6991C64C-D105-423F-B66A-4E2B2924565F@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0E679115C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.919,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 08:18:09 -0000 On 2019-05-08 03:24, Tycho Nightingale wrote: > > Hi, > >> On May 7, 2019, at 9:13 PM, Conrad Meyer wrote: >> >> Hi Tycho, >> >> On Wed, Apr 24, 2019 at 1:31 PM Tycho Nightingale wrote: >>> >>> Author: tychon >>> Date: Wed Apr 24 20:30:45 2019 >>> New Revision: 346645 >>> URL: https://svnweb.freebsd.org/changeset/base/346645 >>> >>> Log: >>> LinuxKPI should use bus_dma(9) to be compatible with an IOMMU >>> >>> Reviewed by: hselasky, kib >>> Tested by: greg@unrelenting.technology >>> Sponsored by: Dell EMC Isilon >>> Differential Revision: https://reviews.freebsd.org/D19845 >>> ... >>> Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c >>> ============================================================================== >>> --- head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 19:56:02 2019 (r346644) >>> +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Wed Apr 24 20:30:45 2019 (r346645) >>> ... >>> +linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) >>> +{ >>> ... >>> + nseg = -1; >>> + mtx_lock(&priv->dma_lock); >>> + if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, phys, len, >>> + BUS_DMA_NOWAIT, &seg, &nseg) != 0) { >>> + bus_dmamap_destroy(priv->dmat, obj->dmamap); >>> + mtx_unlock(&priv->dma_lock); >>> + uma_zfree(linux_dma_obj_zone, obj); >>> + return (0); >>> + } >>> + mtx_unlock(&priv->dma_lock); >>> + >>> + KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg)); >> >> This construct is a bit odd. Coverity produces the (perhaps spurious) >> warning (CID 1401319) that the KASSERT (which can be compiled out in >> !INVARIANTS builds) has a side effect (++nseg). While true, nseg is >> never used afterwards, so perhaps we can use the equivalent expression >> with no side effect instead? I.e., something like: >> >> KASSERT(nseg == 0, ("More than one segment (nseg=%d)", nseg + 1)); >> >> Does that make sense? It is a false positive of sorts, but performing >> side effects in compiled-out assert is a pretty strong antipattern so >> I'd just as soon "fix" the warning. > > The construct is indeed a little odd and mimics how other callers of _bus_dmamap_load_phys() handle the bizarre way nseg is treated. There isn’t any reason for it and in hindsight I prefer your version — especially if it eliminates this Coverity issue. > > Tycho > I believe I already changed those asserts to what was suggested. See later commits on the same file. --HPS From owner-svn-src-all@freebsd.org Wed May 8 08:43:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A4D415A1F4F; Wed, 8 May 2019 08:43:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 102B791FC5; Wed, 8 May 2019 08:43:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C37BE34A5; Wed, 8 May 2019 08:43:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x488hGWv084984; Wed, 8 May 2019 08:43:16 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x488hGtd084981; Wed, 8 May 2019 08:43:16 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905080843.x488hGtd084981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 8 May 2019 08:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347244 - in head: contrib/zlib lib/libz stand/libsa sys/contrib/zlib usr.bin/minigzip X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: contrib/zlib lib/libz stand/libsa sys/contrib/zlib usr.bin/minigzip X-SVN-Commit-Revision: 347244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 102B791FC5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 08:43:17 -0000 Author: delphij Date: Wed May 8 08:43:15 2019 New Revision: 347244 URL: https://svnweb.freebsd.org/changeset/base/347244 Log: Move contrib/zlib to sys/contrib/zlib so that we can use it in kernel. This is a prerequisite of unifying kernel zlib instances. Submitted by: Yoshihiro Ota MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20191 Added: head/sys/contrib/zlib/ - copied from r347243, head/contrib/zlib/ Deleted: head/contrib/zlib/ Modified: head/lib/libz/FREEBSD-upgrade head/lib/libz/Makefile head/stand/libsa/Makefile head/usr.bin/minigzip/Makefile Modified: head/lib/libz/FREEBSD-upgrade ============================================================================== --- head/lib/libz/FREEBSD-upgrade Wed May 8 05:45:00 2019 (r347243) +++ head/lib/libz/FREEBSD-upgrade Wed May 8 08:43:15 2019 (r347244) @@ -8,7 +8,7 @@ benefit other consumers. To Update: 1) Unpack vendor sources into a clean directory. 2) Import onto the vendor area. - 3) Merge the vendor tree to contrib/zlib, which contains a stripped down + 3) Merge the vendor tree to sys/contrib/zlib, which contains a stripped down version of upstream source, resolve any conflicts. 4) Double check zconf.h, zlib.pc, and Symbol.map to make sure that we have the required changes. Test universe and commit them. Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Wed May 8 05:45:00 2019 (r347243) +++ head/lib/libz/Makefile Wed May 8 08:43:15 2019 (r347244) @@ -9,7 +9,7 @@ SHLIB_MAJOR= 6 MAN= zlib.3 zopen.3 MLINKS+= zopen.3 zdopen.3 -ZLIBSRC= ${SRCTOP}/contrib/zlib +ZLIBSRC= ${SRCTOP}/sys/contrib/zlib .PATH: ${ZLIBSRC} Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Wed May 8 05:45:00 2019 (r347243) +++ head/stand/libsa/Makefile Wed May 8 08:43:15 2019 (r347244) @@ -99,8 +99,8 @@ CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS SRCS+=bzlib.c crctable.c decompress.c huffman.c randtable.c # decompression functionality from zlib -.PATH: ${SRCTOP}/contrib/zlib -CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/contrib/zlib +.PATH: ${SRCTOP}/sys/contrib/zlib +CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib SRCS+= adler32.c crc32.c SRCS+= infback.c inffast.c inflate.c inftrees.c zutil.c Modified: head/usr.bin/minigzip/Makefile ============================================================================== --- head/usr.bin/minigzip/Makefile Wed May 8 05:45:00 2019 (r347243) +++ head/usr.bin/minigzip/Makefile Wed May 8 08:43:15 2019 (r347244) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCDIR= ${SRCTOP}/contrib/zlib/test +SRCDIR= ${SRCTOP}/sys/contrib/zlib/test .PATH: ${SRCDIR} PROG= minigzip From owner-svn-src-all@freebsd.org Wed May 8 09:03:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A9F815A29EA; Wed, 8 May 2019 09:03:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B251892BD6; Wed, 8 May 2019 09:03:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AAB239E1; Wed, 8 May 2019 09:03:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4893hjJ095874; Wed, 8 May 2019 09:03:43 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4893hlr095873; Wed, 8 May 2019 09:03:43 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201905080903.x4893hlr095873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 8 May 2019 09:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347245 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B251892BD6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 09:03:44 -0000 Author: marius Date: Wed May 8 09:03:43 2019 New Revision: 347245 URL: https://svnweb.freebsd.org/changeset/base/347245 Log: Allow to build without INET and INET6 again after r347221. Submitted by: cam Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed May 8 08:43:15 2019 (r347244) +++ head/sys/net/iflib.c Wed May 8 09:03:43 2019 (r347245) @@ -5694,8 +5694,10 @@ iflib_rx_structures_free(if_ctx_t ctx) for (i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { iflib_rx_sds_free(rxq); +#if defined(INET6) || defined(INET) if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) tcp_lro_free(&rxq->ifr_lc); +#endif } free(ctx->ifc_rxqs, M_IFLIB); ctx->ifc_rxqs = NULL; From owner-svn-src-all@freebsd.org Wed May 8 09:08:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29DDF15A2AB4; Wed, 8 May 2019 09:08:39 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F58892D7D; Wed, 8 May 2019 09:08:38 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [IPv6:2a02:c6a0:4015:12:a8fd:d6b7:ed6e:501] (unknown [IPv6:2a02:c6a0:4015:12:a8fd:d6b7:ed6e:501]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 4FFEA721E280D; Wed, 8 May 2019 11:08:34 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r347239 - head/sys/dev/random From: Michael Tuexen In-Reply-To: <201905080045.x480jGpo032140@repo.freebsd.org> Date: Wed, 8 May 2019 11:08:33 +0200 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <21F2F871-42E2-4572-97ED-C50CD00F9FC0@freebsd.org> References: <201905080045.x480jGpo032140@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3445.104.8) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 09:08:39 -0000 > On 8. May 2019, at 02:45, Conrad Meyer wrote: >=20 > Author: cem > Date: Wed May 8 00:45:16 2019 > New Revision: 347239 > URL: https://svnweb.freebsd.org/changeset/base/347239 >=20 > Log: > random: x86 driver: Prefer RDSEED over RDRAND when available I get a lot of random_sources_feed: rs_read for hardware device 'Intel Secure Key RNG' = returned no entropy. entries in /var/log/messages now... Any idea how to turn them off? Best regards Michael >=20 > Per > = https://software.intel.com/en-us/blogs/2012/11/17/the-difference-between-r= drand-and-rdseed > , RDRAND is a PRNG seeded from the same source as RDSEED. The source = is > more suitable as PRNG seed material, so prefer it when the RDSEED = intrinsic > is available (indicated in CPU feature bits). >=20 > Reviewed by: delphij, jhb, imp (earlier version) > Approved by: secteam(delphij) > Security: yes > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D20192 >=20 > Modified: > head/sys/dev/random/ivy.c >=20 > Modified: head/sys/dev/random/ivy.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/random/ivy.c Wed May 8 00:40:08 2019 = (r347238) > +++ head/sys/dev/random/ivy.c Wed May 8 00:45:16 2019 = (r347239) > @@ -44,11 +44,13 @@ __FBSDID("$FreeBSD$"); >=20 > #include > #include > +#include >=20 > #include >=20 > #define RETRY_COUNT 10 >=20 > +static bool has_rdrand, has_rdseed; > static u_int random_ivy_read(void *, u_int); >=20 > static struct random_source random_ivy =3D { > @@ -57,10 +59,9 @@ static struct random_source random_ivy =3D { > .rs_read =3D random_ivy_read > }; >=20 > -static inline int > -ivy_rng_store(u_long *buf) > +static int > +x86_rdrand_store(u_long *buf) > { > -#ifdef __GNUCLIKE_ASM > u_long rndval; > int retry; >=20 > @@ -75,11 +76,40 @@ ivy_rng_store(u_long *buf) > : "+r" (retry), "=3Dr" (rndval) : : "cc"); > *buf =3D rndval; > return (retry); > -#else /* __GNUCLIKE_ASM */ > - return (0); > -#endif > } >=20 > +static int > +x86_rdseed_store(u_long *buf) > +{ > + u_long rndval; > + int retry; > + > + retry =3D RETRY_COUNT; > + __asm __volatile( > + "1:\n\t" > + "rdseed %1\n\t" /* read randomness into rndval */ > + "jc 2f\n\t" /* CF is set on success, exit retry loop = */ > + "dec %0\n\t" /* otherwise, retry-- */ > + "jne 1b\n\t" /* and loop if retries are not exhausted = */ > + "2:" > + : "+r" (retry), "=3Dr" (rndval) : : "cc"); > + *buf =3D rndval; > + return (retry); > +} > + > +DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static) > +{ > + has_rdrand =3D (cpu_feature2 & CPUID2_RDRAND); > + has_rdseed =3D (cpu_stdext_feature & CPUID_STDEXT_RDSEED); > + > + if (has_rdseed) > + return (x86_rdseed_store); > + else if (has_rdrand) > + return (x86_rdrand_store); > + else > + return (NULL); > +} > + > /* It is required that buf length is a multiple of sizeof(u_long). */ > static u_int > random_ivy_read(void *buf, u_int c) > @@ -90,7 +120,7 @@ random_ivy_read(void *buf, u_int c) > KASSERT(c % sizeof(*b) =3D=3D 0, ("partial read %d", c)); > b =3D buf; > for (count =3D c; count > 0; count -=3D sizeof(*b)) { > - if (ivy_rng_store(&rndval) =3D=3D 0) > + if (x86_rng_store(&rndval) =3D=3D 0) > break; > *b++ =3D rndval; > } > @@ -104,14 +134,14 @@ rdrand_modevent(module_t mod, int type, void = *unused) >=20 > switch (type) { > case MOD_LOAD: > - if (cpu_feature2 & CPUID2_RDRAND) { > + if (has_rdrand || has_rdseed) { > random_source_register(&random_ivy); > printf("random: fast provider: \"%s\"\n", = random_ivy.rs_ident); > } > break; >=20 > case MOD_UNLOAD: > - if (cpu_feature2 & CPUID2_RDRAND) > + if (has_rdrand || has_rdseed) > random_source_deregister(&random_ivy); > break; >=20 >=20 From owner-svn-src-all@freebsd.org Wed May 8 09:33:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D24615A312B; Wed, 8 May 2019 09:33:44 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D1F85939EE; Wed, 8 May 2019 09:33:43 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id x4897FfC096927 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 8 May 2019 11:07:15 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id x4897Fd3096926; Wed, 8 May 2019 11:07:15 +0200 (CEST) (envelope-from marius) Date: Wed, 8 May 2019 11:07:15 +0200 From: Marius Strobl To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r347221 - head/sys/net Message-ID: <20190508090715.GN6782@alchemy.franken.de> References: <201905070828.x478SZ3t019398@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (alchemy.franken.de [0.0.0.0]); Wed, 08 May 2019 11:07:15 +0200 (CEST) X-Rspamd-Queue-Id: D1F85939EE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 09:33:44 -0000 On Tue, May 07, 2019 at 08:38:57PM -0700, Conrad Meyer wrote: > Hi Marius, > > This change seems to break LINT-NOIP tinderbox builds; one reference > to tcp_lro_free() is covered by #if defined(INET) || defined(INET6), > but the one added in iflib_rx_structures_free() is not. Ah, thanks for the hint! Marius From owner-svn-src-all@freebsd.org Wed May 8 10:23:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEE6B15A3ED4; Wed, 8 May 2019 10:23:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FD689507B; Wed, 8 May 2019 10:23:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4026E4887; Wed, 8 May 2019 10:23:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48ANZcO038778; Wed, 8 May 2019 10:23:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48ANXcU038769; Wed, 8 May 2019 10:23:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081023.x48ANXcU038769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347246 - in head/sys: compat/linuxkpi/common/include/linux conf dev/mlx5/mlx5_en modules/mlx5en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux conf dev/mlx5/mlx5_en modules/mlx5en X-SVN-Commit-Revision: 347246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FD689507B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:23:36 -0000 Author: hselasky Date: Wed May 8 10:23:33 2019 New Revision: 347246 URL: https://svnweb.freebsd.org/changeset/base/347246 Log: Add support for Dynamic Interrupt Moderation, DIM, in mlx5en(4). Add support for DIM based on Linux, with some minor adaptions specific to FreeBSD. Linux commit f97c3dc3c0e8d23a5c4357d182afeef4c67f5c33 MFC after: 3 days Sponsored by: Mellanox Technologies Added: head/sys/compat/linuxkpi/common/include/linux/net_dim.h (contents, props changed) head/sys/dev/mlx5/mlx5_en/mlx5_en_dim.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c head/sys/modules/mlx5en/Makefile Added: head/sys/compat/linuxkpi/common/include/linux/net_dim.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/net_dim.h Wed May 8 10:23:33 2019 (r347246) @@ -0,0 +1,410 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * + * Copyright (c) 2016, Mellanox Technologies. All rights reserved. + * Copyright (c) 2017-2018, Broadcom Limited. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $FreeBSD$ + */ + +/* This file implements Dynamic Interrupt Moderation, DIM */ + +#ifndef NET_DIM_H +#define NET_DIM_H + +#include + +#include +#include + +struct net_dim_cq_moder { + u16 usec; + u16 pkts; + u8 cq_period_mode; +}; + +struct net_dim_sample { + ktime_t time; + u32 pkt_ctr; + u32 byte_ctr; + u16 event_ctr; +}; + +struct net_dim_stats { + int ppms; /* packets per msec */ + int bpms; /* bytes per msec */ + int epms; /* events per msec */ +}; + +struct net_dim { /* Adaptive Moderation */ + u8 state; + struct net_dim_stats prev_stats; + struct net_dim_sample start_sample; + struct work_struct work; + u16 event_ctr; + u8 profile_ix; + u8 mode; + u8 tune_state; + u8 steps_right; + u8 steps_left; + u8 tired; +}; + +enum { + NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE = 0x0, + NET_DIM_CQ_PERIOD_MODE_START_FROM_CQE = 0x1, + NET_DIM_CQ_PERIOD_NUM_MODES = 0x2, + NET_DIM_CQ_PERIOD_MODE_DISABLED = 0xFF, +}; + +/* Adaptive moderation logic */ +enum { + NET_DIM_START_MEASURE, + NET_DIM_MEASURE_IN_PROGRESS, + NET_DIM_APPLY_NEW_PROFILE, +}; + +enum { + NET_DIM_PARKING_ON_TOP, + NET_DIM_PARKING_TIRED, + NET_DIM_GOING_RIGHT, + NET_DIM_GOING_LEFT, +}; + +enum { + NET_DIM_STATS_WORSE, + NET_DIM_STATS_SAME, + NET_DIM_STATS_BETTER, +}; + +enum { + NET_DIM_STEPPED, + NET_DIM_TOO_TIRED, + NET_DIM_ON_EDGE, +}; + +#define NET_DIM_PARAMS_NUM_PROFILES 5 +/* Adaptive moderation profiles */ +#define NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE 256 +#define NET_DIM_DEF_PROFILE_CQE 1 +#define NET_DIM_DEF_PROFILE_EQE 1 + +/* All profiles sizes must be NET_PARAMS_DIM_NUM_PROFILES */ +#define NET_DIM_EQE_PROFILES { \ + {1, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \ + {8, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \ + {64, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \ + {128, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \ + {256, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \ +} + +#define NET_DIM_CQE_PROFILES { \ + {2, 256}, \ + {8, 128}, \ + {16, 64}, \ + {32, 64}, \ + {64, 64} \ +} + +static const struct net_dim_cq_moder + net_dim_profile[NET_DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = { + NET_DIM_EQE_PROFILES, + NET_DIM_CQE_PROFILES, +}; + +static inline struct net_dim_cq_moder +net_dim_get_profile(u8 cq_period_mode, + int ix) +{ + struct net_dim_cq_moder cq_moder; + + cq_moder = net_dim_profile[cq_period_mode][ix]; + cq_moder.cq_period_mode = cq_period_mode; + return cq_moder; +} + +static inline struct net_dim_cq_moder +net_dim_get_def_profile(u8 rx_cq_period_mode) +{ + int default_profile_ix; + + if (rx_cq_period_mode == NET_DIM_CQ_PERIOD_MODE_START_FROM_CQE) + default_profile_ix = NET_DIM_DEF_PROFILE_CQE; + else /* NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE */ + default_profile_ix = NET_DIM_DEF_PROFILE_EQE; + + return net_dim_get_profile(rx_cq_period_mode, default_profile_ix); +} + +static inline bool +net_dim_on_top(struct net_dim *dim) +{ + switch (dim->tune_state) { + case NET_DIM_PARKING_ON_TOP: + case NET_DIM_PARKING_TIRED: + return true; + case NET_DIM_GOING_RIGHT: + return (dim->steps_left > 1) && (dim->steps_right == 1); + default: /* NET_DIM_GOING_LEFT */ + return (dim->steps_right > 1) && (dim->steps_left == 1); + } +} + +static inline void +net_dim_turn(struct net_dim *dim) +{ + switch (dim->tune_state) { + case NET_DIM_PARKING_ON_TOP: + case NET_DIM_PARKING_TIRED: + break; + case NET_DIM_GOING_RIGHT: + dim->tune_state = NET_DIM_GOING_LEFT; + dim->steps_left = 0; + break; + case NET_DIM_GOING_LEFT: + dim->tune_state = NET_DIM_GOING_RIGHT; + dim->steps_right = 0; + break; + } +} + +static inline int +net_dim_step(struct net_dim *dim) +{ + if (dim->tired == (NET_DIM_PARAMS_NUM_PROFILES * 2)) + return NET_DIM_TOO_TIRED; + + switch (dim->tune_state) { + case NET_DIM_PARKING_ON_TOP: + case NET_DIM_PARKING_TIRED: + break; + case NET_DIM_GOING_RIGHT: + if (dim->profile_ix == (NET_DIM_PARAMS_NUM_PROFILES - 1)) + return NET_DIM_ON_EDGE; + dim->profile_ix++; + dim->steps_right++; + break; + case NET_DIM_GOING_LEFT: + if (dim->profile_ix == 0) + return NET_DIM_ON_EDGE; + dim->profile_ix--; + dim->steps_left++; + break; + } + + dim->tired++; + return NET_DIM_STEPPED; +} + +static inline void +net_dim_park_on_top(struct net_dim *dim) +{ + dim->steps_right = 0; + dim->steps_left = 0; + dim->tired = 0; + dim->tune_state = NET_DIM_PARKING_ON_TOP; +} + +static inline void +net_dim_park_tired(struct net_dim *dim) +{ + dim->steps_right = 0; + dim->steps_left = 0; + dim->tune_state = NET_DIM_PARKING_TIRED; +} + +static inline void +net_dim_exit_parking(struct net_dim *dim) +{ + dim->tune_state = dim->profile_ix ? NET_DIM_GOING_LEFT : + NET_DIM_GOING_RIGHT; + net_dim_step(dim); +} + +#define IS_SIGNIFICANT_DIFF(val, ref) \ + (((100UL * abs((val) - (ref))) / (ref)) > 10) /* more than 10% + * difference */ + +static inline int +net_dim_stats_compare(struct net_dim_stats *curr, + struct net_dim_stats *prev) +{ + if (!prev->bpms) + return curr->bpms ? NET_DIM_STATS_BETTER : + NET_DIM_STATS_SAME; + + if (IS_SIGNIFICANT_DIFF(curr->bpms, prev->bpms)) + return (curr->bpms > prev->bpms) ? NET_DIM_STATS_BETTER : + NET_DIM_STATS_WORSE; + + if (!prev->ppms) + return curr->ppms ? NET_DIM_STATS_BETTER : + NET_DIM_STATS_SAME; + + if (IS_SIGNIFICANT_DIFF(curr->ppms, prev->ppms)) + return (curr->ppms > prev->ppms) ? NET_DIM_STATS_BETTER : + NET_DIM_STATS_WORSE; + + if (!prev->epms) + return NET_DIM_STATS_SAME; + + if (IS_SIGNIFICANT_DIFF(curr->epms, prev->epms)) + return (curr->epms < prev->epms) ? NET_DIM_STATS_BETTER : + NET_DIM_STATS_WORSE; + + return NET_DIM_STATS_SAME; +} + +static inline bool +net_dim_decision(struct net_dim_stats *curr_stats, + struct net_dim *dim) +{ + int prev_state = dim->tune_state; + int prev_ix = dim->profile_ix; + int stats_res; + int step_res; + + switch (dim->tune_state) { + case NET_DIM_PARKING_ON_TOP: + stats_res = net_dim_stats_compare(curr_stats, &dim->prev_stats); + if (stats_res != NET_DIM_STATS_SAME) + net_dim_exit_parking(dim); + break; + + case NET_DIM_PARKING_TIRED: + dim->tired--; + if (!dim->tired) + net_dim_exit_parking(dim); + break; + + case NET_DIM_GOING_RIGHT: + case NET_DIM_GOING_LEFT: + stats_res = net_dim_stats_compare(curr_stats, &dim->prev_stats); + if (stats_res != NET_DIM_STATS_BETTER) + net_dim_turn(dim); + + if (net_dim_on_top(dim)) { + net_dim_park_on_top(dim); + break; + } + step_res = net_dim_step(dim); + switch (step_res) { + case NET_DIM_ON_EDGE: + net_dim_park_on_top(dim); + break; + case NET_DIM_TOO_TIRED: + net_dim_park_tired(dim); + break; + } + + break; + } + + if ((prev_state != NET_DIM_PARKING_ON_TOP) || + (dim->tune_state != NET_DIM_PARKING_ON_TOP)) + dim->prev_stats = *curr_stats; + + return dim->profile_ix != prev_ix; +} + +static inline void +net_dim_sample(u16 event_ctr, + u64 packets, + u64 bytes, + struct net_dim_sample *s) +{ + s->time = ktime_get(); + s->pkt_ctr = packets; + s->byte_ctr = bytes; + s->event_ctr = event_ctr; +} + +#define NET_DIM_NEVENTS 64 +#define BIT_GAP(bits, end, start) ((((end) - (start)) + BIT_ULL(bits)) & (BIT_ULL(bits) - 1)) + +static inline void +net_dim_calc_stats(struct net_dim_sample *start, + struct net_dim_sample *end, + struct net_dim_stats *curr_stats) +{ + /* u32 holds up to 71 minutes, should be enough */ + u32 delta_us = ktime_us_delta(end->time, start->time); + u32 npkts = BIT_GAP(BITS_PER_TYPE(u32), end->pkt_ctr, start->pkt_ctr); + u32 nbytes = BIT_GAP(BITS_PER_TYPE(u32), end->byte_ctr, + start->byte_ctr); + + if (!delta_us) + return; + + curr_stats->ppms = DIV_ROUND_UP(npkts * USEC_PER_MSEC, delta_us); + curr_stats->bpms = DIV_ROUND_UP(nbytes * USEC_PER_MSEC, delta_us); + curr_stats->epms = DIV_ROUND_UP(NET_DIM_NEVENTS * USEC_PER_MSEC, + delta_us); +} + +static inline void +net_dim(struct net_dim *dim, + u64 packets, u64 bytes) +{ + struct net_dim_stats curr_stats; + struct net_dim_sample end_sample; + u16 nevents; + + dim->event_ctr++; + + switch (dim->state) { + case NET_DIM_MEASURE_IN_PROGRESS: + nevents = BIT_GAP(BITS_PER_TYPE(u16), + dim->event_ctr, + dim->start_sample.event_ctr); + if (nevents < NET_DIM_NEVENTS) + break; + net_dim_sample(dim->event_ctr, packets, bytes, &end_sample); + net_dim_calc_stats(&dim->start_sample, &end_sample, + &curr_stats); + if (net_dim_decision(&curr_stats, dim)) { + dim->state = NET_DIM_APPLY_NEW_PROFILE; + schedule_work(&dim->work); + break; + } + /* FALLTHROUGH */ + case NET_DIM_START_MEASURE: + net_dim_sample(dim->event_ctr, packets, bytes, &dim->start_sample); + dim->state = NET_DIM_MEASURE_IN_PROGRESS; + break; + case NET_DIM_APPLY_NEW_PROFILE: + break; + default: + break; + } +} + +#endif /* NET_DIM_H */ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed May 8 09:03:43 2019 (r347245) +++ head/sys/conf/files Wed May 8 10:23:33 2019 (r347246) @@ -4764,6 +4764,8 @@ dev/mlx5/mlx5_core/mlx5_wq.c optional mlx5 pci \ dev/mlx5/mlx5_lib/mlx5_gid.c optional mlx5 pci \ compile-with "${OFED_C}" +dev/mlx5/mlx5_en/mlx5_en_dim.c optional mlx5en pci inet inet6 \ + compile-with "${OFED_C}" dev/mlx5/mlx5_en/mlx5_en_ethtool.c optional mlx5en pci inet inet6 \ compile-with "${OFED_C}" dev/mlx5/mlx5_en/mlx5_en_main.c optional mlx5en pci inet inet6 \ Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 09:03:43 2019 (r347245) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:23:33 2019 (r347246) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Mellanox Technologies. All rights reserved. + * Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,6 +38,8 @@ #include #include #include +#include +#include #include #include @@ -95,6 +97,8 @@ #define MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ \ MIN(65535, MLX5E_MAX_RX_SEGS * MLX5E_MAX_RX_BYTES) #endif +#define MLX5E_DIM_DEFAULT_PROFILE 3 +#define MLX5E_DIM_MAX_RX_CQ_MODERATION_PKTS_WITH_LRO 16 #define MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_USEC 0x10 #define MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_USEC_FROM_CQE 0x3 #define MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_PKTS 0x20 @@ -472,7 +476,7 @@ struct mlx5e_params { m(+1, u64 coalesce_pkts_max, "coalesce_pkts_max", "Maximum packets to join") \ m(+1, u64 rx_coalesce_usecs, "rx_coalesce_usecs", "Limit in usec for joining rx packets") \ m(+1, u64 rx_coalesce_pkts, "rx_coalesce_pkts", "Maximum number of rx packets to join") \ - m(+1, u64 rx_coalesce_mode, "rx_coalesce_mode", "0: EQE mode 1: CQE mode") \ + m(+1, u64 rx_coalesce_mode, "rx_coalesce_mode", "0: EQE fixed mode 1: CQE fixed mode 2: EQE auto mode 3: CQE auto mode") \ m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ @@ -562,6 +566,9 @@ struct mlx5e_rq { volatile int enabled; int ix; + /* Dynamic Interrupt Moderation */ + struct net_dim dim; + /* control */ struct mlx5_wq_ctrl wq_ctrl; u32 rqn; @@ -881,6 +888,9 @@ void mlx5e_cq_error_event(struct mlx5_core_cq *mcq, in void mlx5e_rx_cq_comp(struct mlx5_core_cq *); void mlx5e_tx_cq_comp(struct mlx5_core_cq *); struct mlx5_cqe64 *mlx5e_get_cqe(struct mlx5e_cq *cq); + +void mlx5e_dim_work(struct work_struct *); +void mlx5e_dim_build_cq_param(struct mlx5e_priv *, struct mlx5e_cq_param *); int mlx5e_open_flow_table(struct mlx5e_priv *priv); void mlx5e_close_flow_table(struct mlx5e_priv *priv); Added: head/sys/dev/mlx5/mlx5_en/mlx5_en_dim.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_dim.c Wed May 8 10:23:33 2019 (r347246) @@ -0,0 +1,92 @@ +/*- + * Copyright (c) 2018 Mellanox Technologies. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "en.h" + +void +mlx5e_dim_build_cq_param(struct mlx5e_priv *priv, + struct mlx5e_cq_param *param) +{ + struct net_dim_cq_moder prof; + void *cqc = param->cqc; + + if (priv->params.rx_cq_moderation_mode < 2) + return; + + switch (MLX5_GET(cqc, cqc, cq_period_mode)) { + case MLX5_CQ_PERIOD_MODE_START_FROM_CQE: + prof = net_dim_profile[NET_DIM_CQ_PERIOD_MODE_START_FROM_CQE] + [NET_DIM_DEF_PROFILE_CQE]; + MLX5_SET(cqc, cqc, cq_period, prof.usec); + MLX5_SET(cqc, cqc, cq_max_count, prof.pkts); + break; + + case MLX5_CQ_PERIOD_MODE_START_FROM_EQE: + prof = net_dim_profile[NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE] + [NET_DIM_DEF_PROFILE_EQE]; + MLX5_SET(cqc, cqc, cq_period, prof.usec); + MLX5_SET(cqc, cqc, cq_max_count, prof.pkts); + break; + default: + break; + } +} + +void +mlx5e_dim_work(struct work_struct *work) +{ + struct net_dim *dim = container_of(work, struct net_dim, work); + struct mlx5e_rq *rq = container_of(dim, struct mlx5e_rq, dim); + struct mlx5e_channel *c = container_of(rq, struct mlx5e_channel, rq); + struct net_dim_cq_moder cur_profile; + u8 profile_ix; + u8 mode; + + /* copy current auto moderation settings and set new state */ + mtx_lock(&rq->mtx); + profile_ix = dim->profile_ix; + mode = dim->mode; + dim->state = NET_DIM_START_MEASURE; + mtx_unlock(&rq->mtx); + + /* check for invalid mode */ + if (mode == 255) + return; + + /* get current profile */ + cur_profile = net_dim_profile[mode][profile_ix]; + + /* apply LRO restrictions */ + if (c->priv->params.hw_lro_en && + cur_profile.pkts > MLX5E_DIM_MAX_RX_CQ_MODERATION_PKTS_WITH_LRO) { + cur_profile.pkts = MLX5E_DIM_MAX_RX_CQ_MODERATION_PKTS_WITH_LRO; + } + + /* modify CQ */ + mlx5_core_modify_cq_moderation(c->priv->mdev, &rq->cq.mcq, + cur_profile.usec, cur_profile.pkts); +} Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed May 8 09:03:43 2019 (r347245) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed May 8 10:23:33 2019 (r347246) @@ -629,8 +629,8 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) mlx5e_close_locked(priv->ifp); /* import RX coalesce mode */ - if (priv->params_ethtool.rx_coalesce_mode != 0) - priv->params_ethtool.rx_coalesce_mode = 1; + if (priv->params_ethtool.rx_coalesce_mode > 3) + priv->params_ethtool.rx_coalesce_mode = 3; priv->params.rx_cq_moderation_mode = priv->params_ethtool.rx_coalesce_mode; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 09:03:43 2019 (r347245) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:23:33 2019 (r347246) @@ -915,6 +915,26 @@ mlx5e_create_rq(struct mlx5e_channel *c, #endif } + INIT_WORK(&rq->dim.work, mlx5e_dim_work); + if (priv->params.rx_cq_moderation_mode < 2) { + rq->dim.mode = NET_DIM_CQ_PERIOD_MODE_DISABLED; + } else { + void *cqc = container_of(param, + struct mlx5e_channel_param, rq)->rx_cq.cqc; + + switch (MLX5_GET(cqc, cqc, cq_period_mode)) { + case MLX5_CQ_PERIOD_MODE_START_FROM_EQE: + rq->dim.mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE; + break; + case MLX5_CQ_PERIOD_MODE_START_FROM_CQE: + rq->dim.mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_CQE; + break; + default: + rq->dim.mode = NET_DIM_CQ_PERIOD_MODE_DISABLED; + break; + } + } + rq->ifp = c->tag.m_snd_tag.ifp; rq->channel = c; rq->ix = c->ix; @@ -1116,6 +1136,7 @@ mlx5e_close_rq_wait(struct mlx5e_rq *rq) rq->cq.mcq.comp(&rq->cq.mcq); } + cancel_work_sync(&rq->dim.work); mlx5e_disable_rq(rq); mlx5e_destroy_rq(rq); } @@ -1916,9 +1937,23 @@ mlx5e_build_common_cq_param(struct mlx5e_priv *priv, } static void +mlx5e_get_default_profile(struct mlx5e_priv *priv, int mode, struct net_dim_cq_moder *ptr) +{ + + *ptr = net_dim_get_profile(mode, MLX5E_DIM_DEFAULT_PROFILE); + + /* apply LRO restrictions */ + if (priv->params.hw_lro_en && + ptr->pkts > MLX5E_DIM_MAX_RX_CQ_MODERATION_PKTS_WITH_LRO) { + ptr->pkts = MLX5E_DIM_MAX_RX_CQ_MODERATION_PKTS_WITH_LRO; + } +} + +static void mlx5e_build_rx_cq_param(struct mlx5e_priv *priv, struct mlx5e_cq_param *param) { + struct net_dim_cq_moder curr; void *cqc = param->cqc; @@ -1932,21 +1967,42 @@ mlx5e_build_rx_cq_param(struct mlx5e_priv *priv, } MLX5_SET(cqc, cqc, log_cq_size, priv->params.log_rq_size); - MLX5_SET(cqc, cqc, cq_period, priv->params.rx_cq_moderation_usec); - MLX5_SET(cqc, cqc, cq_max_count, priv->params.rx_cq_moderation_pkts); switch (priv->params.rx_cq_moderation_mode) { case 0: + MLX5_SET(cqc, cqc, cq_period, priv->params.rx_cq_moderation_usec); + MLX5_SET(cqc, cqc, cq_max_count, priv->params.rx_cq_moderation_pkts); MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); break; - default: + case 1: + MLX5_SET(cqc, cqc, cq_period, priv->params.rx_cq_moderation_usec); + MLX5_SET(cqc, cqc, cq_max_count, priv->params.rx_cq_moderation_pkts); if (MLX5_CAP_GEN(priv->mdev, cq_period_start_from_cqe)) MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_CQE); else MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); break; + case 2: + mlx5e_get_default_profile(priv, NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE, &curr); + MLX5_SET(cqc, cqc, cq_period, curr.usec); + MLX5_SET(cqc, cqc, cq_max_count, curr.pkts); + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + case 3: + mlx5e_get_default_profile(priv, NET_DIM_CQ_PERIOD_MODE_START_FROM_CQE, &curr); + MLX5_SET(cqc, cqc, cq_period, curr.usec); + MLX5_SET(cqc, cqc, cq_max_count, curr.pkts); + if (MLX5_CAP_GEN(priv->mdev, cq_period_start_from_cqe)) + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_CQE); + else + MLX5_SET(cqc, cqc, cq_period_mode, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + break; + default: + break; } + mlx5e_dim_build_cq_param(priv, param); + mlx5e_build_common_cq_param(priv, param); } @@ -2037,6 +2093,7 @@ mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struc switch (priv->params.tx_cq_moderation_mode) { case 0: + case 2: cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; break; default: @@ -2061,22 +2118,49 @@ mlx5e_refresh_rq_params(struct mlx5e_priv *priv, struc if (MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify)) { uint8_t cq_mode; + uint8_t dim_mode; int retval; switch (priv->params.rx_cq_moderation_mode) { case 0: + case 2: cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + dim_mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_EQE; break; default: cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + dim_mode = NET_DIM_CQ_PERIOD_MODE_START_FROM_CQE; break; } - retval = mlx5_core_modify_cq_moderation_mode(priv->mdev, &rq->cq.mcq, - priv->params.rx_cq_moderation_usec, - priv->params.rx_cq_moderation_pkts, - cq_mode); + /* tear down dynamic interrupt moderation */ + mtx_lock(&rq->mtx); + rq->dim.mode = NET_DIM_CQ_PERIOD_MODE_DISABLED; + mtx_unlock(&rq->mtx); + /* wait for dynamic interrupt moderation work task, if any */ + cancel_work_sync(&rq->dim.work); + + if (priv->params.rx_cq_moderation_mode >= 2) { + struct net_dim_cq_moder curr; + + mlx5e_get_default_profile(priv, dim_mode, &curr); + + retval = mlx5_core_modify_cq_moderation_mode(priv->mdev, &rq->cq.mcq, + curr.usec, curr.pkts, cq_mode); + + /* set dynamic interrupt moderation mode and zero defaults */ + mtx_lock(&rq->mtx); + rq->dim.mode = dim_mode; + rq->dim.state = 0; + rq->dim.profile_ix = MLX5E_DIM_DEFAULT_PROFILE; + mtx_unlock(&rq->mtx); + } else { + retval = mlx5_core_modify_cq_moderation_mode(priv->mdev, &rq->cq.mcq, + priv->params.rx_cq_moderation_usec, + priv->params.rx_cq_moderation_pkts, + cq_mode); + } return (retval); } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed May 8 09:03:43 2019 (r347245) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed May 8 10:23:33 2019 (r347246) @@ -585,6 +585,9 @@ mlx5e_rx_cq_comp(struct mlx5_core_cq *mcq) mlx5e_post_rx_wqes(rq); } mlx5e_post_rx_wqes(rq); + /* check for dynamic interrupt moderation callback */ + if (rq->dim.mode != NET_DIM_CQ_PERIOD_MODE_DISABLED) + net_dim(&rq->dim, rq->stats.packets, rq->stats.bytes); mlx5e_cq_arm(&rq->cq, MLX5_GET_DOORBELL_LOCK(&rq->channel->priv->doorbell_lock)); tcp_lro_flush_all(&rq->lro); mtx_unlock(&rq->mtx); Modified: head/sys/modules/mlx5en/Makefile ============================================================================== --- head/sys/modules/mlx5en/Makefile Wed May 8 09:03:43 2019 (r347245) +++ head/sys/modules/mlx5en/Makefile Wed May 8 10:23:33 2019 (r347246) @@ -3,6 +3,7 @@ KMOD=mlx5en SRCS= \ +mlx5_en_dim.c \ mlx5_en_ethtool.c \ mlx5_en_main.c \ mlx5_en_tx.c \ From owner-svn-src-all@freebsd.org Wed May 8 10:25:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 381D115A3FDE; Wed, 8 May 2019 10:25:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1A19952AC; Wed, 8 May 2019 10:25:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A80674888; Wed, 8 May 2019 10:25:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48APFJ5038918; Wed, 8 May 2019 10:25:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48APEAH038914; Wed, 8 May 2019 10:25:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081025.x48APEAH038914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347247 - in head/sys/dev/mlx5: . mlx5_fpga mlx5_fpga_tools X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_fpga mlx5_fpga_tools X-SVN-Commit-Revision: 347247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D1A19952AC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:25:16 -0000 Author: hselasky Date: Wed May 8 10:25:14 2019 New Revision: 347247 URL: https://svnweb.freebsd.org/changeset/base/347247 Log: Add MLX5_FPGA_RELOAD IOCTL(2) to mlx5fpga. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_fpga/mlx5_ifc_fpga.h head/sys/dev/mlx5/mlx5_fpga/mlx5fpga_sdk.c head/sys/dev/mlx5/mlx5_fpga_tools/mlx5fpga_tools_char.c head/sys/dev/mlx5/mlx5io.h Modified: head/sys/dev/mlx5/mlx5_fpga/mlx5_ifc_fpga.h ============================================================================== --- head/sys/dev/mlx5/mlx5_fpga/mlx5_ifc_fpga.h Wed May 8 10:23:33 2019 (r347246) +++ head/sys/dev/mlx5/mlx5_fpga/mlx5_ifc_fpga.h Wed May 8 10:25:14 2019 (r347247) @@ -135,6 +135,7 @@ enum { MLX5_FPGA_CTRL_OPERATION_RESET_SANDBOX = 0x6, MLX5_FPGA_CTRL_OPERATION_DISCONNECT = 0x9, MLX5_FPGA_CTRL_OPERATION_CONNECT = 0xA, + MLX5_FPGA_CTRL_OPERATION_RELOAD = 0xB, }; struct mlx5_ifc_fpga_ctrl_bits { Modified: head/sys/dev/mlx5/mlx5_fpga/mlx5fpga_sdk.c ============================================================================== --- head/sys/dev/mlx5/mlx5_fpga/mlx5fpga_sdk.c Wed May 8 10:23:33 2019 (r347246) +++ head/sys/dev/mlx5/mlx5_fpga/mlx5fpga_sdk.c Wed May 8 10:25:14 2019 (r347247) @@ -324,6 +324,45 @@ void mlx5_fpga_device_query(struct mlx5_fpga_device *f } EXPORT_SYMBOL(mlx5_fpga_device_query); +static int mlx5_fpga_device_reload_cmd(struct mlx5_fpga_device *fdev) +{ + struct mlx5_core_dev *mdev = fdev->mdev; + unsigned long timeout; + unsigned long flags; + int err = 0; + + mlx5_fpga_info(fdev, "mlx5/fpga - reload started\n"); + fdev->fdev_state = MLX5_FDEV_STATE_IN_PROGRESS; + reinit_completion(&fdev->load_event); + err = mlx5_fpga_ctrl_op(mdev, MLX5_FPGA_CTRL_OPERATION_RELOAD); + if (err) { + mlx5_fpga_err(fdev, "Failed to request reload: %d\n", + err); + goto out; + } + timeout = jiffies + msecs_to_jiffies(MLX5_FPGA_LOAD_TIMEOUT); + err = wait_for_completion_timeout(&fdev->load_event, + timeout - jiffies); + if (err < 0) { + mlx5_fpga_err(fdev, "Failed waiting for reload: %d\n", err); + fdev->fdev_state = MLX5_FDEV_STATE_FAILURE; + goto out; + } + /* Check device loaded successful */ + err = mlx5_fpga_device_start(mdev); + if (err) { + mlx5_fpga_err(fdev, "Failed load check for reload: %d\n", err); + fdev->fdev_state = MLX5_FDEV_STATE_FAILURE; + goto out; + } + spin_lock_irqsave(&fdev->state_lock, flags); + fdev->fdev_state = MLX5_FDEV_STATE_SUCCESS; + spin_unlock_irqrestore(&fdev->state_lock, flags); + mlx5_fpga_info(fdev, "mlx5/fpga - reload ended\n"); +out: + return err; +} + int mlx5_fpga_device_reload(struct mlx5_fpga_device *fdev, enum mlx5_fpga_image image) { @@ -350,6 +389,12 @@ int mlx5_fpga_device_reload(struct mlx5_fpga_device *f return err; mutex_lock(&mdev->intf_state_mutex); + + if (image == MLX5_FPGA_IMAGE_RELOAD) { + err = mlx5_fpga_device_reload_cmd(fdev); + goto out; + } + clear_bit(MLX5_INTERFACE_STATE_UP, &mdev->intf_state); mlx5_unregister_device(mdev); @@ -359,7 +404,7 @@ int mlx5_fpga_device_reload(struct mlx5_fpga_device *f fdev->fdev_state = MLX5_FDEV_STATE_IN_PROGRESS; reinit_completion(&fdev->load_event); - if (image <= MLX5_FPGA_IMAGE_MAX) { + if (image <= MLX5_FPGA_IMAGE_FACTORY) { mlx5_fpga_info(fdev, "Loading from flash\n"); err = mlx5_fpga_load(mdev, image); if (err) { @@ -367,7 +412,7 @@ int mlx5_fpga_device_reload(struct mlx5_fpga_device *f err); goto out; } - } else { + } else if (image == MLX5_FPGA_IMAGE_RESET) { mlx5_fpga_info(fdev, "Resetting\n"); err = mlx5_fpga_ctrl_op(mdev, MLX5_FPGA_CTRL_OPERATION_RESET); if (err) { @@ -375,6 +420,10 @@ int mlx5_fpga_device_reload(struct mlx5_fpga_device *f err); goto out; } + } else { + mlx5_fpga_err(fdev, "Unknown command: %d\n", + image); + goto out; } timeout = jiffies + msecs_to_jiffies(MLX5_FPGA_LOAD_TIMEOUT); Modified: head/sys/dev/mlx5/mlx5_fpga_tools/mlx5fpga_tools_char.c ============================================================================== --- head/sys/dev/mlx5/mlx5_fpga_tools/mlx5fpga_tools_char.c Wed May 8 10:23:33 2019 (r347246) +++ head/sys/dev/mlx5/mlx5_fpga_tools/mlx5fpga_tools_char.c Wed May 8 10:25:14 2019 (r347247) @@ -225,7 +225,7 @@ tools_char_ioctl(struct cdev *dev, u_long cmd, caddr_t break; case MLX5_FPGA_LOAD: arg = *(int *)data; - if (arg > MLX5_FPGA_IMAGE_MAX) { + if (arg > MLX5_FPGA_IMAGE_FACTORY) { dev_err(mlx5_fpga_dev(fdev), "unknown image type %u\n", arg); err = EINVAL; @@ -234,11 +234,14 @@ tools_char_ioctl(struct cdev *dev, u_long cmd, caddr_t err = mlx5_fpga_device_reload(fdev, arg); break; case MLX5_FPGA_RESET: - err = mlx5_fpga_device_reload(fdev, MLX5_FPGA_IMAGE_MAX + 1); + err = mlx5_fpga_device_reload(fdev, MLX5_FPGA_IMAGE_RESET); break; + case MLX5_FPGA_RELOAD: + err = mlx5_fpga_device_reload(fdev, MLX5_FPGA_IMAGE_RELOAD); + break; case MLX5_FPGA_IMAGE_SEL: arg = *(int *)data; - if (arg > MLX5_FPGA_IMAGE_MAX) { + if (arg > MLX5_FPGA_IMAGE_FACTORY) { dev_err(mlx5_fpga_dev(fdev), "unknown image type %u\n", arg); err = EINVAL; Modified: head/sys/dev/mlx5/mlx5io.h ============================================================================== --- head/sys/dev/mlx5/mlx5io.h Wed May 8 10:23:33 2019 (r347246) +++ head/sys/dev/mlx5/mlx5io.h Wed May 8 10:25:14 2019 (r347247) @@ -67,8 +67,9 @@ enum mlx5_fpga_id { enum mlx5_fpga_image { MLX5_FPGA_IMAGE_USER = 0, MLX5_FPGA_IMAGE_FACTORY = 1, - MLX5_FPGA_IMAGE_MAX = MLX5_FPGA_IMAGE_FACTORY, MLX5_FPGA_IMAGE_FACTORY_FAILOVER = 2, + MLX5_FPGA_IMAGE_RESET = 17, + MLX5_FPGA_IMAGE_RELOAD = 18, }; enum mlx5_fpga_status { @@ -135,6 +136,7 @@ struct mlx5_fpga_temperature { #define MLX5_FPGA_CAP _IOR('m', 0x85, uint32_t[MLX5_FPGA_CAP_ARR_SZ]) #define MLX5_FPGA_TEMPERATURE _IOWR('m', 0x86, struct mlx5_fpga_temperature) #define MLX5_FPGA_CONNECT _IOWR('m', 0x87, enum mlx5_fpga_connect) +#define MLX5_FPGA_RELOAD _IO('m', 0x88) #define MLX5_FPGA_TOOLS_NAME_SUFFIX "_mlx5_fpga_tools" From owner-svn-src-all@freebsd.org Wed May 8 10:26:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2189D15A4095; Wed, 8 May 2019 10:26:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC53895465; Wed, 8 May 2019 10:26:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 934C14889; Wed, 8 May 2019 10:26:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AQXoV039035; Wed, 8 May 2019 10:26:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AQX9o039034; Wed, 8 May 2019 10:26:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081026.x48AQX9o039034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347248 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC53895465 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:26:34 -0000 Author: hselasky Date: Wed May 8 10:26:33 2019 New Revision: 347248 URL: https://svnweb.freebsd.org/changeset/base/347248 Log: Enable FPGA and FPGA QP errors for EQ and call the handler in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 8 10:25:14 2019 (r347247) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 8 10:26:33 2019 (r347248) @@ -29,6 +29,7 @@ #include #include #include +#include #include "mlx5_core.h" #include "opt_rss.h" @@ -153,6 +154,10 @@ static const char *eqe_type_str(u8 type) return "MLX5_EVENT_TYPE_PAGE_REQUEST"; case MLX5_EVENT_TYPE_NIC_VPORT_CHANGE: return "MLX5_EVENT_TYPE_NIC_VPORT_CHANGE"; + case MLX5_EVENT_TYPE_FPGA_ERROR: + return "MLX5_EVENT_TYPE_FPGA_ERROR"; + case MLX5_EVENT_TYPE_FPGA_QP_ERROR: + return "MLX5_EVENT_TYPE_FPGA_QP_ERROR"; case MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT: return "MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT"; case MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT: @@ -338,6 +343,11 @@ static int mlx5_eq_int(struct mlx5_core_dev *dev, stru } break; + case MLX5_EVENT_TYPE_FPGA_ERROR: + case MLX5_EVENT_TYPE_FPGA_QP_ERROR: + mlx5_fpga_event(dev, eqe->type, &eqe->data.raw); + break; + default: mlx5_core_warn(dev, "Unhandled event 0x%x on EQ 0x%x\n", eqe->type, eq->eqn); @@ -526,6 +536,10 @@ int mlx5_start_eqs(struct mlx5_core_dev *dev) if (MLX5_CAP_GEN(dev, dcbx)) async_event_mask |= (1ull << MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT); + + if (MLX5_CAP_GEN(dev, fpga)) + async_event_mask |= (1ull << MLX5_EVENT_TYPE_FPGA_ERROR) | + (1ull << MLX5_EVENT_TYPE_FPGA_QP_ERROR); err = mlx5_create_map_eq(dev, &table->cmd_eq, MLX5_EQ_VEC_CMD, MLX5_NUM_CMD_EQE, 1ull << MLX5_EVENT_TYPE_CMD, From owner-svn-src-all@freebsd.org Wed May 8 10:27:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C9C815A412F; Wed, 8 May 2019 10:27:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5620955C5; Wed, 8 May 2019 10:27:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90850488A; Wed, 8 May 2019 10:27:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48ARUUp039134; Wed, 8 May 2019 10:27:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48ARUI9039133; Wed, 8 May 2019 10:27:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081027.x48ARUI9039133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347249 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B5620955C5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:27:31 -0000 Author: hselasky Date: Wed May 8 10:27:29 2019 New Revision: 347249 URL: https://svnweb.freebsd.org/changeset/base/347249 Log: Correctly define the interface state bits in mlx5en(4). While at it remove unused interface state bits. This also fixes and issue during shutdown: There is an issue where the firmware fails during mlx5_load_one, the health_care timer detects the issue and schedules a health_care call. Then the mlx5_load_one detects the issue, cleans up and quits. Then the health_care starts and calls mlx5_unload_one to clean up the resources that no longer exist and causes kernel panic. The root cause is that the bit MLX5_INTERFACE_STATE_DOWN is not set after mlx5_load_one fails. The solution is removing the bit MLX5_INTERFACE_STATE_DOWN and quit mlx5_unload_one if the bit MLX5_INTERFACE_STATE_UP is not set. The bit MLX5_INTERFACE_STATE_DOWN is redundant and we can use MLX5_INTERFACE_STATE_UP instead. Linux commit: 10a8d00707082955b177164d4b4e758ffcbd4017 b3cb5388499c5e219324bfe7da2e46cbad82bfcf MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 10:26:33 2019 (r347248) +++ head/sys/dev/mlx5/driver.h Wed May 8 10:27:29 2019 (r347249) @@ -662,9 +662,7 @@ enum mlx5_device_state { }; enum mlx5_interface_state { - MLX5_INTERFACE_STATE_DOWN = BIT(0), - MLX5_INTERFACE_STATE_UP = BIT(1), - MLX5_INTERFACE_STATE_SHUTDOWN = BIT(2), + MLX5_INTERFACE_STATE_UP, }; enum mlx5_pci_status { Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:26:33 2019 (r347248) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:27:29 2019 (r347249) @@ -1096,7 +1096,6 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, st goto err_fs; } - clear_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state); set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state); out: @@ -1159,7 +1158,7 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, mlx5_drain_health_recovery(dev); mutex_lock(&dev->intf_state_mutex); - if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) { + if (!test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) { dev_warn(&dev->pdev->dev, "%s: interface is down, NOP\n", __func__); if (cleanup) mlx5_cleanup_once(dev); @@ -1191,7 +1190,6 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, out: clear_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state); - set_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state); mutex_unlock(&dev->intf_state_mutex); return err; } @@ -1451,7 +1449,6 @@ static void shutdown_one(struct pci_dev *pdev) struct mlx5_priv *priv = &dev->priv; int err; - set_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &dev->intf_state); err = mlx5_try_fast_unload(dev); if (err) mlx5_unload_one(dev, priv, false); From owner-svn-src-all@freebsd.org Wed May 8 10:28:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0C9D15A41EF; Wed, 8 May 2019 10:28:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55BEF9578B; Wed, 8 May 2019 10:28:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30FC1488C; Wed, 8 May 2019 10:28:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48ASJfg039232; Wed, 8 May 2019 10:28:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48ASI7p039229; Wed, 8 May 2019 10:28:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081028.x48ASI7p039229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347250 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 55BEF9578B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:28:20 -0000 Author: hselasky Date: Wed May 8 10:28:18 2019 New Revision: 347250 URL: https://svnweb.freebsd.org/changeset/base/347250 Log: Add temperature warning event to log in mlx5core. Temperature warning event is sent by FW to indicate high temperature as detected by one of the sensors on the board. Add handling of this event by writing the numbers of the alert sensors to the kernel log. Linux commit: 1865ea9adbfaf341c5cd5d8f7d384f19948b2fe9 Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed May 8 10:27:29 2019 (r347249) +++ head/sys/dev/mlx5/device.h Wed May 8 10:28:18 2019 (r347250) @@ -566,6 +566,11 @@ struct mlx5_eqe_general_notification_event { u32 rsvd0[6]; }; +struct mlx5_eqe_temp_warning { + __be64 sensor_warning_msb; + __be64 sensor_warning_lsb; +} __packed; + union ev_data { __be32 raw[7]; struct mlx5_eqe_cmd cmd; @@ -580,6 +585,7 @@ union ev_data { struct mlx5_eqe_port_module_event port_module_event; struct mlx5_eqe_vport_change vport_change; struct mlx5_eqe_general_notification_event general_notifications; + struct mlx5_eqe_temp_warning temp_warning; } __packed; struct mlx5_eqe { Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 8 10:27:29 2019 (r347249) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 8 10:28:18 2019 (r347250) @@ -142,6 +142,8 @@ static const char *eqe_type_str(u8 type) return "MLX5_EVENT_TYPE_GPIO_EVENT"; case MLX5_EVENT_TYPE_CODING_PORT_MODULE_EVENT: return "MLX5_EVENT_TYPE_PORT_MODULE_EVENT"; + case MLX5_EVENT_TYPE_TEMP_WARN_EVENT: + return "MLX5_EVENT_TYPE_TEMP_WARN_EVENT"; case MLX5_EVENT_TYPE_REMOTE_CONFIG: return "MLX5_EVENT_TYPE_REMOTE_CONFIG"; case MLX5_EVENT_TYPE_DB_BF_CONGESTION: @@ -212,6 +214,16 @@ static void eq_update_ci(struct mlx5_eq *eq, int arm) mb(); } +static void +mlx5_temp_warning_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe) +{ + + mlx5_core_warn(dev, + "High temperature on sensors with bit set %#jx %#jx", + (uintmax_t)be64_to_cpu(eqe->data.temp_warning.sensor_warning_msb), + (uintmax_t)be64_to_cpu(eqe->data.temp_warning.sensor_warning_lsb)); +} + static int mlx5_eq_int(struct mlx5_core_dev *dev, struct mlx5_eq *eq) { struct mlx5_eqe *eqe; @@ -347,6 +359,9 @@ static int mlx5_eq_int(struct mlx5_core_dev *dev, stru case MLX5_EVENT_TYPE_FPGA_QP_ERROR: mlx5_fpga_event(dev, eqe->type, &eqe->data.raw); break; + case MLX5_EVENT_TYPE_TEMP_WARN_EVENT: + mlx5_temp_warning_event(dev, eqe); + break; default: mlx5_core_warn(dev, "Unhandled event 0x%x on EQ 0x%x\n", @@ -540,6 +555,9 @@ int mlx5_start_eqs(struct mlx5_core_dev *dev) if (MLX5_CAP_GEN(dev, fpga)) async_event_mask |= (1ull << MLX5_EVENT_TYPE_FPGA_ERROR) | (1ull << MLX5_EVENT_TYPE_FPGA_QP_ERROR); + + if (MLX5_CAP_GEN(dev, temp_warn_event)) + async_event_mask |= (1ull << MLX5_EVENT_TYPE_TEMP_WARN_EVENT); err = mlx5_create_map_eq(dev, &table->cmd_eq, MLX5_EQ_VEC_CMD, MLX5_NUM_CMD_EQE, 1ull << MLX5_EVENT_TYPE_CMD, Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:27:29 2019 (r347249) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:28:18 2019 (r347250) @@ -50,7 +50,7 @@ enum { MLX5_EVENT_TYPE_PORT_CHANGE = 0x9, MLX5_EVENT_TYPE_GPIO_EVENT = 0x15, MLX5_EVENT_TYPE_CODING_PORT_MODULE_EVENT = 0x16, - MLX5_EVENT_TYPE_CODING_TEMP_WARNING_EVENT = 0x17, + MLX5_EVENT_TYPE_TEMP_WARN_EVENT = 0x17, MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19, MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT = 0x1e, MLX5_EVENT_TYPE_CODING_PPS_EVENT = 0x25, From owner-svn-src-all@freebsd.org Wed May 8 10:29:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C01D515A42EC; Wed, 8 May 2019 10:29:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6754B9596F; Wed, 8 May 2019 10:29:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E38D488E; Wed, 8 May 2019 10:29:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48ATkmb039347; Wed, 8 May 2019 10:29:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48ATk5B039346; Wed, 8 May 2019 10:29:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081029.x48ATk5B039346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347251 - head/sys/dev/mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 347251 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6754B9596F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:29:47 -0000 Author: hselasky Date: Wed May 8 10:29:45 2019 New Revision: 347251 URL: https://svnweb.freebsd.org/changeset/base/347251 Log: Import Linux code to implement mlx5_ib_disassociate_ucontext() in mlx5ib. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 10:28:18 2019 (r347250) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 10:29:45 2019 (r347251) @@ -1335,6 +1335,70 @@ static int mlx5_ib_set_vma_data(struct vm_area_struct return 0; } +static void mlx5_ib_disassociate_ucontext(struct ib_ucontext *ibcontext) +{ + int ret; + struct vm_area_struct *vma; + struct mlx5_ib_vma_private_data *vma_private, *n; + struct mlx5_ib_ucontext *context = to_mucontext(ibcontext); + struct task_struct *owning_process = NULL; + struct mm_struct *owning_mm = NULL; + + owning_process = get_pid_task(ibcontext->tgid, PIDTYPE_PID); + if (!owning_process) + return; + + owning_mm = get_task_mm(owning_process); + if (!owning_mm) { + pr_info("no mm, disassociate ucontext is pending task termination\n"); + while (1) { + put_task_struct(owning_process); + usleep_range(1000, 2000); + owning_process = get_pid_task(ibcontext->tgid, + PIDTYPE_PID); + if (!owning_process || owning_process->task_thread-> + td_proc->p_state == PRS_ZOMBIE) { + pr_info("disassociate ucontext done, task was terminated\n"); + /* in case task was dead need to release the + * task struct. + */ + if (owning_process) + put_task_struct(owning_process); + return; + } + } + } + + /* need to protect from a race on closing the vma as part of + * mlx5_ib_vma_close. + */ + down_write(&owning_mm->mmap_sem); + list_for_each_entry_safe(vma_private, n, &context->vma_private_list, + list) { + vma = vma_private->vma; + ret = zap_vma_ptes(vma, vma->vm_start, + PAGE_SIZE); + if (ret == -ENOTSUP) { + if (bootverbose) + WARN_ONCE( + "%s: zap_vma_ptes not implemented for unmanaged mappings", __func__); + } else { + WARN(ret, "%s: zap_vma_ptes failed, error %d", + __func__, -ret); + } + /* context going to be destroyed, should + * not access ops any more. + */ + /* XXXKIB vma->vm_flags &= ~(VM_SHARED | VM_MAYSHARE); */ + vma->vm_ops = NULL; + list_del(&vma_private->list); + kfree(vma_private); + } + up_write(&owning_mm->mmap_sem); + mmput(owning_mm); + put_task_struct(owning_process); +} + static inline char *mmap_cmd2str(enum mlx5_ib_mmap_cmd cmd) { switch (cmd) { @@ -3083,6 +3147,8 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) dev->ib_dev.get_vf_stats = mlx5_ib_get_vf_stats; dev->ib_dev.set_vf_guid = mlx5_ib_set_vf_guid; } + + dev->ib_dev.disassociate_ucontext = mlx5_ib_disassociate_ucontext; mlx5_ib_internal_fill_odp_caps(dev); From owner-svn-src-all@freebsd.org Wed May 8 10:30:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73BCF15A4362; Wed, 8 May 2019 10:30:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1567895AB1; Wed, 8 May 2019 10:30:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC07A4892; Wed, 8 May 2019 10:30:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AUJIa039452; Wed, 8 May 2019 10:30:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AUIus039449; Wed, 8 May 2019 10:30:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081030.x48AUIus039449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347252 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1567895AB1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:30:20 -0000 Author: hselasky Date: Wed May 8 10:30:18 2019 New Revision: 347252 URL: https://svnweb.freebsd.org/changeset/base/347252 Log: Disable all MSIX interrupts before shutdown in mlx5. Make sure the interrupt handlers don't race with the fast unload one code in the shutdown handler. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 10:29:45 2019 (r347251) +++ head/sys/dev/mlx5/driver.h Wed May 8 10:30:18 2019 (r347252) @@ -606,6 +606,7 @@ struct mlx5_priv { struct mlx5_irq_info *irq_info; struct mlx5_uuar_info uuari; MLX5_DECLARE_DOORBELL_LOCK(cq_uar_lock); + int disable_irqs; struct io_mapping *bf_mapping; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed May 8 10:29:45 2019 (r347251) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed May 8 10:30:18 2019 (r347252) @@ -1143,6 +1143,9 @@ static void mlx5_cmd_change_mod(struct mlx5_core_dev * struct mlx5_cmd *cmd = &dev->cmd; int i; + if (cmd->mode == mode) + return; + for (i = 0; i < cmd->max_reg_cmds; i++) down(&cmd->sem); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 8 10:29:45 2019 (r347251) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 8 10:30:18 2019 (r347252) @@ -395,7 +395,9 @@ static irqreturn_t mlx5_msix_handler(int irq, void *eq struct mlx5_eq *eq = eq_ptr; struct mlx5_core_dev *dev = eq->dev; - mlx5_eq_int(dev, eq); + /* check if IRQs are not disabled */ + if (likely(dev->priv.disable_irqs == 0)) + mlx5_eq_int(dev, eq); /* MSI-X vectors always belong to us */ return IRQ_HANDLED; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:29:45 2019 (r347251) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:30:18 2019 (r347252) @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -1443,11 +1444,29 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev * return 0; } +static void mlx5_disable_interrupts(struct mlx5_core_dev *mdev) +{ + int nvec = mdev->priv.eq_table.num_comp_vectors + MLX5_EQ_VEC_COMP_BASE; + int x; + + mdev->priv.disable_irqs = 1; + + /* wait for all IRQ handlers to finish processing */ + for (x = 0; x != nvec; x++) + synchronize_irq(mdev->priv.msix_arr[x].vector); +} + static void shutdown_one(struct pci_dev *pdev) { struct mlx5_core_dev *dev = pci_get_drvdata(pdev); struct mlx5_priv *priv = &dev->priv; int err; + + /* enter polling mode */ + mlx5_cmd_use_polling(dev); + + /* disable all interrupts */ + mlx5_disable_interrupts(dev); err = mlx5_try_fast_unload(dev); if (err) From owner-svn-src-all@freebsd.org Wed May 8 10:30:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB9D915A43CC; Wed, 8 May 2019 10:30:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80DE695D23; Wed, 8 May 2019 10:30:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BA1548AB; Wed, 8 May 2019 10:30:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AUmk6040982; Wed, 8 May 2019 10:30:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AUmpZ040980; Wed, 8 May 2019 10:30:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081030.x48AUmpZ040980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347253 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347253 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80DE695D23 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:30:49 -0000 Author: hselasky Date: Wed May 8 10:30:47 2019 New Revision: 347253 URL: https://svnweb.freebsd.org/changeset/base/347253 Log: Protect from infinite sw-reset loop in mlx5core. Avoid an infinite software firmware reset loop that may be caused by a hardware bug by limiting the maximum number of resets. The counter between resets is reset by request for reset, and not by a successful reset. The interval between two resets can be configured via sysctl: hw.mlx5.sw_reset_timeout which is global to all mlx5 devices in the system. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_health.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 10:30:18 2019 (r347252) +++ head/sys/dev/mlx5/driver.h Wed May 8 10:30:47 2019 (r347253) @@ -536,6 +536,7 @@ struct mlx5_core_health { unsigned long flags; struct work_struct work; struct delayed_work recover_work; + unsigned int last_reset_req; }; #ifdef RATELIMIT Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 10:30:18 2019 (r347252) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 10:30:47 2019 (r347253) @@ -64,6 +64,12 @@ SYSCTL_INT(_hw_mlx5, OID_AUTO, fw_reset_enable, CTLFLA &mlx5_fw_reset_enable, 0, "Enable firmware reset"); +static unsigned int sw_reset_to = 1200; +SYSCTL_UINT(_hw_mlx5, OID_AUTO, sw_reset_timeout, CTLFLAG_RWTUN, + &sw_reset_to, 0, + "Minimum timeout in seconds between two firmware resets"); + + static int lock_sem_sw_reset(struct mlx5_core_dev *dev) { int ret; @@ -218,6 +224,32 @@ static void reset_fw_if_needed(struct mlx5_core_dev *d &dev->iseg->cmdq_addr_l_sz); } +static bool +mlx5_health_allow_reset(struct mlx5_core_dev *dev) +{ + struct mlx5_core_health *health = &dev->priv.health; + unsigned int delta; + bool ret; + + if (health->last_reset_req != 0) { + delta = ticks - health->last_reset_req; + delta /= hz; + ret = delta >= sw_reset_to; + } else { + ret = true; + } + + /* + * In principle, ticks may be 0. Setting it to off by one (-1) + * to prevent certain reset in next request. + */ + health->last_reset_req = ticks ? : -1; + if (!ret) + mlx5_core_warn(dev, "Firmware reset elided due to " + "auto-reset frequency threshold.\n"); + return (ret); +} + #define MLX5_CRDUMP_WAIT_MS 60000 #define MLX5_FW_RESET_WAIT_MS 1000 #define MLX5_NIC_STATE_POLL_MS 5 @@ -243,7 +275,8 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, if (force) goto err_state_done; - if (fatal_error == MLX5_SENSOR_FW_SYND_RFR) { + if (fatal_error == MLX5_SENSOR_FW_SYND_RFR && + mlx5_health_allow_reset(dev)) { /* Get cr-dump and reset FW semaphore */ if (mlx5_core_is_pf(dev)) lock = lock_sem_sw_reset(dev); From owner-svn-src-all@freebsd.org Wed May 8 10:31:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20A2B15A4477; Wed, 8 May 2019 10:31:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B884E95F09; Wed, 8 May 2019 10:31:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 929BE48E0; Wed, 8 May 2019 10:31:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AVXn6044342; Wed, 8 May 2019 10:31:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AVXKK044339; Wed, 8 May 2019 10:31:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081031.x48AVXKK044339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347254 - in head/sys/dev/mlx5: . mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_en X-SVN-Commit-Revision: 347254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B884E95F09 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:31:34 -0000 Author: hselasky Date: Wed May 8 10:31:32 2019 New Revision: 347254 URL: https://svnweb.freebsd.org/changeset/base/347254 Log: Update Ethernet extended counters in mlx5en(4). Expose all Ethernet extended counters those counters via debug_stats sysctl: dev.mce.X.debug_stats Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:30:47 2019 (r347253) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:31:32 2019 (r347254) @@ -256,6 +256,28 @@ struct mlx5e_vport_stats { m(+1, u64 out_multicast_pkts, "out_multicast_pkts", "Out multicast packets") \ m(+1, u64 out_broadcast_pkts, "out_broadcast_pkts", "Out broadcast packets") +#define MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(m) \ + m(+1, u64 port_transmit_wait_high, "port_transmit_wait_high", "Port transmit wait high") \ + m(+1, u64 ecn_marked, "ecn_marked", "ECN marked") \ + m(+1, u64 no_buffer_discard_mc, "no_buffer_discard_mc", "No buffer discard mc") \ + m(+1, u64 rx_ebp, "rx_ebp", "RX EBP") \ + m(+1, u64 tx_ebp, "tx_ebp", "TX EBP") \ + m(+1, u64 rx_buffer_almost_full, "rx_buffer_almost_full", "RX buffer almost full") \ + m(+1, u64 rx_buffer_full, "rx_buffer_full", "RX buffer full") \ + m(+1, u64 rx_icrc_encapsulated, "rx_icrc_encapsulated", "RX ICRC encapsulated") \ + m(+1, u64 ex_reserved_0, "ex_reserved_0", "Reserved") \ + m(+1, u64 ex_reserved_1, "ex_reserved_1", "Reserved") \ + m(+1, u64 tx_stat_p64octets, "tx_stat_p64octets", "Bytes") \ + m(+1, u64 tx_stat_p65to127octets, "tx_stat_p65to127octets", "Bytes") \ + m(+1, u64 tx_stat_p128to255octets, "tx_stat_p128to255octets", "Bytes") \ + m(+1, u64 tx_stat_p256to511octets, "tx_stat_p256to511octets", "Bytes") \ + m(+1, u64 tx_stat_p512to1023octets, "tx_stat_p512to1023octets", "Bytes") \ + m(+1, u64 tx_stat_p1024to1518octets, "tx_stat_p1024to1518octets", "Bytes") \ + m(+1, u64 tx_stat_p1519to2047octets, "tx_stat_p1519to2047octets", "Bytes") \ + m(+1, u64 tx_stat_p2048to4095octets, "tx_stat_p2048to4095octets", "Bytes") \ + m(+1, u64 tx_stat_p4096to8191octets, "tx_stat_p4096to8191octets", "Bytes") \ + m(+1, u64 tx_stat_p8192to10239octets, "tx_stat_p8192to10239octets", "Bytes") + #define MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(m) \ m(+1, u64 time_since_last_clear, "time_since_last_clear", \ "Time since the last counters clear event (msec)") \ @@ -350,7 +372,8 @@ struct mlx5e_vport_stats { #define MLX5E_PORT_STATS_DEBUG(m) \ MLX5E_PPORT_RFC2819_STATS_DEBUG(m) \ MLX5E_PPORT_RFC2863_STATS_DEBUG(m) \ - MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(m) + MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(m) \ + MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(m) #define MLX5E_PPORT_IEEE802_3_STATS_NUM \ (0 MLX5E_PPORT_IEEE802_3_STATS(MLX5E_STATS_COUNT)) @@ -367,6 +390,8 @@ struct mlx5e_vport_stats { (0 MLX5E_PPORT_RFC2863_STATS_DEBUG(MLX5E_STATS_COUNT)) #define MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG_NUM \ (0 MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(MLX5E_STATS_COUNT)) +#define MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG_NUM \ + (0 MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(MLX5E_STATS_COUNT)) #define MLX5E_PORT_STATS_DEBUG_NUM \ (0 MLX5E_PORT_STATS_DEBUG(MLX5E_STATS_COUNT)) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:30:47 2019 (r347253) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:31:32 2019 (r347254) @@ -440,6 +440,12 @@ mlx5e_update_pport_counters(struct mlx5e_priv *priv) for (x = 0; x != MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); + /* read Extended Ethernet counter group using predefined counter layout */ + MLX5_SET(ppcnt_reg, in, grp, MLX5_ETHERNET_EXTENDED_COUNTERS_GROUP); + mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); + for (x = 0; x != MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG_NUM; x++, y++) + s_debug->arg[y] = be64toh(ptr[x]); + /* read per-priority counters */ MLX5_SET(ppcnt_reg, in, grp, MLX5_PER_PRIORITY_COUNTERS_GROUP); @@ -453,6 +459,7 @@ mlx5e_update_pport_counters(struct mlx5e_priv *priv) MLX5E_PPORT_PER_PRIO_STATS_NUM_PRIO); x++, y++) s->arg[y] = be64toh(ptr[x]); } + free_out: /* free firmware request structures */ kvfree(in); Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:30:47 2019 (r347253) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:31:32 2019 (r347254) @@ -8752,7 +8752,69 @@ struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bit u8 no_buffer_discard_mc_low[0x20]; - u8 reserved_0[0x700]; + u8 rx_ebp_high[0x20]; + + u8 rx_ebp_low[0x20]; + + u8 tx_ebp_high[0x20]; + + u8 tx_ebp_low[0x20]; + + u8 rx_buffer_almost_full_high[0x20]; + + u8 rx_buffer_almost_full_low[0x20]; + + u8 rx_buffer_full_high[0x20]; + + u8 rx_buffer_full_low[0x20]; + + u8 rx_icrc_encapsulated_high[0x20]; + + u8 rx_icrc_encapsulated_low[0x20]; + + u8 reserved_0[0x80]; + + u8 tx_stats_pkts64octets_high[0x20]; + + u8 tx_stats_pkts64octets_low[0x20]; + + u8 tx_stats_pkts65to127octets_high[0x20]; + + u8 tx_stats_pkts65to127octets_low[0x20]; + + u8 tx_stats_pkts128to255octets_high[0x20]; + + u8 tx_stats_pkts128to255octets_low[0x20]; + + u8 tx_stats_pkts256to511octets_high[0x20]; + + u8 tx_stats_pkts256to511octets_low[0x20]; + + u8 tx_stats_pkts512to1023octets_high[0x20]; + + u8 tx_stats_pkts512to1023octets_low[0x20]; + + u8 tx_stats_pkts1024to1518octets_high[0x20]; + + u8 tx_stats_pkts1024to1518octets_low[0x20]; + + u8 tx_stats_pkts1519to2047octets_high[0x20]; + + u8 tx_stats_pkts1519to2047octets_low[0x20]; + + u8 tx_stats_pkts2048to4095octets_high[0x20]; + + u8 tx_stats_pkts2048to4095octets_low[0x20]; + + u8 tx_stats_pkts4096to8191octets_high[0x20]; + + u8 tx_stats_pkts4096to8191octets_low[0x20]; + + u8 tx_stats_pkts8192to10239octets_high[0x20]; + + u8 tx_stats_pkts8192to10239octets_low[0x20]; + + u8 reserved_1[0x2C0]; }; struct mlx5_ifc_eth_802_3_cntrs_grp_data_layout_bits { From owner-svn-src-all@freebsd.org Wed May 8 10:32:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08A9E15A44E6; Wed, 8 May 2019 10:32:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A55899610D; Wed, 8 May 2019 10:32:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8016D4A11; Wed, 8 May 2019 10:32:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AW37Y044422; Wed, 8 May 2019 10:32:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AW3Dl044421; Wed, 8 May 2019 10:32:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081032.x48AW3Dl044421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347255 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A55899610D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:32:04 -0000 Author: hselasky Date: Wed May 8 10:32:03 2019 New Revision: 347255 URL: https://svnweb.freebsd.org/changeset/base/347255 Log: Fix tx_jumbo_packets counter in mlx5en(4). Instead of reading Ethernet RFC 2819 pXtoYoctets counters from hardware which counts RX octets, count tx_stat_pXtoYoctets from Ethernet extended counters which counts TX octets. TX jumbo counters should be accumulated only after the PPCNT counters were fetched from hardware with their latest value. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:31:32 2019 (r347254) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:32:03 2019 (r347255) @@ -540,12 +540,6 @@ mlx5e_update_stats_work(struct work_struct *work) } } - s->tx_jumbo_packets = - priv->stats.port_stats_debug.p1519to2047octets + - priv->stats.port_stats_debug.p2048to4095octets + - priv->stats.port_stats_debug.p4096to8191octets + - priv->stats.port_stats_debug.p8192to10239octets; - /* update counters */ s->tso_packets = tso_packets; s->tso_bytes = tso_bytes; @@ -644,6 +638,12 @@ mlx5e_update_stats_work(struct work_struct *work) /* Get physical port counters */ mlx5e_update_pport_counters(priv); + + s->tx_jumbo_packets = + priv->stats.port_stats_debug.tx_stat_p1519to2047octets + + priv->stats.port_stats_debug.tx_stat_p2048to4095octets + + priv->stats.port_stats_debug.tx_stat_p4096to8191octets + + priv->stats.port_stats_debug.tx_stat_p8192to10239octets; #if (__FreeBSD_version < 1100000) /* no get_counters interface in fbsd 10 */ From owner-svn-src-all@freebsd.org Wed May 8 10:32:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DD2315A4684; Wed, 8 May 2019 10:32:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6EAE96267; Wed, 8 May 2019 10:32:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 922554A2A; Wed, 8 May 2019 10:32:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AWNnm044485; Wed, 8 May 2019 10:32:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AWNIO044483; Wed, 8 May 2019 10:32:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081032.x48AWNIO044483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347256 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B6EAE96267 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:32:24 -0000 Author: hselasky Date: Wed May 8 10:32:22 2019 New Revision: 347256 URL: https://svnweb.freebsd.org/changeset/base/347256 Log: Destroy port stats debug context in correct order in mlx5en(4). Destroy children nodes before parent nodes. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed May 8 10:32:03 2019 (r347255) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed May 8 10:32:22 2019 (r347256) @@ -1063,6 +1063,10 @@ mlx5e_ethtool_debug_stats(SYSCTL_HANDLER_ARGS) int error; PRIV_LOCK(priv); + if (priv->gone != 0) { + error = ENODEV; + goto done; + } sys_debug = priv->sysctl_debug; error = sysctl_handle_int(oidp, &sys_debug, 0, req); if (error != 0 || !req->newptr) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:32:03 2019 (r347255) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:32:22 2019 (r347256) @@ -4089,9 +4089,9 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vp /* destroy all remaining sysctl nodes */ sysctl_ctx_free(&priv->stats.vport.ctx); sysctl_ctx_free(&priv->stats.pport.ctx); - sysctl_ctx_free(&priv->sysctl_ctx); if (priv->sysctl_debug) sysctl_ctx_free(&priv->stats.port_stats_debug.ctx); + sysctl_ctx_free(&priv->sysctl_ctx); mlx5_core_destroy_mkey(priv->mdev, &priv->mr); mlx5_dealloc_transport_domain(priv->mdev, priv->tdn); From owner-svn-src-all@freebsd.org Wed May 8 10:32:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2E5A15A4727; Wed, 8 May 2019 10:32:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76B96963D2; Wed, 8 May 2019 10:32:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51B184A32; Wed, 8 May 2019 10:32:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AWkC5044556; Wed, 8 May 2019 10:32:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AWkRA044555; Wed, 8 May 2019 10:32:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081032.x48AWkRA044555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347257 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 347257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76B96963D2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:32:47 -0000 Author: hselasky Date: Wed May 8 10:32:45 2019 New Revision: 347257 URL: https://svnweb.freebsd.org/changeset/base/347257 Log: Make sure to error out when arming the CQ fails in ibcore. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Modified: head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Wed May 8 10:32:22 2019 (r347256) +++ head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Wed May 8 10:32:45 2019 (r347257) @@ -1692,6 +1692,7 @@ ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_file { struct ib_uverbs_req_notify_cq cmd; struct ib_cq *cq; + int retval; if (copy_from_user(&cmd, buf, sizeof cmd)) return -EFAULT; @@ -1700,12 +1701,15 @@ ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_file if (!cq) return -EINVAL; - ib_req_notify_cq(cq, cmd.solicited_only ? - IB_CQ_SOLICITED : IB_CQ_NEXT_COMP); + if (ib_req_notify_cq(cq, cmd.solicited_only ? + IB_CQ_SOLICITED : IB_CQ_NEXT_COMP) < 0) + retval = -ENXIO; + else + retval = in_len; put_cq_read(cq); - return in_len; + return retval; } ssize_t ib_uverbs_destroy_cq(struct ib_uverbs_file *file, From owner-svn-src-all@freebsd.org Wed May 8 10:33:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 085CD15A478D; Wed, 8 May 2019 10:33:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8354696526; Wed, 8 May 2019 10:33:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41ECC4A33; Wed, 8 May 2019 10:33:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AXAen044647; Wed, 8 May 2019 10:33:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AX9MV044643; Wed, 8 May 2019 10:33:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081033.x48AX9MV044643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347258 - in head/sys/dev: mlx4/mlx4_ib mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev: mlx4/mlx4_ib mlx5/mlx5_ib X-SVN-Commit-Revision: 347258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8354696526 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:33:11 -0000 Author: hselasky Date: Wed May 8 10:33:09 2019 New Revision: 347258 URL: https://svnweb.freebsd.org/changeset/base/347258 Log: Make sure to error out when arming the CQ fails in mlx4ib and mlx5ib. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_cq.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_cq.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_cq.c Wed May 8 10:32:45 2019 (r347257) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_cq.c Wed May 8 10:33:09 2019 (r347258) @@ -878,7 +878,8 @@ int mlx4_ib_poll_cq(struct ib_cq *ibcq, int num_entrie struct mlx4_ib_dev *mdev = to_mdev(cq->ibcq.device); spin_lock_irqsave(&cq->lock, flags); - if (mdev->dev->persist->state & MLX4_DEVICE_STATE_INTERNAL_ERROR) { + if (unlikely(mdev->dev->persist->state & + MLX4_DEVICE_STATE_INTERNAL_ERROR)) { mlx4_ib_poll_sw_comp(cq, num_entries, wc, &npolled); goto out; } @@ -898,11 +899,18 @@ out: int mlx4_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags) { - mlx4_cq_arm(&to_mcq(ibcq)->mcq, + struct mlx4_ib_cq *cq = to_mcq(ibcq); + struct mlx4_ib_dev *mdev = to_mdev(cq->ibcq.device); + + if (unlikely(mdev->dev->persist->state & + MLX4_DEVICE_STATE_INTERNAL_ERROR)) + return -1; + + mlx4_cq_arm(&cq->mcq, (flags & IB_CQ_SOLICITED_MASK) == IB_CQ_SOLICITED ? MLX4_CQ_DB_REQ_NOT_SOL : MLX4_CQ_DB_REQ_NOT, - to_mdev(ibcq->device)->uar_map, - MLX4_GET_DOORBELL_LOCK(&to_mdev(ibcq->device)->uar_lock)); + mdev->uar_map, + MLX4_GET_DOORBELL_LOCK(&mdev->uar_lock)); return 0; } Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c Wed May 8 10:32:45 2019 (r347257) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c Wed May 8 10:33:09 2019 (r347258) @@ -673,7 +673,7 @@ int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entrie int npolled; spin_lock_irqsave(&cq->lock, flags); - if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { + if (unlikely(mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)) { mlx5_ib_poll_sw_comp(cq, num_entries, wc, &npolled); goto out; } @@ -702,6 +702,9 @@ int mlx5_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_noti unsigned long irq_flags; int ret = 0; + if (unlikely(mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)) + return -1; + spin_lock_irqsave(&cq->lock, irq_flags); if (cq->notify_flags != IB_CQ_NEXT_COMP) cq->notify_flags = flags & IB_CQ_SOLICITED_MASK; @@ -715,7 +718,7 @@ int mlx5_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_noti MLX5_CQ_DB_REQ_NOT_SOL : MLX5_CQ_DB_REQ_NOT, uar_page, MLX5_GET_DOORBELL_LOCK(&mdev->priv.cq_uar_lock), - to_mcq(ibcq)->mcq.cons_index); + cq->mcq.cons_index); return ret; } From owner-svn-src-all@freebsd.org Wed May 8 10:33:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C74415A47E6; Wed, 8 May 2019 10:33:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E88A696656; Wed, 8 May 2019 10:33:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C44344A34; Wed, 8 May 2019 10:33:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AXT02044717; Wed, 8 May 2019 10:33:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AXTRB044716; Wed, 8 May 2019 10:33:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081033.x48AXTRB044716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347259 - head/sys/dev/mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 347259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E88A696656 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:33:30 -0000 Author: hselasky Date: Wed May 8 10:33:29 2019 New Revision: 347259 URL: https://svnweb.freebsd.org/changeset/base/347259 Log: Remove unused module parameter in mlx5ib. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 10:33:09 2019 (r347258) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 10:33:29 2019 (r347259) @@ -63,10 +63,6 @@ MODULE_DEPEND(mlx5ib, mlx5, 1, 1, 1); MODULE_DEPEND(mlx5ib, ibcore, 1, 1, 1); MODULE_VERSION(mlx5ib, 1); -static int deprecated_prof_sel = 2; -module_param_named(prof_sel, deprecated_prof_sel, int, 0444); -MODULE_PARM_DESC(prof_sel, "profile selector. Deprecated here. Moved to module mlx5_core"); - static const char mlx5_version[] = DRIVER_NAME ": Mellanox Connect-IB Infiniband driver " DRIVER_VERSION " (" DRIVER_RELDATE ")\n"; @@ -3300,9 +3296,6 @@ static struct mlx5_interface mlx5_ib_interface = { static int __init mlx5_ib_init(void) { int err; - - if (deprecated_prof_sel != 2) - pr_warn("prof_sel is deprecated for mlx5_ib, set it for mlx5_core\n"); err = mlx5_ib_odp_init(); if (err) From owner-svn-src-all@freebsd.org Wed May 8 10:34:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48E8515A48D9; Wed, 8 May 2019 10:34:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1C9E9680D; Wed, 8 May 2019 10:34:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD0E64A35; Wed, 8 May 2019 10:34:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AYF0e044802; Wed, 8 May 2019 10:34:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AYF7H044799; Wed, 8 May 2019 10:34:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081034.x48AYF7H044799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347260 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D1C9E9680D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:34:16 -0000 Author: hselasky Date: Wed May 8 10:34:14 2019 New Revision: 347260 URL: https://svnweb.freebsd.org/changeset/base/347260 Log: Correct number of elements for priority to traffic class mappings in mlx5en(4). The number of priorities is always 8, while the number of traffic classes supported can vary. While at it convert the sysctl node into an array. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:33:29 2019 (r347259) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:34:14 2019 (r347260) @@ -74,6 +74,9 @@ #include #include +#define MLX5E_MAX_PRIORITY 8 + +/* IEEE 802.1Qaz standard supported values */ #define IEEE_8021QAZ_MAX_TCS 8 #define MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE 0x7 @@ -483,10 +486,10 @@ struct mlx5e_params { u16 rx_hash_log_tbl_sz; u32 tx_pauseframe_control __aligned(4); u32 rx_pauseframe_control __aligned(4); - u32 tx_priority_flow_control __aligned(4); - u32 rx_priority_flow_control __aligned(4); u16 tx_max_inline; u8 tx_min_inline_mode; + u8 tx_priority_flow_control; + u8 rx_priority_flow_control; u8 channels_rsss; }; @@ -525,7 +528,7 @@ struct mlx5e_params_ethtool { MLX5E_PARAMS(MLX5E_STATS_VAR) u64 max_bw_value[IEEE_8021QAZ_MAX_TCS]; u8 max_bw_share[IEEE_8021QAZ_MAX_TCS]; - u8 prio_tc[IEEE_8021QAZ_MAX_TCS]; + u8 prio_tc[MLX5E_MAX_PRIORITY]; u8 dscp2prio[MLX5_MAX_SUPPORTED_DSCP]; u8 trust_state; }; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed May 8 10:33:29 2019 (r347259) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed May 8 10:34:14 2019 (r347260) @@ -298,8 +298,8 @@ mlx5e_get_prio_tc(struct mlx5e_priv *priv) return (EOPNOTSUPP); } - for (i = 0; i <= mlx5_max_tc(priv->mdev); i++) { - err = -mlx5_query_port_prio_tc(mdev, i, &(priv->params_ethtool.prio_tc[i])); + for (i = 0; i != MLX5E_MAX_PRIORITY; i++) { + err = -mlx5_query_port_prio_tc(mdev, i, priv->params_ethtool.prio_tc + i); if (err) break; } @@ -311,29 +311,35 @@ static int mlx5e_prio_to_tc_handler(SYSCTL_HANDLER_ARGS) { struct mlx5e_priv *priv = arg1; - int prio_index = arg2; struct mlx5_core_dev *mdev = priv->mdev; + uint8_t temp[MLX5E_MAX_PRIORITY]; int err; - uint8_t result; + int i; PRIV_LOCK(priv); - result = priv->params_ethtool.prio_tc[prio_index]; - err = sysctl_handle_8(oidp, &result, 0, req); - if (err || !req->newptr || - result == priv->params_ethtool.prio_tc[prio_index]) + err = SYSCTL_OUT(req, priv->params_ethtool.prio_tc, MLX5E_MAX_PRIORITY); + if (err || !req->newptr) goto done; - - if (result > mlx5_max_tc(mdev)) { - err = ERANGE; - goto done; - } - - err = -mlx5_set_port_prio_tc(mdev, prio_index, result); + err = SYSCTL_IN(req, temp, MLX5E_MAX_PRIORITY); if (err) goto done; - priv->params_ethtool.prio_tc[prio_index] = result; + for (i = 0; i != MLX5E_MAX_PRIORITY; i++) { + if (temp[i] > mlx5_max_tc(mdev)) { + err = ERANGE; + goto done; + } + } + for (i = 0; i != MLX5E_MAX_PRIORITY; i++) { + if (temp[i] == priv->params_ethtool.prio_tc[i]) + continue; + err = -mlx5_set_port_prio_tc(mdev, i, temp[i]); + if (err) + goto done; + /* update cached value */ + priv->params_ethtool.prio_tc[i] = temp[i]; + } done: PRIV_UNLOCK(priv); return (err); @@ -1262,14 +1268,10 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) /* Priority to traffic class mapping */ if (mlx5e_get_prio_tc(priv) == 0) { - for (i = 0; i <= mlx5_max_tc(mdev); i++) { - char name[32]; - snprintf(name, sizeof(name), "prio_%d_to_tc", i); - SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(qos_node), - OID_AUTO, name, CTLTYPE_U8 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, - priv, i, mlx5e_prio_to_tc_handler, "CU", - "Set priority to traffic class"); - } + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(qos_node), + OID_AUTO, "prio_0_7_tc", CTLTYPE_U8 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + priv, 0, mlx5e_prio_to_tc_handler, "CU", + "Set traffic class 0 to 7 for priority 0 to 7 inclusivly"); } /* DSCP support */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:33:29 2019 (r347259) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:34:14 2019 (r347260) @@ -281,7 +281,9 @@ mlx5e_set_port_pfc(struct mlx5e_priv *priv) { int error; - if (priv->params.rx_pauseframe_control || + if (priv->gone != 0) { + error = -ENXIO; + } else if (priv->params.rx_pauseframe_control || priv->params.tx_pauseframe_control) { if_printf(priv->ifp, "Global pauseframes must be disabled before enabling PFC.\n"); @@ -3443,79 +3445,98 @@ static int mlx5e_sysctl_tx_priority_flow_control(SYSCTL_HANDLER_ARGS) { struct mlx5e_priv *priv = arg1; + uint8_t temp[MLX5E_MAX_PRIORITY]; uint32_t tx_pfc; - uint32_t value; - int error; + int err; + int i; PRIV_LOCK(priv); tx_pfc = priv->params.tx_priority_flow_control; - /* get current value */ - value = (tx_pfc >> arg2) & 1; + for (i = 0; i != MLX5E_MAX_PRIORITY; i++) + temp[i] = (tx_pfc >> i) & 1; - error = sysctl_handle_32(oidp, &value, 0, req); + err = SYSCTL_OUT(req, temp, MLX5E_MAX_PRIORITY); + if (err || !req->newptr) + goto done; + err = SYSCTL_IN(req, temp, MLX5E_MAX_PRIORITY); + if (err) + goto done; - /* range check value */ - if (value != 0) - priv->params.tx_priority_flow_control |= (1 << arg2); - else - priv->params.tx_priority_flow_control &= ~(1 << arg2); + priv->params.tx_priority_flow_control = 0; - /* check if update is required */ - if (error == 0 && priv->gone == 0 && - tx_pfc != priv->params.tx_priority_flow_control) { - error = -mlx5e_set_port_pfc(priv); - /* restore previous value */ - if (error != 0) - priv->params.tx_priority_flow_control= tx_pfc; + /* range check input value */ + for (i = 0; i != MLX5E_MAX_PRIORITY; i++) { + if (temp[i] > 1) { + err = ERANGE; + goto done; + } + priv->params.tx_priority_flow_control |= (temp[i] << i); } + + /* check if update is required */ + if (tx_pfc != priv->params.tx_priority_flow_control) + err = -mlx5e_set_port_pfc(priv); +done: + if (err != 0) + priv->params.tx_priority_flow_control= tx_pfc; PRIV_UNLOCK(priv); - return (error); + return (err); } static int mlx5e_sysctl_rx_priority_flow_control(SYSCTL_HANDLER_ARGS) { struct mlx5e_priv *priv = arg1; + uint8_t temp[MLX5E_MAX_PRIORITY]; uint32_t rx_pfc; - uint32_t value; - int error; + int err; + int i; PRIV_LOCK(priv); rx_pfc = priv->params.rx_priority_flow_control; - /* get current value */ - value = (rx_pfc >> arg2) & 1; + for (i = 0; i != MLX5E_MAX_PRIORITY; i++) + temp[i] = (rx_pfc >> i) & 1; - error = sysctl_handle_32(oidp, &value, 0, req); + err = SYSCTL_OUT(req, temp, MLX5E_MAX_PRIORITY); + if (err || !req->newptr) + goto done; + err = SYSCTL_IN(req, temp, MLX5E_MAX_PRIORITY); + if (err) + goto done; - /* range check value */ - if (value != 0) - priv->params.rx_priority_flow_control |= (1 << arg2); - else - priv->params.rx_priority_flow_control &= ~(1 << arg2); + priv->params.rx_priority_flow_control = 0; - /* check if update is required */ - if (error == 0 && priv->gone == 0 && - rx_pfc != priv->params.rx_priority_flow_control) { - error = -mlx5e_set_port_pfc(priv); - /* restore previous value */ - if (error != 0) - priv->params.rx_priority_flow_control= rx_pfc; + /* range check input value */ + for (i = 0; i != MLX5E_MAX_PRIORITY; i++) { + if (temp[i] > 1) { + err = ERANGE; + goto done; + } + priv->params.rx_priority_flow_control |= (temp[i] << i); } + + /* check if update is required */ + if (rx_pfc != priv->params.rx_priority_flow_control) + err = -mlx5e_set_port_pfc(priv); +done: + if (err != 0) + priv->params.rx_priority_flow_control= rx_pfc; PRIV_UNLOCK(priv); - return (error); + return (err); } static void mlx5e_setup_pauseframes(struct mlx5e_priv *priv) { - unsigned int x; +#if (__FreeBSD_version < 1100000) char path[96]; +#endif int error; /* enable pauseframes by default */ @@ -3540,25 +3561,6 @@ mlx5e_setup_pauseframes(struct mlx5e_priv *priv) /* try to fetch tunable, if any */ TUNABLE_INT_FETCH(path, &priv->params.rx_pauseframe_control); - - for (x = 0; x != 8; x++) { - - /* compute path for sysctl */ - snprintf(path, sizeof(path), "dev.mce.%d.tx_priority_flow_control_%u", - device_get_unit(priv->mdev->pdev->dev.bsddev), x); - - /* try to fetch tunable, if any */ - if (TUNABLE_INT_FETCH(path, &value) == 0 && value != 0) - priv->params.tx_priority_flow_control |= 1 << x; - - /* compute path for sysctl */ - snprintf(path, sizeof(path), "dev.mce.%d.rx_priority_flow_control_%u", - device_get_unit(priv->mdev->pdev->dev.bsddev), x); - - /* try to fetch tunable, if any */ - if (TUNABLE_INT_FETCH(path, &value) == 0 && value != 0) - priv->params.rx_priority_flow_control |= 1 << x; - } #endif /* register pauseframe SYSCTLs */ @@ -3572,22 +3574,16 @@ mlx5e_setup_pauseframes(struct mlx5e_priv *priv) &priv->params.rx_pauseframe_control, 0, "Set to enable RX pause frames. Clear to disable."); - /* register priority_flow control, PFC, SYSCTLs */ - for (x = 0; x != 8; x++) { - snprintf(path, sizeof(path), "tx_priority_flow_control_%u", x); + /* register priority flow control, PFC, SYSCTLs */ + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), + OID_AUTO, "tx_priority_flow_control", CTLTYPE_U8 | CTLFLAG_RWTUN | + CTLFLAG_MPSAFE, priv, 0, &mlx5e_sysctl_tx_priority_flow_control, "CU", + "Set to enable TX ports flow control frames for priorities 0..7. Clear to disable."); - SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), - OID_AUTO, path, CTLTYPE_UINT | CTLFLAG_RWTUN | - CTLFLAG_MPSAFE, priv, x, &mlx5e_sysctl_tx_priority_flow_control, "IU", - "Set to enable TX ports flow control frames for given priority. Clear to disable."); - - snprintf(path, sizeof(path), "rx_priority_flow_control_%u", x); - - SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), - OID_AUTO, path, CTLTYPE_UINT | CTLFLAG_RWTUN | - CTLFLAG_MPSAFE, priv, x, &mlx5e_sysctl_rx_priority_flow_control, "IU", - "Set to enable RX ports flow control frames for given priority. Clear to disable."); - } + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), + OID_AUTO, "rx_priority_flow_control", CTLTYPE_U8 | CTLFLAG_RWTUN | + CTLFLAG_MPSAFE, priv, 0, &mlx5e_sysctl_rx_priority_flow_control, "CU", + "Set to enable RX ports flow control frames for priorities 0..7. Clear to disable."); PRIV_LOCK(priv); From owner-svn-src-all@freebsd.org Wed May 8 10:34:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72B3F15A4950; Wed, 8 May 2019 10:34:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19F5A96950; Wed, 8 May 2019 10:34:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BA064A36; Wed, 8 May 2019 10:34:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AYgF0044876; Wed, 8 May 2019 10:34:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AYgb0044875; Wed, 8 May 2019 10:34:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081034.x48AYgb0044875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347261 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19F5A96950 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:34:43 -0000 Author: hselasky Date: Wed May 8 10:34:42 2019 New Revision: 347261 URL: https://svnweb.freebsd.org/changeset/base/347261 Log: Implement fast close of RX channel in mlx5en(4). Instead of waiting for all jobs to be cancelled, simply close the completion queue to prevent more completion events and let mlx5e_destroy_rq() cleanup the remaining mbufs. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:34:14 2019 (r347260) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:34:42 2019 (r347261) @@ -1136,17 +1136,10 @@ mlx5e_close_rq(struct mlx5e_rq *rq) static void mlx5e_close_rq_wait(struct mlx5e_rq *rq) { - struct mlx5_core_dev *mdev = rq->channel->priv->mdev; - /* wait till RQ is empty */ - while (!mlx5_wq_ll_is_empty(&rq->wq) && - (mdev->state != MLX5_DEVICE_STATE_INTERNAL_ERROR)) { - msleep(4); - rq->cq.mcq.comp(&rq->cq.mcq); - } - - cancel_work_sync(&rq->dim.work); mlx5e_disable_rq(rq); + mlx5e_close_cq(&rq->cq); + cancel_work_sync(&rq->dim.work); mlx5e_destroy_rq(rq); } @@ -1861,7 +1854,6 @@ mlx5e_close_channel_wait(struct mlx5e_channel *c) { mlx5e_close_rq_wait(&c->rq); mlx5e_close_sqs_wait(c); - mlx5e_close_cq(&c->rq.cq); mlx5e_close_tx_cqs(c); /* destroy mutexes */ mlx5e_chan_mtx_destroy(c); From owner-svn-src-all@freebsd.org Wed May 8 10:35:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F232515A49DD; Wed, 8 May 2019 10:35:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95A2D96A7D; Wed, 8 May 2019 10:35:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 705014A37; Wed, 8 May 2019 10:35:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AZEVD044968; Wed, 8 May 2019 10:35:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AZEhH044967; Wed, 8 May 2019 10:35:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081035.x48AZEhH044967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347262 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 95A2D96A7D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:35:15 -0000 Author: hselasky Date: Wed May 8 10:35:14 2019 New Revision: 347262 URL: https://svnweb.freebsd.org/changeset/base/347262 Log: Split mlx5e_update_stats_work() in mlx5en(4). Split the function into the mlx5e_update_stats_locked() core and make mlx5e_update_stats_work() call the _locked helper, similar to many other places in the kernel. This improves the code structure, making the locking clean. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:34:42 2019 (r347261) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:35:14 2019 (r347262) @@ -475,10 +475,8 @@ free_out: * configuration lock. */ static void -mlx5e_update_stats_work(struct work_struct *work) +mlx5e_update_stats_locked(struct mlx5e_priv *priv) { - struct mlx5e_priv *priv = container_of(work, struct mlx5e_priv, - update_stats_work); struct mlx5_core_dev *mdev = priv->mdev; struct mlx5e_vport_stats *s = &priv->stats.vport; struct mlx5e_sq_stats *sq_stats; @@ -505,12 +503,9 @@ mlx5e_update_stats_work(struct work_struct *work) int i; int j; - PRIV_LOCK(priv); out = mlx5_vzalloc(outlen); if (out == NULL) goto free_out; - if (test_bit(MLX5E_STATE_OPENED, &priv->state) == 0) - goto free_out; /* Collect firts the SW counters and then HW for consistency */ for (i = 0; i < priv->params.num_channels; i++) { @@ -565,78 +560,70 @@ mlx5e_update_stats_work(struct work_struct *work) memset(out, 0, outlen); /* get number of out-of-buffer drops first */ - if (mlx5_vport_query_out_of_rx_buffer(mdev, priv->counter_set_id, - &rx_out_of_buffer)) - goto free_out; + if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0 && + mlx5_vport_query_out_of_rx_buffer(mdev, priv->counter_set_id, + &rx_out_of_buffer) == 0) { + /* accumulate difference into a 64-bit counter */ + s->rx_out_of_buffer += (u64)(u32)(rx_out_of_buffer - + s->rx_out_of_buffer_prev); + s->rx_out_of_buffer_prev = rx_out_of_buffer; + } - /* accumulate difference into a 64-bit counter */ - s->rx_out_of_buffer += (u64)(u32)(rx_out_of_buffer - s->rx_out_of_buffer_prev); - s->rx_out_of_buffer_prev = rx_out_of_buffer; - /* get port statistics */ - if (mlx5_cmd_exec(mdev, in, sizeof(in), out, outlen)) - goto free_out; - + if (mlx5_cmd_exec(mdev, in, sizeof(in), out, outlen) == 0) { #define MLX5_GET_CTR(out, x) \ MLX5_GET64(query_vport_counter_out, out, x) - s->rx_error_packets = - MLX5_GET_CTR(out, received_errors.packets); - s->rx_error_bytes = - MLX5_GET_CTR(out, received_errors.octets); - s->tx_error_packets = - MLX5_GET_CTR(out, transmit_errors.packets); - s->tx_error_bytes = - MLX5_GET_CTR(out, transmit_errors.octets); + s->rx_error_packets = + MLX5_GET_CTR(out, received_errors.packets); + s->rx_error_bytes = + MLX5_GET_CTR(out, received_errors.octets); + s->tx_error_packets = + MLX5_GET_CTR(out, transmit_errors.packets); + s->tx_error_bytes = + MLX5_GET_CTR(out, transmit_errors.octets); - s->rx_unicast_packets = - MLX5_GET_CTR(out, received_eth_unicast.packets); - s->rx_unicast_bytes = - MLX5_GET_CTR(out, received_eth_unicast.octets); - s->tx_unicast_packets = - MLX5_GET_CTR(out, transmitted_eth_unicast.packets); - s->tx_unicast_bytes = - MLX5_GET_CTR(out, transmitted_eth_unicast.octets); + s->rx_unicast_packets = + MLX5_GET_CTR(out, received_eth_unicast.packets); + s->rx_unicast_bytes = + MLX5_GET_CTR(out, received_eth_unicast.octets); + s->tx_unicast_packets = + MLX5_GET_CTR(out, transmitted_eth_unicast.packets); + s->tx_unicast_bytes = + MLX5_GET_CTR(out, transmitted_eth_unicast.octets); - s->rx_multicast_packets = - MLX5_GET_CTR(out, received_eth_multicast.packets); - s->rx_multicast_bytes = - MLX5_GET_CTR(out, received_eth_multicast.octets); - s->tx_multicast_packets = - MLX5_GET_CTR(out, transmitted_eth_multicast.packets); - s->tx_multicast_bytes = - MLX5_GET_CTR(out, transmitted_eth_multicast.octets); + s->rx_multicast_packets = + MLX5_GET_CTR(out, received_eth_multicast.packets); + s->rx_multicast_bytes = + MLX5_GET_CTR(out, received_eth_multicast.octets); + s->tx_multicast_packets = + MLX5_GET_CTR(out, transmitted_eth_multicast.packets); + s->tx_multicast_bytes = + MLX5_GET_CTR(out, transmitted_eth_multicast.octets); - s->rx_broadcast_packets = - MLX5_GET_CTR(out, received_eth_broadcast.packets); - s->rx_broadcast_bytes = - MLX5_GET_CTR(out, received_eth_broadcast.octets); - s->tx_broadcast_packets = - MLX5_GET_CTR(out, transmitted_eth_broadcast.packets); - s->tx_broadcast_bytes = - MLX5_GET_CTR(out, transmitted_eth_broadcast.octets); + s->rx_broadcast_packets = + MLX5_GET_CTR(out, received_eth_broadcast.packets); + s->rx_broadcast_bytes = + MLX5_GET_CTR(out, received_eth_broadcast.octets); + s->tx_broadcast_packets = + MLX5_GET_CTR(out, transmitted_eth_broadcast.packets); + s->tx_broadcast_bytes = + MLX5_GET_CTR(out, transmitted_eth_broadcast.octets); - s->rx_packets = - s->rx_unicast_packets + - s->rx_multicast_packets + - s->rx_broadcast_packets - - s->rx_out_of_buffer; - s->rx_bytes = - s->rx_unicast_bytes + - s->rx_multicast_bytes + - s->rx_broadcast_bytes; - s->tx_packets = - s->tx_unicast_packets + - s->tx_multicast_packets + - s->tx_broadcast_packets; - s->tx_bytes = - s->tx_unicast_bytes + - s->tx_multicast_bytes + - s->tx_broadcast_bytes; + s->rx_packets = s->rx_unicast_packets + + s->rx_multicast_packets + s->rx_broadcast_packets - + s->rx_out_of_buffer; + s->rx_bytes = s->rx_unicast_bytes + s->rx_multicast_bytes + + s->rx_broadcast_bytes; + s->tx_packets = s->tx_unicast_packets + + s->tx_multicast_packets + s->tx_broadcast_packets; + s->tx_bytes = s->tx_unicast_bytes + s->tx_multicast_bytes + + s->tx_broadcast_bytes; - /* Update calculated offload counters */ - s->tx_csum_offload = s->tx_packets - tx_offload_none; - s->rx_csum_good = s->rx_packets - s->rx_csum_none; + /* Update calculated offload counters */ + s->tx_csum_offload = s->tx_packets - tx_offload_none; + s->rx_csum_good = s->rx_packets - s->rx_csum_none; + } /* Get physical port counters */ mlx5e_update_pport_counters(priv); @@ -685,6 +672,17 @@ free_out: if (error != 0) if_printf(priv->ifp, "Failed reading diagnostics: %d\n", error); } +} + +static void +mlx5e_update_stats_work(struct work_struct *work) +{ + struct mlx5e_priv *priv; + + priv = container_of(work, struct mlx5e_priv, update_stats_work); + PRIV_LOCK(priv); + if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0) + mlx5e_update_stats_locked(priv); PRIV_UNLOCK(priv); } From owner-svn-src-all@freebsd.org Wed May 8 10:35:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F17B315A4A46; Wed, 8 May 2019 10:35:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 972B296BA5; Wed, 8 May 2019 10:35:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 727E44A38; Wed, 8 May 2019 10:35:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AZZ08045037; Wed, 8 May 2019 10:35:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AZZiL045036; Wed, 8 May 2019 10:35:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081035.x48AZZiL045036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347263 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 972B296BA5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:35:36 -0000 Author: hselasky Date: Wed May 8 10:35:35 2019 New Revision: 347263 URL: https://svnweb.freebsd.org/changeset/base/347263 Log: Disable CQE zipping by default in mlx5en(4). After doing performance measurements, it seems like CQE zipping doesn't have any significant benefit. Moreover, we know that this feature is disabled by default on other operating systems (Linux for example). Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:35:14 2019 (r347262) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:35:35 2019 (r347263) @@ -3175,7 +3175,12 @@ mlx5e_build_ifp_priv(struct mlx5_core_dev *mdev, priv->params.hw_lro_en = false; priv->params.lro_wqe_sz = MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ; - priv->params.cqe_zipping_en = !!MLX5_CAP_GEN(mdev, cqe_compression); + /* + * CQE zipping is currently defaulted to off. when it won't + * anymore we will consider the HW capability: + * "!!MLX5_CAP_GEN(mdev, cqe_compression)" + */ + priv->params.cqe_zipping_en = false; priv->mdev = mdev; priv->params.num_channels = num_comp_vectors; From owner-svn-src-all@freebsd.org Wed May 8 10:35:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A7C215A4A8F; Wed, 8 May 2019 10:35:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0ABA96CCC; Wed, 8 May 2019 10:35:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BAC04A39; Wed, 8 May 2019 10:35:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AZukt045099; Wed, 8 May 2019 10:35:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AZuCK045096; Wed, 8 May 2019 10:35:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081035.x48AZuCK045096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347264 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0ABA96CCC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:35:57 -0000 Author: hselasky Date: Wed May 8 10:35:55 2019 New Revision: 347264 URL: https://svnweb.freebsd.org/changeset/base/347264 Log: Configure firmware to use RX hash format in mini CQE in mlx5en(4). When using CQE zipping, one can choose between RX hash and Checksum. This will indicate the parameter on which a zipping session should be stopped. While porting the Linux code, Checksum was chosen. However, the value of Checksum is not being used anywhere. For the FreeBSD driver, we prefer to use the RX hash format which will guarantee the RX hash value for all the mini CQEs. While at it, make sure to initialize the Checksum value in the decompressed CQE. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:35:35 2019 (r347263) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:35:55 2019 (r347264) @@ -1955,13 +1955,15 @@ mlx5e_build_rx_cq_param(struct mlx5e_priv *priv, struct net_dim_cq_moder curr; void *cqc = param->cqc; - /* - * TODO The sysctl to control on/off is a bool value for now, which means - * we only support CSUM, once HASH is implemnted we'll need to address that. + * We use MLX5_CQE_FORMAT_HASH because the RX hash mini CQE + * format is more beneficial for FreeBSD use case. + * + * Adding support for MLX5_CQE_FORMAT_CSUM will require changes + * in mlx5e_decompress_cqe. */ if (priv->params.cqe_zipping_en) { - MLX5_SET(cqc, cqc, mini_cqe_res_format, MLX5_CQE_FORMAT_CSUM); + MLX5_SET(cqc, cqc, mini_cqe_res_format, MLX5_CQE_FORMAT_HASH); MLX5_SET(cqc, cqc, cqe_compression_en, 1); } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed May 8 10:35:35 2019 (r347263) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed May 8 10:35:55 2019 (r347264) @@ -385,7 +385,12 @@ mlx5e_decompress_cqe(struct mlx5e_cq *cq, struct mlx5_ */ title->byte_cnt = mini->byte_cnt; title->wqe_counter = cpu_to_be16((wqe_counter + i) & cq->wq.sz_m1); - title->check_sum = mini->checksum; + title->rss_hash_result = mini->rx_hash_result; + /* + * Since we use MLX5_CQE_FORMAT_HASH when creating the RX CQ, + * the value of the checksum should be ignored. + */ + title->check_sum = 0; title->op_own = (title->op_own & 0xf0) | (((cq->wq.cc + i) >> cq->wq.log_sz) & 1); } From owner-svn-src-all@freebsd.org Wed May 8 10:36:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AD7B15A4B26; Wed, 8 May 2019 10:36:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C711C96E5C; Wed, 8 May 2019 10:36:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA7654A3A; Wed, 8 May 2019 10:36:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AaWEQ045178; Wed, 8 May 2019 10:36:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AaW81045177; Wed, 8 May 2019 10:36:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081036.x48AaW81045177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347265 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C711C96E5C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:36:33 -0000 Author: hselasky Date: Wed May 8 10:36:32 2019 New Revision: 347265 URL: https://svnweb.freebsd.org/changeset/base/347265 Log: Ticks are integer type in FreeBSD. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 10:35:55 2019 (r347264) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 10:36:32 2019 (r347265) @@ -255,7 +255,7 @@ mlx5_health_allow_reset(struct mlx5_core_dev *dev) #define MLX5_NIC_STATE_POLL_MS 5 void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force) { - unsigned long end, delay_ms = MLX5_CRDUMP_WAIT_MS; + int end, delay_ms = MLX5_CRDUMP_WAIT_MS; u32 fatal_error; int lock = -EBUSY; @@ -299,7 +299,7 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, } while (!time_after(jiffies, end)); if (!sensor_nic_disabled(dev)) { - dev_err(&dev->pdev->dev, "NIC IFC still %d after %lums.\n", + dev_err(&dev->pdev->dev, "NIC IFC still %d after %ums.\n", get_nic_mode(dev), delay_ms); } From owner-svn-src-all@freebsd.org Wed May 8 10:37:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 687BA15A4BD0; Wed, 8 May 2019 10:37:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F68B96F9C; Wed, 8 May 2019 10:37:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D56214A3B; Wed, 8 May 2019 10:37:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Ab3js045251; Wed, 8 May 2019 10:37:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Ab3Ko045249; Wed, 8 May 2019 10:37:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081037.x48Ab3Ko045249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347266 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347266 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F68B96F9C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:37:04 -0000 Author: hselasky Date: Wed May 8 10:37:03 2019 New Revision: 347266 URL: https://svnweb.freebsd.org/changeset/base/347266 Log: Implement get and set nic state as global functions in mlx5core. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_health.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 10:36:32 2019 (r347265) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 10:37:03 2019 (r347266) @@ -108,4 +108,15 @@ extern struct pci_driver mlx5_core_driver; SYSCTL_DECL(_hw_mlx5); +enum { + MLX5_NIC_IFC_FULL = 0, + MLX5_NIC_IFC_DISABLED = 1, + MLX5_NIC_IFC_NO_DRAM_NIC = 2, + MLX5_NIC_IFC_INVALID = 3, + MLX5_NIC_IFC_SW_RESET = 7, +}; + +u8 mlx5_get_nic_state(struct mlx5_core_dev *dev); +void mlx5_set_nic_state(struct mlx5_core_dev *dev, u8 state); + #endif /* __MLX5_CORE_H__ */ Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 10:36:32 2019 (r347265) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 10:37:03 2019 (r347266) @@ -39,13 +39,6 @@ #define MAX_MISSES 3 enum { - MLX5_NIC_IFC_FULL = 0, - MLX5_NIC_IFC_DISABLED = 1, - MLX5_NIC_IFC_NO_DRAM_NIC = 2, - MLX5_NIC_IFC_SW_RESET = 7, -}; - -enum { MLX5_DROP_NEW_HEALTH_WORK, MLX5_DROP_NEW_RECOVERY_WORK, }; @@ -114,11 +107,21 @@ static int unlock_sem_sw_reset(struct mlx5_core_dev *d return ret; } -static u8 get_nic_mode(struct mlx5_core_dev *dev) +u8 mlx5_get_nic_state(struct mlx5_core_dev *dev) { return (ioread32be(&dev->iseg->cmdq_addr_l_sz) >> 8) & 7; } +void mlx5_set_nic_state(struct mlx5_core_dev *dev, u8 state) +{ + u32 cur_cmdq_addr_l_sz; + + cur_cmdq_addr_l_sz = ioread32be(&dev->iseg->cmdq_addr_l_sz); + iowrite32be((cur_cmdq_addr_l_sz & 0xFFFFF000) | + state << MLX5_NIC_IFC_OFFSET, + &dev->iseg->cmdq_addr_l_sz); +} + static bool sensor_fw_synd_rfr(struct mlx5_core_dev *dev) { struct mlx5_core_health *health = &dev->priv.health; @@ -165,12 +168,12 @@ static bool sensor_pci_no_comm(struct mlx5_core_dev *d static bool sensor_nic_disabled(struct mlx5_core_dev *dev) { - return get_nic_mode(dev) == MLX5_NIC_IFC_DISABLED; + return mlx5_get_nic_state(dev) == MLX5_NIC_IFC_DISABLED; } static bool sensor_nic_sw_reset(struct mlx5_core_dev *dev) { - return get_nic_mode(dev) == MLX5_NIC_IFC_SW_RESET; + return mlx5_get_nic_state(dev) == MLX5_NIC_IFC_SW_RESET; } static u32 check_fatal_sensors(struct mlx5_core_dev *dev) @@ -300,7 +303,7 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, if (!sensor_nic_disabled(dev)) { dev_err(&dev->pdev->dev, "NIC IFC still %d after %ums.\n", - get_nic_mode(dev), delay_ms); + mlx5_get_nic_state(dev), delay_ms); } /* Release FW semaphore if you are the lock owner */ @@ -316,7 +319,7 @@ err_state_done: static void mlx5_handle_bad_state(struct mlx5_core_dev *dev) { - u8 nic_mode = get_nic_mode(dev); + u8 nic_mode = mlx5_get_nic_state(dev); if (nic_mode == MLX5_NIC_IFC_SW_RESET) { /* The IFC mode field is 3 bits, so it will read 0x7 in two cases: @@ -362,11 +365,11 @@ static void health_recover(struct work_struct *work) recover = false; } - nic_mode = get_nic_mode(dev); + nic_mode = mlx5_get_nic_state(dev); while (nic_mode != MLX5_NIC_IFC_DISABLED && !time_after(jiffies, end)) { msleep(MLX5_NIC_STATE_POLL_MS); - nic_mode = get_nic_mode(dev); + nic_mode = mlx5_get_nic_state(dev); } if (nic_mode != MLX5_NIC_IFC_DISABLED) { From owner-svn-src-all@freebsd.org Wed May 8 10:37:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D394E15A4C4F; Wed, 8 May 2019 10:37:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33303970B9; Wed, 8 May 2019 10:37:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D6464A3C; Wed, 8 May 2019 10:37:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AbV93045323; Wed, 8 May 2019 10:37:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AbV6x045322; Wed, 8 May 2019 10:37:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081037.x48AbV6x045322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347267 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33303970B9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:37:33 -0000 Author: hselasky Date: Wed May 8 10:37:31 2019 New Revision: 347267 URL: https://svnweb.freebsd.org/changeset/base/347267 Log: Make sure the running variable is properly set for ratelimited SQs in mlx5en(4). Else the SQs won't be properly released when closing rate-limited connections leading to wrong state transitions on the SQ. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Wed May 8 10:37:03 2019 (r347266) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Wed May 8 10:37:31 2019 (r347267) @@ -176,6 +176,8 @@ mlx5e_rl_open_sq(struct mlx5e_priv *priv, struct mlx5e if (err) goto err_disable_sq; + WRITE_ONCE(sq->running, 1); + return (0); err_disable_sq: From owner-svn-src-all@freebsd.org Wed May 8 10:38:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6888D15A4D1D; Wed, 8 May 2019 10:38:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC3E97267; Wed, 8 May 2019 10:38:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCC744A3D; Wed, 8 May 2019 10:38:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Ac7cH045410; Wed, 8 May 2019 10:38:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Ac75G045406; Wed, 8 May 2019 10:38:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081038.x48Ac75G045406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347268 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0DC3E97267 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:38:08 -0000 Author: hselasky Date: Wed May 8 10:38:06 2019 New Revision: 347268 URL: https://svnweb.freebsd.org/changeset/base/347268 Log: Add Fast teardown support to mlx5core. Today mlx5 devices support two teardown modes: 1- Regular teardown 2- Force teardown This change introduces the enhanced version of the "Force teardown" that allows SW to perform teardown in a faster way without the need to reclaim all the pages. Fast teardown provides the following advantages: 1- Fix a FW race condition that could cause command timeout 2- Avoid moving to polling mode 3- Close the vport to prevent PCI ACK to be sent without been scattered to memory Linux commit: fcd29ad17c6ff885dfae58f557e9323941e63ba2 MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_fw.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 10:37:31 2019 (r347267) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 10:38:06 2019 (r347268) @@ -79,6 +79,7 @@ int mlx5_query_qcam_reg(struct mlx5_core_dev *mdev, u3 int mlx5_cmd_init_hca(struct mlx5_core_dev *dev); int mlx5_cmd_teardown_hca(struct mlx5_core_dev *dev); int mlx5_cmd_force_teardown_hca(struct mlx5_core_dev *dev); +int mlx5_cmd_fast_teardown_hca(struct mlx5_core_dev *dev); void mlx5_core_event(struct mlx5_core_dev *dev, enum mlx5_dev_event event, unsigned long param); void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:37:31 2019 (r347267) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:38:06 2019 (r347268) @@ -249,12 +249,59 @@ int mlx5_cmd_force_teardown_hca(struct mlx5_core_dev * if (ret) return ret; - force_state = MLX5_GET(teardown_hca_out, out, force_state); + force_state = MLX5_GET(teardown_hca_out, out, state); if (force_state == MLX5_TEARDOWN_HCA_OUT_FORCE_STATE_FAIL) { mlx5_core_err(dev, "teardown with force mode failed\n"); return -EIO; } + return 0; +} + +#define MLX5_FAST_TEARDOWN_WAIT_MS 3000 +int mlx5_cmd_fast_teardown_hca(struct mlx5_core_dev *dev) +{ + int end, delay_ms = MLX5_FAST_TEARDOWN_WAIT_MS; + u32 out[MLX5_ST_SZ_DW(teardown_hca_out)] = {}; + u32 in[MLX5_ST_SZ_DW(teardown_hca_in)] = {}; + int state; + int ret; + + if (!MLX5_CAP_GEN(dev, fast_teardown)) { + mlx5_core_dbg(dev, "fast teardown is not supported in the firmware\n"); + return -EOPNOTSUPP; + } + + MLX5_SET(teardown_hca_in, in, opcode, MLX5_CMD_OP_TEARDOWN_HCA); + MLX5_SET(teardown_hca_in, in, profile, + MLX5_TEARDOWN_HCA_IN_PROFILE_PREPARE_FAST_TEARDOWN); + + ret = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out)); + if (ret) + return ret; + + state = MLX5_GET(teardown_hca_out, out, state); + if (state == MLX5_TEARDOWN_HCA_OUT_FORCE_STATE_FAIL) { + mlx5_core_warn(dev, "teardown with fast mode failed\n"); + return -EIO; + } + + mlx5_set_nic_state(dev, MLX5_NIC_IFC_DISABLED); + + /* Loop until device state turns to disable */ + end = jiffies + msecs_to_jiffies(delay_ms); + do { + if (mlx5_get_nic_state(dev) == MLX5_NIC_IFC_DISABLED) + break; + + pause("W", 1); + } while (!time_after(jiffies, end)); + + if (mlx5_get_nic_state(dev) != MLX5_NIC_IFC_DISABLED) { + dev_err(&dev->pdev->dev, "NIC IFC still %d after %ums.\n", + mlx5_get_nic_state(dev), delay_ms); + return -EIO; + } return 0; } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:37:31 2019 (r347267) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:38:06 2019 (r347268) @@ -1415,12 +1415,17 @@ static const struct pci_error_handlers mlx5_err_handle static int mlx5_try_fast_unload(struct mlx5_core_dev *dev) { + bool fast_teardown, force_teardown; int err; - if (!MLX5_CAP_GEN(dev, force_teardown)) { - mlx5_core_dbg(dev, "force teardown is not supported in the firmware\n"); + fast_teardown = MLX5_CAP_GEN(dev, fast_teardown); + force_teardown = MLX5_CAP_GEN(dev, force_teardown); + + mlx5_core_dbg(dev, "force teardown firmware support=%d\n", force_teardown); + mlx5_core_dbg(dev, "fast teardown firmware support=%d\n", fast_teardown); + + if (!fast_teardown && !force_teardown) return -EOPNOTSUPP; - } if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { mlx5_core_dbg(dev, "Device in internal error state, giving up\n"); @@ -1433,14 +1438,19 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev * mlx5_drain_health_wq(dev); mlx5_stop_health_poll(dev, false); + err = mlx5_cmd_fast_teardown_hca(dev); + if (!err) + goto done; + err = mlx5_cmd_force_teardown_hca(dev); - if (err) { - mlx5_core_dbg(dev, "Firmware couldn't do fast unload error: %d\n", err); - return err; - } + if (!err) + goto done; + mlx5_core_dbg(dev, "Firmware couldn't do fast unload error: %d\n", err); + mlx5_start_health_poll(dev); + return err; +done: mlx5_enter_error_state(dev, true); - return 0; } Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:37:31 2019 (r347267) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:38:06 2019 (r347268) @@ -1054,7 +1054,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 relaxed_ordering_write[1]; u8 reserved_6[0x1]; u8 log_max_mkey[0x6]; - u8 reserved_7[0xc]; + u8 reserved_7[0xb]; + u8 fast_teardown[0x1]; u8 log_max_eq[0x4]; u8 max_indirection[0x8]; @@ -3289,12 +3290,13 @@ struct mlx5_ifc_teardown_hca_out_bits { u8 reserved_1[0x3f]; - u8 force_state[0x1]; + u8 state[0x1]; }; enum { MLX5_TEARDOWN_HCA_IN_PROFILE_GRACEFUL_CLOSE = 0x0, MLX5_TEARDOWN_HCA_IN_PROFILE_FORCE_CLOSE = 0x1, + MLX5_TEARDOWN_HCA_IN_PROFILE_PREPARE_FAST_TEARDOWN = 0x2, }; struct mlx5_ifc_teardown_hca_in_bits { From owner-svn-src-all@freebsd.org Wed May 8 10:38:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D73215A4DBE; Wed, 8 May 2019 10:38:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA9B1973C0; Wed, 8 May 2019 10:38:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B565D4A3E; Wed, 8 May 2019 10:38:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AcV9l045475; Wed, 8 May 2019 10:38:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AcVNH045474; Wed, 8 May 2019 10:38:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081038.x48AcVNH045474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347269 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA9B1973C0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:38:32 -0000 Author: hselasky Date: Wed May 8 10:38:31 2019 New Revision: 347269 URL: https://svnweb.freebsd.org/changeset/base/347269 Log: Add sysctl(8) to control fast unload support in mlx5core. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:38:06 2019 (r347268) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:38:31 2019 (r347269) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2019, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -68,6 +68,11 @@ MODULE_PARM_DESC(prof_sel, "profile selector. Valid ra SYSCTL_NODE(_hw, OID_AUTO, mlx5, CTLFLAG_RW, 0, "mlx5 HW controls"); +static int mlx5_fast_unload_enabled = 1; +SYSCTL_INT(_hw_mlx5, OID_AUTO, fast_unload_enabled, CTLFLAG_RWTUN, + &mlx5_fast_unload_enabled, 0, + "Set to enable fast unload. Clear to disable."); + #define NUMA_NO_NODE -1 static LIST_HEAD(intf_list); @@ -1417,6 +1422,11 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev * { bool fast_teardown, force_teardown; int err; + + if (!mlx5_fast_unload_enabled) { + mlx5_core_dbg(dev, "fast unload is disabled by user\n"); + return -EOPNOTSUPP; + } fast_teardown = MLX5_CAP_GEN(dev, fast_teardown); force_teardown = MLX5_CAP_GEN(dev, force_teardown); From owner-svn-src-all@freebsd.org Wed May 8 10:39:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80CE915A4E8C; Wed, 8 May 2019 10:39:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 074EA9753B; Wed, 8 May 2019 10:39:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7A414A40; Wed, 8 May 2019 10:39:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Ad2e6045557; Wed, 8 May 2019 10:39:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Ad2UC045554; Wed, 8 May 2019 10:39:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081039.x48Ad2UC045554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347270 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 347270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 074EA9753B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:39:03 -0000 Author: hselasky Date: Wed May 8 10:39:01 2019 New Revision: 347270 URL: https://svnweb.freebsd.org/changeset/base/347270 Log: Expose PCAM, MCAM registers infrastructure in mlx5core. PCAM: Ports capabilities mask register. MCAM: Management capabilities mask register. PCAM and MCAM registers will provide information regarding firmware support for different features, in order to avoid cases where new driver combined with old firmware results in syndromes (for ex. PCIe counters before this patchset). Linux commit: cfdcbceaeffc669b70d904d80a2df9c86c232566 Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed May 8 10:38:31 2019 (r347269) +++ head/sys/dev/mlx5/device.h Wed May 8 10:39:01 2019 (r347270) @@ -929,6 +929,22 @@ enum mlx5_qcam_feature_groups { MLX5_QCAM_FEATURE_ENHANCED_FEATURES = 0x0, }; +enum mlx5_pcam_reg_groups { + MLX5_PCAM_REGS_5000_TO_507F = 0x0, +}; + +enum mlx5_pcam_feature_groups { + MLX5_PCAM_FEATURE_ENHANCED_FEATURES = 0x0, +}; + +enum mlx5_mcam_reg_groups { + MLX5_MCAM_REGS_FIRST_128 = 0x0, +}; + +enum mlx5_mcam_feature_groups { + MLX5_MCAM_FEATURE_ENHANCED_FEATURES = 0x0, +}; + /* GET Dev Caps macros */ #define MLX5_CAP_GEN(mdev, cap) \ MLX5_GET(cmd_hca_cap, mdev->hca_caps_cur[MLX5_CAP_GENERAL], cap) Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 10:38:31 2019 (r347269) +++ head/sys/dev/mlx5/driver.h Wed May 8 10:39:01 2019 (r347270) @@ -149,11 +149,13 @@ enum { MLX5_REG_PELC = 0x500e, MLX5_REG_PVLC = 0x500f, MLX5_REG_PMLP = 0x5002, + MLX5_REG_PCAM = 0x507f, MLX5_REG_NODE_DESC = 0x6001, MLX5_REG_HOST_ENDIANNESS = 0x7004, MLX5_REG_MTMP = 0x900a, MLX5_REG_MCIA = 0x9014, MLX5_REG_MPCNT = 0x9051, + MLX5_REG_MCAM = 0x907f, }; enum dbg_rsc_type { Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:38:31 2019 (r347269) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:39:01 2019 (r347270) @@ -1103,7 +1103,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 ets[0x1]; u8 nic_flow_table[0x1]; u8 eswitch_flow_table[0x1]; - u8 reserved_18[0x3]; + u8 reserved_18[0x1]; + u8 mcam_reg[0x1]; + u8 pcam_reg[0x1]; u8 local_ca_ack_delay[0x5]; u8 port_module_event[0x1]; u8 reserved_19[0x5]; @@ -8544,6 +8546,63 @@ struct mlx5_ifc_qcam_reg_bits { struct mlx5_ifc_qcam_qos_feature_cap_mask feature_cap; u8 reserved_at_0[0x80]; } qos_feature_cap_mask; + + u8 reserved_at_1c0[0x80]; +}; + +struct mlx5_ifc_pcam_enhanced_features_bits { + u8 reserved_at_0[0x7e]; + + u8 ppcnt_discard_group[0x1]; + u8 ppcnt_statistical_group[0x1]; +}; + +struct mlx5_ifc_pcam_reg_bits { + u8 reserved_at_0[0x8]; + u8 feature_group[0x8]; + u8 reserved_at_10[0x8]; + u8 access_reg_group[0x8]; + + u8 reserved_at_20[0x20]; + + union { + u8 reserved_at_0[0x80]; + } port_access_reg_cap_mask; + + u8 reserved_at_c0[0x80]; + + union { + struct mlx5_ifc_pcam_enhanced_features_bits enhanced_features; + u8 reserved_at_0[0x80]; + } feature_cap_mask; + + u8 reserved_at_1c0[0xc0]; +}; + +struct mlx5_ifc_mcam_enhanced_features_bits { + u8 reserved_at_0[0x7f]; + + u8 pcie_performance_group[0x1]; +}; + +struct mlx5_ifc_mcam_reg_bits { + u8 reserved_at_0[0x8]; + u8 feature_group[0x8]; + u8 reserved_at_10[0x8]; + u8 access_reg_group[0x8]; + + u8 reserved_at_20[0x20]; + + union { + u8 reserved_at_0[0x80]; + } mng_access_reg_cap_mask; + + u8 reserved_at_c0[0x80]; + + union { + struct mlx5_ifc_mcam_enhanced_features_bits enhanced_features; + u8 reserved_at_0[0x80]; + } mng_feature_cap_mask; u8 reserved_at_1c0[0x80]; }; From owner-svn-src-all@freebsd.org Wed May 8 10:39:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D3F515A4F19; Wed, 8 May 2019 10:39:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3655C97695; Wed, 8 May 2019 10:39:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC6324A41; Wed, 8 May 2019 10:39:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AdPk6045625; Wed, 8 May 2019 10:39:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AdPVh045624; Wed, 8 May 2019 10:39:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081039.x48AdPVh045624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347271 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3655C97695 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:39:26 -0000 Author: hselasky Date: Wed May 8 10:39:25 2019 New Revision: 347271 URL: https://svnweb.freebsd.org/changeset/base/347271 Log: Implement PCAM, MCAM access register commands in mlx5core. Introduced registers will expose capabilities of new registers and features related to port/management. Driver will query MCAM and PCAM in order to avoid failing on old firmwares with lack of support. Linux commit: c835ad64683bd3e2d1b31ed2cb1ff4366932edb1 Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_port.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 10:39:01 2019 (r347270) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 10:39:25 2019 (r347271) @@ -76,6 +76,10 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev); int mlx5_query_board_id(struct mlx5_core_dev *dev); int mlx5_query_qcam_reg(struct mlx5_core_dev *mdev, u32 *qcam, u8 feature_group, u8 access_reg_group); +int mlx5_query_pcam_reg(struct mlx5_core_dev *dev, u32 *pcam, + u8 feature_group, u8 access_reg_group); +int mlx5_query_mcam_reg(struct mlx5_core_dev *dev, u32 *mcap, + u8 feature_group, u8 access_reg_group); int mlx5_cmd_init_hca(struct mlx5_core_dev *dev); int mlx5_cmd_teardown_hca(struct mlx5_core_dev *dev); int mlx5_cmd_force_teardown_hca(struct mlx5_core_dev *dev); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed May 8 10:39:01 2019 (r347270) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed May 8 10:39:25 2019 (r347271) @@ -79,6 +79,30 @@ int mlx5_query_qcam_reg(struct mlx5_core_dev *mdev, u3 } EXPORT_SYMBOL_GPL(mlx5_query_qcam_reg); +int mlx5_query_pcam_reg(struct mlx5_core_dev *dev, u32 *pcam, u8 feature_group, + u8 access_reg_group) +{ + u32 in[MLX5_ST_SZ_DW(pcam_reg)] = {}; + int sz = MLX5_ST_SZ_BYTES(pcam_reg); + + MLX5_SET(pcam_reg, in, feature_group, feature_group); + MLX5_SET(pcam_reg, in, access_reg_group, access_reg_group); + + return mlx5_core_access_reg(dev, in, sz, pcam, sz, MLX5_REG_PCAM, 0, 0); +} + +int mlx5_query_mcam_reg(struct mlx5_core_dev *dev, u32 *mcam, u8 feature_group, + u8 access_reg_group) +{ + u32 in[MLX5_ST_SZ_DW(mcam_reg)] = {}; + int sz = MLX5_ST_SZ_BYTES(mcam_reg); + + MLX5_SET(mcam_reg, in, feature_group, feature_group); + MLX5_SET(mcam_reg, in, access_reg_group, access_reg_group); + + return mlx5_core_access_reg(dev, in, sz, mcam, sz, MLX5_REG_MCAM, 0, 0); +} + struct mlx5_reg_pcap { u8 rsvd0; u8 port_num; From owner-svn-src-all@freebsd.org Wed May 8 10:39:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E195215A4FCC; Wed, 8 May 2019 10:39:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86EFC977F7; Wed, 8 May 2019 10:39:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 609644A42; Wed, 8 May 2019 10:39:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AdsxZ045708; Wed, 8 May 2019 10:39:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AdrCL045705; Wed, 8 May 2019 10:39:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081039.x48AdrCL045705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347272 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 86EFC977F7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:39:55 -0000 Author: hselasky Date: Wed May 8 10:39:53 2019 New Revision: 347272 URL: https://svnweb.freebsd.org/changeset/base/347272 Log: Query and cache PCAM, MCAM registers on initialization in mlx5core. On load_one, we now cache our capabilities registers internally, similar to QUERY_HCA_CAP. Capabilities can later be queried using macros introduced in this patch. Linux commit: 71862561f3a62015a11de16d1c306481e8415c08 Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed May 8 10:39:25 2019 (r347271) +++ head/sys/dev/mlx5/device.h Wed May 8 10:39:53 2019 (r347272) @@ -1050,6 +1050,12 @@ enum mlx5_mcam_feature_groups { MLX5_GET(qos_cap,\ mdev->hca_caps_max[MLX5_CAP_QOS], cap) +#define MLX5_CAP_PCAM_FEATURE(mdev, fld) \ + MLX5_GET(pcam_reg, (mdev)->caps.pcam, feature_cap_mask.enhanced_features.fld) + +#define MLX5_CAP_MCAM_FEATURE(mdev, fld) \ + MLX5_GET(mcam_reg, (mdev)->caps.mcam, mng_feature_cap_mask.enhanced_features.fld) + #define MLX5_CAP_QCAM_REG(mdev, fld) \ MLX5_GET(qcam_reg, (mdev)->caps.qcam, qos_access_reg_cap_mask.reg_cap.fld) Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 10:39:25 2019 (r347271) +++ head/sys/dev/mlx5/driver.h Wed May 8 10:39:53 2019 (r347272) @@ -699,6 +699,8 @@ struct mlx5_core_dev { u32 hca_caps_cur[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; u32 hca_caps_max[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; struct { + u32 pcam[MLX5_ST_SZ_DW(pcam_reg)]; + u32 mcam[MLX5_ST_SZ_DW(mcam_reg)]; u32 qcam[MLX5_ST_SZ_DW(qcam_reg)]; u32 fpga[MLX5_ST_SZ_DW(fpga_cap)]; } caps; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:39:25 2019 (r347271) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:39:53 2019 (r347272) @@ -117,6 +117,20 @@ static int mlx5_get_qcam_reg(struct mlx5_core_dev *dev MLX5_QCAM_REGS_FIRST_128); } +static int mlx5_get_pcam_reg(struct mlx5_core_dev *dev) +{ + return mlx5_query_pcam_reg(dev, dev->caps.pcam, + MLX5_PCAM_FEATURE_ENHANCED_FEATURES, + MLX5_PCAM_REGS_5000_TO_507F); +} + +static int mlx5_get_mcam_reg(struct mlx5_core_dev *dev) +{ + return mlx5_query_mcam_reg(dev, dev->caps.mcam, + MLX5_MCAM_FEATURE_ENHANCED_FEATURES, + MLX5_MCAM_REGS_FIRST_128); +} + int mlx5_query_hca_caps(struct mlx5_core_dev *dev) { int err; From owner-svn-src-all@freebsd.org Wed May 8 10:40:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C75615A5028; Wed, 8 May 2019 10:40:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81D399797B; Wed, 8 May 2019 10:40:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C4824A49; Wed, 8 May 2019 10:40:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AeEL4045813; Wed, 8 May 2019 10:40:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AeEtM045812; Wed, 8 May 2019 10:40:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081040.x48AeEtM045812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347273 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 81D399797B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:40:15 -0000 Author: hselasky Date: Wed May 8 10:40:13 2019 New Revision: 347273 URL: https://svnweb.freebsd.org/changeset/base/347273 Log: Add reading the mcam_reg in mlx5core. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:39:53 2019 (r347272) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:40:13 2019 (r347273) @@ -215,6 +215,12 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev) return err; } + if (MLX5_CAP_GEN(dev, mcam_reg)) { + err = mlx5_get_mcam_reg(dev); + if (err) + return err; + } + err = mlx5_core_query_special_contexts(dev); if (err) return err; From owner-svn-src-all@freebsd.org Wed May 8 10:40:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A39215A51EF; Wed, 8 May 2019 10:40:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C560D97AFA; Wed, 8 May 2019 10:40:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A24484A57; Wed, 8 May 2019 10:40:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AefPt045886; Wed, 8 May 2019 10:40:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Aef8k045885; Wed, 8 May 2019 10:40:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081040.x48Aef8k045885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347274 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 347274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C560D97AFA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:40:42 -0000 Author: hselasky Date: Wed May 8 10:40:41 2019 New Revision: 347274 URL: https://svnweb.freebsd.org/changeset/base/347274 Log: Add MCC (Management Component Control) register definitions in mlx5core. MCC (Management Component Control) allows to control a firmware component update. MCDA (Management Component Data Access) allows to read and write a firmware component. MCQI (Management Component Query Information) allows to query information about firmware components. Linux commit: 4717628938423fcba0aa8fa889e9fed4eb6a655f Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 10:40:13 2019 (r347273) +++ head/sys/dev/mlx5/driver.h Wed May 8 10:40:41 2019 (r347274) @@ -155,6 +155,9 @@ enum { MLX5_REG_MTMP = 0x900a, MLX5_REG_MCIA = 0x9014, MLX5_REG_MPCNT = 0x9051, + MLX5_REG_MCQI = 0x9061, + MLX5_REG_MCC = 0x9062, + MLX5_REG_MCDA = 0x9063, MLX5_REG_MCAM = 0x907f, }; Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:40:13 2019 (r347273) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:40:41 2019 (r347274) @@ -9927,6 +9927,85 @@ struct mlx5_ifc_mpcnt_reg_bits { union mlx5_ifc_mpcnt_cntrs_grp_data_layout_bits counter_set; }; +struct mlx5_ifc_mcqi_cap_bits { + u8 supported_info_bitmask[0x20]; + + u8 component_size[0x20]; + + u8 max_component_size[0x20]; + + u8 log_mcda_word_size[0x4]; + u8 reserved_at_64[0xc]; + u8 mcda_max_write_size[0x10]; + + u8 rd_en[0x1]; + u8 reserved_at_81[0x1]; + u8 match_chip_id[0x1]; + u8 match_psid[0x1]; + u8 check_user_timestamp[0x1]; + u8 match_base_guid_mac[0x1]; + u8 reserved_at_86[0x1a]; +}; + +struct mlx5_ifc_mcqi_reg_bits { + u8 read_pending_component[0x1]; + u8 reserved_at_1[0xf]; + u8 component_index[0x10]; + + u8 reserved_at_20[0x20]; + + u8 reserved_at_40[0x1b]; + u8 info_type[0x5]; + + u8 info_size[0x20]; + + u8 offset[0x20]; + + u8 reserved_at_a0[0x10]; + u8 data_size[0x10]; + + u8 data[0][0x20]; +}; + +struct mlx5_ifc_mcc_reg_bits { + u8 reserved_at_0[0x4]; + u8 time_elapsed_since_last_cmd[0xc]; + u8 reserved_at_10[0x8]; + u8 instruction[0x8]; + + u8 reserved_at_20[0x10]; + u8 component_index[0x10]; + + u8 reserved_at_40[0x8]; + u8 update_handle[0x18]; + + u8 handle_owner_type[0x4]; + u8 handle_owner_host_id[0x4]; + u8 reserved_at_68[0x1]; + u8 control_progress[0x7]; + u8 error_code[0x8]; + u8 reserved_at_78[0x4]; + u8 control_state[0x4]; + + u8 component_size[0x20]; + + u8 reserved_at_a0[0x60]; +}; + +struct mlx5_ifc_mcda_reg_bits { + u8 reserved_at_0[0x8]; + u8 update_handle[0x18]; + + u8 offset[0x20]; + + u8 reserved_at_40[0x10]; + u8 size[0x10]; + + u8 reserved_at_60[0x20]; + + u8 data[0][0x20]; +}; + union mlx5_ifc_ports_control_registers_document_bits { struct mlx5_ifc_ib_portcntrs_attribute_grp_data_bits ib_portcntrs_attribute_grp_data; struct mlx5_ifc_bufferx_reg_bits bufferx_reg; From owner-svn-src-all@freebsd.org Wed May 8 10:41:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4088A15A5272; Wed, 8 May 2019 10:41:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA49E97CC3; Wed, 8 May 2019 10:41:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CFA94A68; Wed, 8 May 2019 10:41:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Af16u046780; Wed, 8 May 2019 10:41:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Af1la046778; Wed, 8 May 2019 10:41:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081041.x48Af1la046778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347275 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 347275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA49E97CC3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:41:02 -0000 Author: hselasky Date: Wed May 8 10:41:00 2019 New Revision: 347275 URL: https://svnweb.freebsd.org/changeset/base/347275 Log: Enhance MCAM reg to allow query on access reg support in mlx5core. Enhance MCAM to allow the driver to query which access regs are supported. For now, expose the regs needed for FW flashing. Linux commit: 0ab87743cc8c5bcd482daf71961ed5fc45349e01 Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed May 8 10:40:41 2019 (r347274) +++ head/sys/dev/mlx5/device.h Wed May 8 10:41:00 2019 (r347275) @@ -1056,6 +1056,9 @@ enum mlx5_mcam_feature_groups { #define MLX5_CAP_MCAM_FEATURE(mdev, fld) \ MLX5_GET(mcam_reg, (mdev)->caps.mcam, mng_feature_cap_mask.enhanced_features.fld) +#define MLX5_CAP_MCAM_REG(mdev, reg) \ + MLX5_GET(mcam_reg, (mdev)->caps.mcam, mng_access_reg_cap_mask.access_regs.reg) + #define MLX5_CAP_QCAM_REG(mdev, fld) \ MLX5_GET(qcam_reg, (mdev)->caps.qcam, qos_access_reg_cap_mask.reg_cap.fld) Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:40:41 2019 (r347274) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:41:00 2019 (r347275) @@ -8585,6 +8585,18 @@ struct mlx5_ifc_mcam_enhanced_features_bits { u8 pcie_performance_group[0x1]; }; +struct mlx5_ifc_mcam_access_reg_bits { + u8 reserved_at_0[0x1c]; + u8 mcda[0x1]; + u8 mcc[0x1]; + u8 mcqi[0x1]; + u8 reserved_at_1f[0x1]; + + u8 regs_95_to_64[0x20]; + u8 regs_63_to_32[0x20]; + u8 regs_31_to_0[0x20]; +}; + struct mlx5_ifc_mcam_reg_bits { u8 reserved_at_0[0x8]; u8 feature_group[0x8]; @@ -8594,6 +8606,7 @@ struct mlx5_ifc_mcam_reg_bits { u8 reserved_at_20[0x20]; union { + struct mlx5_ifc_mcam_access_reg_bits access_regs; u8 reserved_at_0[0x80]; } mng_access_reg_cap_mask; From owner-svn-src-all@freebsd.org Wed May 8 10:41:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 486DF15A52D4; Wed, 8 May 2019 10:41:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E293797F67; Wed, 8 May 2019 10:41:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B93824A82; Wed, 8 May 2019 10:41:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AfLxS046844; Wed, 8 May 2019 10:41:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AfLT3046843; Wed, 8 May 2019 10:41:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081041.x48AfLT3046843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347276 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E293797F67 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:41:22 -0000 Author: hselasky Date: Wed May 8 10:41:21 2019 New Revision: 347276 URL: https://svnweb.freebsd.org/changeset/base/347276 Log: Add helper functions to set/query MCC/MCDA/MCQI registers in mlx5core. To be used by the mlx5 callbacks exposed to the mlxfw module. Linux commit: d2ad488b0073bd1a2c3f5d2ea50a7eb632103e5d Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:41:00 2019 (r347275) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:41:21 2019 (r347276) @@ -341,3 +341,117 @@ int mlx5_core_set_dc_cnak_trace(struct mlx5_core_dev * return mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out)); } + +enum mlxsw_reg_mcc_instruction { + MLX5_REG_MCC_INSTRUCTION_LOCK_UPDATE_HANDLE = 0x01, + MLX5_REG_MCC_INSTRUCTION_RELEASE_UPDATE_HANDLE = 0x02, + MLX5_REG_MCC_INSTRUCTION_UPDATE_COMPONENT = 0x03, + MLX5_REG_MCC_INSTRUCTION_VERIFY_COMPONENT = 0x04, + MLX5_REG_MCC_INSTRUCTION_ACTIVATE = 0x06, + MLX5_REG_MCC_INSTRUCTION_CANCEL = 0x08, +}; + +static int mlx5_reg_mcc_set(struct mlx5_core_dev *dev, + enum mlxsw_reg_mcc_instruction instr, + u16 component_index, u32 update_handle, + u32 component_size) +{ + u32 out[MLX5_ST_SZ_DW(mcc_reg)]; + u32 in[MLX5_ST_SZ_DW(mcc_reg)]; + + memset(in, 0, sizeof(in)); + + MLX5_SET(mcc_reg, in, instruction, instr); + MLX5_SET(mcc_reg, in, component_index, component_index); + MLX5_SET(mcc_reg, in, update_handle, update_handle); + MLX5_SET(mcc_reg, in, component_size, component_size); + + return mlx5_core_access_reg(dev, in, sizeof(in), out, + sizeof(out), MLX5_REG_MCC, 0, 1); +} + +static int mlx5_reg_mcc_query(struct mlx5_core_dev *dev, + u32 *update_handle, u8 *error_code, + u8 *control_state) +{ + u32 out[MLX5_ST_SZ_DW(mcc_reg)]; + u32 in[MLX5_ST_SZ_DW(mcc_reg)]; + int err; + + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + MLX5_SET(mcc_reg, in, update_handle, *update_handle); + + err = mlx5_core_access_reg(dev, in, sizeof(in), out, + sizeof(out), MLX5_REG_MCC, 0, 0); + if (err) + goto out; + + *update_handle = MLX5_GET(mcc_reg, out, update_handle); + *error_code = MLX5_GET(mcc_reg, out, error_code); + *control_state = MLX5_GET(mcc_reg, out, control_state); + +out: + return err; +} + +static int mlx5_reg_mcda_set(struct mlx5_core_dev *dev, + u32 update_handle, + u32 offset, u16 size, + u8 *data) +{ + int err, in_size = MLX5_ST_SZ_BYTES(mcda_reg) + size; + u32 out[MLX5_ST_SZ_DW(mcda_reg)]; + int i, j, dw_size = size >> 2; + __be32 data_element; + u32 *in; + + in = kzalloc(in_size, GFP_KERNEL); + if (!in) + return -ENOMEM; + + MLX5_SET(mcda_reg, in, update_handle, update_handle); + MLX5_SET(mcda_reg, in, offset, offset); + MLX5_SET(mcda_reg, in, size, size); + + for (i = 0; i < dw_size; i++) { + j = i * 4; + data_element = htonl(*(u32 *)&data[j]); + memcpy(MLX5_ADDR_OF(mcda_reg, in, data) + j, &data_element, 4); + } + + err = mlx5_core_access_reg(dev, in, in_size, out, + sizeof(out), MLX5_REG_MCDA, 0, 1); + kfree(in); + return err; +} + +static int mlx5_reg_mcqi_query(struct mlx5_core_dev *dev, + u16 component_index, + u32 *max_component_size, + u8 *log_mcda_word_size, + u16 *mcda_max_write_size) +{ + u32 out[MLX5_ST_SZ_DW(mcqi_reg) + MLX5_ST_SZ_DW(mcqi_cap)]; + int offset = MLX5_ST_SZ_DW(mcqi_reg); + u32 in[MLX5_ST_SZ_DW(mcqi_reg)]; + int err; + + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(mcqi_reg, in, component_index, component_index); + MLX5_SET(mcqi_reg, in, data_size, MLX5_ST_SZ_BYTES(mcqi_cap)); + + err = mlx5_core_access_reg(dev, in, sizeof(in), out, + sizeof(out), MLX5_REG_MCQI, 0, 0); + if (err) + goto out; + + *max_component_size = MLX5_GET(mcqi_cap, out + offset, max_component_size); + *log_mcda_word_size = MLX5_GET(mcqi_cap, out + offset, log_mcda_word_size); + *mcda_max_write_size = MLX5_GET(mcqi_cap, out + offset, mcda_max_write_size); + +out: + return err; +} From owner-svn-src-all@freebsd.org Wed May 8 10:41:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DE9015A536A; Wed, 8 May 2019 10:41:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA12368107; Wed, 8 May 2019 10:41:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B12444A9F; Wed, 8 May 2019 10:41:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Afij0046912; Wed, 8 May 2019 10:41:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AfiGq046910; Wed, 8 May 2019 10:41:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081041.x48AfiGq046910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347277 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA12368107 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:41:45 -0000 Author: hselasky Date: Wed May 8 10:41:44 2019 New Revision: 347277 URL: https://svnweb.freebsd.org/changeset/base/347277 Log: Avoid leaking send queue mbufs during error recovery in mlx5en(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:41:21 2019 (r347276) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:41:44 2019 (r347277) @@ -1147,8 +1147,13 @@ mlx5e_free_sq_db(struct mlx5e_sq *sq) int wq_sz = mlx5_wq_cyc_get_size(&sq->wq); int x; - for (x = 0; x != wq_sz; x++) + for (x = 0; x != wq_sz; x++) { + if (sq->mbuf[x].mbuf != NULL) { + bus_dmamap_unload(sq->dma_tag, sq->mbuf[x].dma_map); + m_freem(sq->mbuf[x].mbuf); + } bus_dmamap_destroy(sq->dma_tag, sq->mbuf[x].dma_map); + } free(sq->mbuf, M_MLX5EN); } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Wed May 8 10:41:21 2019 (r347276) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Wed May 8 10:41:44 2019 (r347277) @@ -537,7 +537,7 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, int budget) for (x = 0; x != sq->cev_factor; x++) { ci = sqcc & sq->wq.sz_m1; mb = sq->mbuf[ci].mbuf; - sq->mbuf[ci].mbuf = NULL; /* Safety clear */ + sq->mbuf[ci].mbuf = NULL; if (mb == NULL) { if (sq->mbuf[ci].num_bytes == 0) { From owner-svn-src-all@freebsd.org Wed May 8 10:42:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4021715A53BF; Wed, 8 May 2019 10:42:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D79B4682F2; Wed, 8 May 2019 10:42:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD62C4ABD; Wed, 8 May 2019 10:42:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Ag5GB049227; Wed, 8 May 2019 10:42:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Ag57K049226; Wed, 8 May 2019 10:42:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081042.x48Ag57K049226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347278 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 347278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D79B4682F2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:42:06 -0000 Author: hselasky Date: Wed May 8 10:42:05 2019 New Revision: 347278 URL: https://svnweb.freebsd.org/changeset/base/347278 Log: Fix endless loop in ipoib_poll(). ib_req_notify_cq may return negative value which will indicate a failure. In the case of uncorrectable error, we will end up in an endless loop. Fix that, by going to another loop with poll_more only if there is anything left to poll. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Wed May 8 10:41:44 2019 (r347277) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Wed May 8 10:42:05 2019 (r347278) @@ -409,7 +409,7 @@ poll_more: spin_unlock(&priv->drain_lock); if (ib_req_notify_cq(priv->recv_cq, - IB_CQ_NEXT_COMP | IB_CQ_REPORT_MISSED_EVENTS)) + IB_CQ_NEXT_COMP | IB_CQ_REPORT_MISSED_EVENTS) > 0) goto poll_more; } From owner-svn-src-all@freebsd.org Wed May 8 10:42:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3038C15A5453; Wed, 8 May 2019 10:42:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9668A684B4; Wed, 8 May 2019 10:42:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71DAA4BFF; Wed, 8 May 2019 10:42:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AgYQg050982; Wed, 8 May 2019 10:42:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AgYXP050981; Wed, 8 May 2019 10:42:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081042.x48AgYXP050981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347279 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9668A684B4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:42:35 -0000 Author: hselasky Date: Wed May 8 10:42:33 2019 New Revision: 347279 URL: https://svnweb.freebsd.org/changeset/base/347279 Log: Fix netstat counters mapping in mlx5en(4). The current mapping of driver counters to netstat counters is wrong. For example, a single jabber packet, will cause the Ierrs counter to count three times. The work for mapping the hardware and software counters to their right place in netstat counters were already done in Linux, take that as is to the FreeBSD driver. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:42:05 2019 (r347278) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:42:33 2019 (r347279) @@ -637,22 +637,14 @@ mlx5e_update_stats_locked(struct mlx5e_priv *priv) #if (__FreeBSD_version < 1100000) /* no get_counters interface in fbsd 10 */ ifp->if_ipackets = s->rx_packets; - ifp->if_ierrors = s->rx_error_packets + - priv->stats.pport.alignment_err + - priv->stats.pport.check_seq_err + - priv->stats.pport.crc_align_errors + - priv->stats.pport.in_range_len_errors + - priv->stats.pport.jabbers + + ifp->if_ierrors = priv->stats.pport.in_range_len_errors + priv->stats.pport.out_of_range_len + - priv->stats.pport.oversize_pkts + - priv->stats.pport.symbol_err + priv->stats.pport.too_long_errors + - priv->stats.pport.undersize_pkts + - priv->stats.pport.unsupported_op_rx; - ifp->if_iqdrops = s->rx_out_of_buffer + - priv->stats.pport.drop_events; + priv->stats.pport.check_seq_err + + priv->stats.pport.alignment_err; + ifp->if_iqdrops = s->rx_out_of_buffer; ifp->if_opackets = s->tx_packets; - ifp->if_oerrors = s->tx_error_packets; + ifp->if_oerrors = priv->stats.port_stats_debug.out_discards; ifp->if_snd.ifq_drops = s->tx_queue_dropped; ifp->if_ibytes = s->rx_bytes; ifp->if_obytes = s->tx_bytes; @@ -2769,28 +2761,20 @@ mlx5e_get_counter(struct ifnet *ifp, ift_counter cnt) retval = priv->stats.vport.rx_packets; break; case IFCOUNTER_IERRORS: - retval = priv->stats.vport.rx_error_packets + - priv->stats.pport.alignment_err + - priv->stats.pport.check_seq_err + - priv->stats.pport.crc_align_errors + - priv->stats.pport.in_range_len_errors + - priv->stats.pport.jabbers + + retval = priv->stats.pport.in_range_len_errors + priv->stats.pport.out_of_range_len + - priv->stats.pport.oversize_pkts + - priv->stats.pport.symbol_err + priv->stats.pport.too_long_errors + - priv->stats.pport.undersize_pkts + - priv->stats.pport.unsupported_op_rx; + priv->stats.pport.check_seq_err + + priv->stats.pport.alignment_err; break; case IFCOUNTER_IQDROPS: - retval = priv->stats.vport.rx_out_of_buffer + - priv->stats.pport.drop_events; + retval = priv->stats.vport.rx_out_of_buffer; break; case IFCOUNTER_OPACKETS: retval = priv->stats.vport.tx_packets; break; case IFCOUNTER_OERRORS: - retval = priv->stats.vport.tx_error_packets; + retval = priv->stats.port_stats_debug.out_discards; break; case IFCOUNTER_IBYTES: retval = priv->stats.vport.rx_bytes; From owner-svn-src-all@freebsd.org Wed May 8 10:42:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63B0715A54A6; Wed, 8 May 2019 10:42:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B02F685ED; Wed, 8 May 2019 10:42:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D88024C01; Wed, 8 May 2019 10:42:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AgpHm051046; Wed, 8 May 2019 10:42:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Agp2M051045; Wed, 8 May 2019 10:42:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081042.x48Agp2M051045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347280 - head/usr.sbin/mlx5tool X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/usr.sbin/mlx5tool X-SVN-Commit-Revision: 347280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B02F685ED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:42:52 -0000 Author: hselasky Date: Wed May 8 10:42:51 2019 New Revision: 347280 URL: https://svnweb.freebsd.org/changeset/base/347280 Log: Fix style. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/usr.sbin/mlx5tool/mlx5tool.c Modified: head/usr.sbin/mlx5tool/mlx5tool.c ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.c Wed May 8 10:42:33 2019 (r347279) +++ head/usr.sbin/mlx5tool/mlx5tool.c Wed May 8 10:42:51 2019 (r347280) @@ -184,7 +184,7 @@ main(int argc, char *argv[]) act = ACTION_DUMP_GET; break; case 'e': - act= ACTION_DUMP_FORCE; + act = ACTION_DUMP_FORCE; break; case 'o': dumpname = optarg; From owner-svn-src-all@freebsd.org Wed May 8 10:43:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07CA215A5579; Wed, 8 May 2019 10:43:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A19EA69B2B; Wed, 8 May 2019 10:43:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CF0F4C02; Wed, 8 May 2019 10:43:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AhZYl051142; Wed, 8 May 2019 10:43:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AhZZI051141; Wed, 8 May 2019 10:43:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081043.x48AhZZI051141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347281 - head/usr.sbin/mlx5tool X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/usr.sbin/mlx5tool X-SVN-Commit-Revision: 347281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A19EA69B2B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:43:36 -0000 Author: hselasky Date: Wed May 8 10:43:35 2019 New Revision: 347281 URL: https://svnweb.freebsd.org/changeset/base/347281 Log: Fix typo. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/usr.sbin/mlx5tool/mlx5tool.8 Modified: head/usr.sbin/mlx5tool/mlx5tool.8 ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.8 Wed May 8 10:42:51 2019 (r347280) +++ head/usr.sbin/mlx5tool/mlx5tool.8 Wed May 8 10:43:35 2019 (r347281) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 8, 2018 +.Dd May 7, 2019 .Dt mlx5tool 8 .Os .Sh NAME @@ -78,7 +78,7 @@ command for the specified device. Clear the stored firmware dump, preparing the kernel buffer for the next dump. .It Fl w -Fetche the stored firmware dump and writes it into the file specified +Fetches the stored firmware dump and writes it into the file specified by the .Fl o option argument. From owner-svn-src-all@freebsd.org Wed May 8 10:44:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACBE115A5615; Wed, 8 May 2019 10:44:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 524E569CFE; Wed, 8 May 2019 10:44:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CBC24C03; Wed, 8 May 2019 10:44:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Ai3wf051233; Wed, 8 May 2019 10:44:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Ai3k3051232; Wed, 8 May 2019 10:44:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081044.x48Ai3k3051232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347282 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 524E569CFE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:44:03 -0000 Author: hselasky Date: Wed May 8 10:44:02 2019 New Revision: 347282 URL: https://svnweb.freebsd.org/changeset/base/347282 Log: Change implicit and probably erronous EPERM to EIO on command status error in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed May 8 10:43:35 2019 (r347281) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed May 8 10:44:02 2019 (r347282) @@ -1235,7 +1235,7 @@ EXPORT_SYMBOL(mlx5_cmd_comp_handler); static int status_to_err(u8 status) { - return status ? -1 : 0; /* TBD more meaningful codes */ + return status ? -EIO : 0; /* TBD more meaningful codes */ } static struct mlx5_cmd_msg *alloc_msg(struct mlx5_core_dev *dev, int in_size, From owner-svn-src-all@freebsd.org Wed May 8 10:44:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FD1715A568F; Wed, 8 May 2019 10:44:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1579C69E94; Wed, 8 May 2019 10:44:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5B6C4C04; Wed, 8 May 2019 10:44:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AiRYd051304; Wed, 8 May 2019 10:44:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AiRax051303; Wed, 8 May 2019 10:44:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081044.x48AiRax051303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347283 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1579C69E94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:44:28 -0000 Author: hselasky Date: Wed May 8 10:44:27 2019 New Revision: 347283 URL: https://svnweb.freebsd.org/changeset/base/347283 Log: Remove redundant line of code in mlx5core. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed May 8 10:44:02 2019 (r347282) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed May 8 10:44:27 2019 (r347283) @@ -1215,7 +1215,7 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, ent->ret = verify_signature(ent); else ent->ret = 0; - ent->status = ent->lay->status_own >> 1; + if (triggered) ent->status = MLX5_DRIVER_STATUS_ABORTED; else From owner-svn-src-all@freebsd.org Wed May 8 10:44:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2EBD15A571D; Wed, 8 May 2019 10:44:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D3A16A038; Wed, 8 May 2019 10:44:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 785664C05; Wed, 8 May 2019 10:44:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AisNr051378; Wed, 8 May 2019 10:44:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Aisw0051377; Wed, 8 May 2019 10:44:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081044.x48Aisw0051377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347284 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D3A16A038 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:44:55 -0000 Author: hselasky Date: Wed May 8 10:44:53 2019 New Revision: 347284 URL: https://svnweb.freebsd.org/changeset/base/347284 Log: Convert remaining module parameters into SYSCTLs in mlx5core. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:44:27 2019 (r347283) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:44:53 2019 (r347284) @@ -25,8 +25,6 @@ * $FreeBSD$ */ -#define LINUXKPI_PARAM_PREFIX mlx5_ - #include #include #include @@ -57,17 +55,19 @@ MODULE_DEPEND(mlx5, linuxkpi, 1, 1, 1); #endif MODULE_VERSION(mlx5, 1); +SYSCTL_NODE(_hw, OID_AUTO, mlx5, CTLFLAG_RW, 0, "mlx5 hardware controls"); + int mlx5_core_debug_mask; -module_param_named(debug_mask, mlx5_core_debug_mask, int, 0644); -MODULE_PARM_DESC(debug_mask, "debug mask: 1 = dump cmd data, 2 = dump cmd exec time, 3 = both. Default=0"); +SYSCTL_INT(_hw_mlx5, OID_AUTO, debug_mask, CTLFLAG_RWTUN, + &mlx5_core_debug_mask, 0, + "debug mask: 1 = dump cmd data, 2 = dump cmd exec time, 3 = both. Default=0"); #define MLX5_DEFAULT_PROF 2 -static int prof_sel = MLX5_DEFAULT_PROF; -module_param_named(prof_sel, prof_sel, int, 0444); -MODULE_PARM_DESC(prof_sel, "profile selector. Valid range 0 - 2"); +static int mlx5_prof_sel = MLX5_DEFAULT_PROF; +SYSCTL_INT(_hw_mlx5, OID_AUTO, prof_sel, CTLFLAG_RWTUN, + &mlx5_prof_sel, 0, + "profile selector. Valid range 0 - 2"); -SYSCTL_NODE(_hw, OID_AUTO, mlx5, CTLFLAG_RW, 0, "mlx5 HW controls"); - static int mlx5_fast_unload_enabled = 1; SYSCTL_INT(_hw_mlx5, OID_AUTO, fast_unload_enabled, CTLFLAG_RWTUN, &mlx5_fast_unload_enabled, 0, @@ -1235,11 +1235,11 @@ static int init_one(struct pci_dev *pdev, if (id) priv->pci_dev_data = id->driver_data; - if (prof_sel < 0 || prof_sel >= ARRAY_SIZE(profiles)) { + if (mlx5_prof_sel < 0 || mlx5_prof_sel >= ARRAY_SIZE(profiles)) { device_printf(bsddev, "WARN: selected profile out of range, selecting default (%d)\n", MLX5_DEFAULT_PROF); - prof_sel = MLX5_DEFAULT_PROF; + mlx5_prof_sel = MLX5_DEFAULT_PROF; } - dev->profile = &profiles[prof_sel]; + dev->profile = &profiles[mlx5_prof_sel]; dev->pdev = pdev; dev->event = mlx5_core_event; From owner-svn-src-all@freebsd.org Wed May 8 10:49:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9AD415A5A8E; Wed, 8 May 2019 10:49:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 300966A5A8; Wed, 8 May 2019 10:49:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D3214C06; Wed, 8 May 2019 10:49:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48An76F051660; Wed, 8 May 2019 10:49:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48An58o051653; Wed, 8 May 2019 10:49:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081049.x48An58o051653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347285 - in head: share/man/man4 sys/conf sys/dev/mlxfw sys/modules sys/modules/mlxfw X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/mlxfw sys/modules sys/modules/mlxfw X-SVN-Commit-Revision: 347285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 300966A5A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:49:08 -0000 Author: hselasky Date: Wed May 8 10:49:05 2019 New Revision: 347285 URL: https://svnweb.freebsd.org/changeset/base/347285 Log: Initial version of Mellanox in-kernel firmware upgrade support. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Added: head/sys/dev/mlxfw/ head/sys/dev/mlxfw/mlxfw.h (contents, props changed) head/sys/dev/mlxfw/mlxfw_fsm.c (contents, props changed) head/sys/dev/mlxfw/mlxfw_mfa2.c (contents, props changed) head/sys/dev/mlxfw/mlxfw_mfa2.h (contents, props changed) head/sys/dev/mlxfw/mlxfw_mfa2_file.h (contents, props changed) head/sys/dev/mlxfw/mlxfw_mfa2_format.h (contents, props changed) head/sys/dev/mlxfw/mlxfw_mfa2_tlv.h (contents, props changed) head/sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.c (contents, props changed) head/sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.h (contents, props changed) head/sys/modules/mlxfw/ head/sys/modules/mlxfw/Makefile (contents, props changed) Modified: head/share/man/man4/mlx5en.4 head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/modules/Makefile Modified: head/share/man/man4/mlx5en.4 ============================================================================== --- head/share/man/man4/mlx5en.4 Wed May 8 10:44:53 2019 (r347284) +++ head/share/man/man4/mlx5en.4 Wed May 8 10:49:05 2019 (r347285) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 29, 2018 +.Dd May 8, 2019 .Dt MLX5EN 4 .Os .Sh NAME @@ -37,6 +37,9 @@ kernel configuration file: .Bd -ragged -offset indent .Cd "options COMPAT_LINUXKPI" .Cd "options RATELIMIT" +.Cd "device xz" +.Cd "device mlxfw" +.Cd "device firmware" .Cd "device mlx5" .Cd "device mlx5en" .Ed Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed May 8 10:44:53 2019 (r347284) +++ head/sys/conf/files Wed May 8 10:49:05 2019 (r347285) @@ -2376,6 +2376,12 @@ dev/mii/ukphy_subr.c optional miibus | mii dev/mii/vscphy.c optional miibus | vscphy dev/mii/xmphy.c optional miibus | xmphy dev/mk48txx/mk48txx.c optional mk48txx +dev/mlxfw/mlxfw_fsm.c optional mlxfw \ + compile-with "${MLXFW_C}" +dev/mlxfw/mlxfw_mfa2.c optional mlxfw \ + compile-with "${MLXFW_C}" +dev/mlxfw/mlxfw_mfa2_tlv_multi.c optional mlxfw \ + compile-with "${MLXFW_C}" dev/mlx/mlx.c optional mlx dev/mlx/mlx_disk.c optional mlx dev/mlx/mlx_pci.c optional mlx pci Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Wed May 8 10:44:53 2019 (r347284) +++ head/sys/conf/kern.pre.mk Wed May 8 10:49:05 2019 (r347285) @@ -229,6 +229,12 @@ OFEDCFLAGS= ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_ME OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} +# mlxfw C flags. +MLXFW_C= ${OFED_C_NOIMP} \ + -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \ + -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \ + ${.IMPSRC} + GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} SYSTEM_CFILES= config.c env.c hints.c vnode_if.c SYSTEM_DEP= Makefile ${SYSTEM_OBJS} Added: head/sys/dev/mlxfw/mlxfw.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlxfw/mlxfw.h Wed May 8 10:49:05 2019 (r347285) @@ -0,0 +1,104 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2017-2019 Mellanox Technologies. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Mellanox nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MLXFW_H +#define _MLXFW_H + +#include + +#define NLA_ALIGNTO 4 +#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) + +enum mlxfw_fsm_state { + MLXFW_FSM_STATE_IDLE, + MLXFW_FSM_STATE_LOCKED, + MLXFW_FSM_STATE_INITIALIZE, + MLXFW_FSM_STATE_DOWNLOAD, + MLXFW_FSM_STATE_VERIFY, + MLXFW_FSM_STATE_APPLY, + MLXFW_FSM_STATE_ACTIVATE, +}; + +enum mlxfw_fsm_state_err { + MLXFW_FSM_STATE_ERR_OK, + MLXFW_FSM_STATE_ERR_ERROR, + MLXFW_FSM_STATE_ERR_REJECTED_DIGEST_ERR, + MLXFW_FSM_STATE_ERR_REJECTED_NOT_APPLICABLE, + MLXFW_FSM_STATE_ERR_REJECTED_UNKNOWN_KEY, + MLXFW_FSM_STATE_ERR_REJECTED_AUTH_FAILED, + MLXFW_FSM_STATE_ERR_REJECTED_UNSIGNED, + MLXFW_FSM_STATE_ERR_REJECTED_KEY_NOT_APPLICABLE, + MLXFW_FSM_STATE_ERR_REJECTED_BAD_FORMAT, + MLXFW_FSM_STATE_ERR_BLOCKED_PENDING_RESET, + MLXFW_FSM_STATE_ERR_MAX, +}; + +struct mlxfw_dev; +struct firmware; + +struct mlxfw_dev_ops { + int (*component_query)(struct mlxfw_dev *mlxfw_dev, u16 component_index, + u32 *p_max_size, u8 *p_align_bits, + u16 *p_max_write_size); + + int (*fsm_lock)(struct mlxfw_dev *mlxfw_dev, u32 *fwhandle); + + int (*fsm_component_update)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + u16 component_index, u32 component_size); + + int (*fsm_block_download)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + u8 *data, u16 size, u32 offset); + + int (*fsm_component_verify)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + u16 component_index); + + int (*fsm_activate)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle); + + int (*fsm_query_state)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + enum mlxfw_fsm_state *fsm_state, + enum mlxfw_fsm_state_err *fsm_state_err); + + void (*fsm_cancel)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle); + + void (*fsm_release)(struct mlxfw_dev *mlxfw_dev, u32 fwhandle); +}; + +struct mlxfw_dev { + const struct mlxfw_dev_ops *ops; + const char *psid; + u16 psid_size; +}; + +int mlxfw_firmware_flash(struct mlxfw_dev *mlxfw_dev, + const struct firmware *firmware); +#endif Added: head/sys/dev/mlxfw/mlxfw_fsm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlxfw/mlxfw_fsm.c Wed May 8 10:49:05 2019 (r347285) @@ -0,0 +1,275 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2017-2019 Mellanox Technologies. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Mellanox nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define pr_fmt(fmt) "mlxfw: " fmt + +#include +#include +#include + +#include "mlxfw.h" +#include "mlxfw_mfa2.h" + +#define MLXFW_FSM_STATE_WAIT_CYCLE_MS 200 +#define MLXFW_FSM_STATE_WAIT_TIMEOUT_MS 30000 +#define MLXFW_FSM_STATE_WAIT_ROUNDS \ + (MLXFW_FSM_STATE_WAIT_TIMEOUT_MS / MLXFW_FSM_STATE_WAIT_CYCLE_MS) +#define MLXFW_FSM_MAX_COMPONENT_SIZE (10 * (1 << 20)) + +static const char * const mlxfw_fsm_state_err_str[] = { + [MLXFW_FSM_STATE_ERR_ERROR] = + "general error", + [MLXFW_FSM_STATE_ERR_REJECTED_DIGEST_ERR] = + "component hash mismatch", + [MLXFW_FSM_STATE_ERR_REJECTED_NOT_APPLICABLE] = + "component not applicable", + [MLXFW_FSM_STATE_ERR_REJECTED_UNKNOWN_KEY] = + "unknown key", + [MLXFW_FSM_STATE_ERR_REJECTED_AUTH_FAILED] = + "authentication failed", + [MLXFW_FSM_STATE_ERR_REJECTED_UNSIGNED] = + "component was not signed", + [MLXFW_FSM_STATE_ERR_REJECTED_KEY_NOT_APPLICABLE] = + "key not applicable", + [MLXFW_FSM_STATE_ERR_REJECTED_BAD_FORMAT] = + "bad format", + [MLXFW_FSM_STATE_ERR_BLOCKED_PENDING_RESET] = + "pending reset", + [MLXFW_FSM_STATE_ERR_MAX] = + "unknown error" +}; + +static int mlxfw_fsm_state_wait(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + enum mlxfw_fsm_state fsm_state) +{ + enum mlxfw_fsm_state_err fsm_state_err; + enum mlxfw_fsm_state curr_fsm_state; + int times; + int err; + + times = MLXFW_FSM_STATE_WAIT_ROUNDS; +retry: + err = mlxfw_dev->ops->fsm_query_state(mlxfw_dev, fwhandle, + &curr_fsm_state, &fsm_state_err); + if (err) + return err; + + if (fsm_state_err != MLXFW_FSM_STATE_ERR_OK) { + pr_err("Firmware flash failed: %s\n", + mlxfw_fsm_state_err_str[fsm_state_err]); + return -EINVAL; + } + if (curr_fsm_state != fsm_state) { + if (--times == 0) { + pr_err("Timeout reached on FSM state change"); + return -ETIMEDOUT; + } + msleep(MLXFW_FSM_STATE_WAIT_CYCLE_MS); + goto retry; + } + return 0; +} + +#define MLXFW_ALIGN_DOWN(x, align_bits) ((x) & ~((1 << (align_bits)) - 1)) +#define MLXFW_ALIGN_UP(x, align_bits) \ + MLXFW_ALIGN_DOWN((x) + ((1 << (align_bits)) - 1), (align_bits)) + +static int mlxfw_flash_component(struct mlxfw_dev *mlxfw_dev, + u32 fwhandle, + struct mlxfw_mfa2_component *comp) +{ + u16 comp_max_write_size; + u8 comp_align_bits; + u32 comp_max_size; + u16 block_size; + u8 *block_ptr; + u32 offset; + int err; + + err = mlxfw_dev->ops->component_query(mlxfw_dev, comp->index, + &comp_max_size, &comp_align_bits, + &comp_max_write_size); + if (err) + return err; + + comp_max_size = min_t(u32, comp_max_size, MLXFW_FSM_MAX_COMPONENT_SIZE); + if (comp->data_size > comp_max_size) { + pr_err("Component %d is of size %d which is bigger than limit %d\n", + comp->index, comp->data_size, comp_max_size); + return -EINVAL; + } + + comp_max_write_size = MLXFW_ALIGN_DOWN(comp_max_write_size, + comp_align_bits); + + pr_debug("Component update\n"); + err = mlxfw_dev->ops->fsm_component_update(mlxfw_dev, fwhandle, + comp->index, + comp->data_size); + if (err) + return err; + + err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle, + MLXFW_FSM_STATE_DOWNLOAD); + if (err) + goto err_out; + + pr_debug("Component download\n"); + for (offset = 0; + offset < MLXFW_ALIGN_UP(comp->data_size, comp_align_bits); + offset += comp_max_write_size) { + block_ptr = comp->data + offset; + block_size = (u16) min_t(u32, comp->data_size - offset, + comp_max_write_size); + err = mlxfw_dev->ops->fsm_block_download(mlxfw_dev, fwhandle, + block_ptr, block_size, + offset); + if (err) + goto err_out; + } + + pr_debug("Component verify\n"); + err = mlxfw_dev->ops->fsm_component_verify(mlxfw_dev, fwhandle, + comp->index); + if (err) + goto err_out; + + err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle, MLXFW_FSM_STATE_LOCKED); + if (err) + goto err_out; + return 0; + +err_out: + mlxfw_dev->ops->fsm_cancel(mlxfw_dev, fwhandle); + return err; +} + +static int mlxfw_flash_components(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + struct mlxfw_mfa2_file *mfa2_file) +{ + u32 component_count; + int err; + int i; + + err = mlxfw_mfa2_file_component_count(mfa2_file, mlxfw_dev->psid, + mlxfw_dev->psid_size, + &component_count); + if (err) { + pr_err("Could not find device PSID in MFA2 file\n"); + return err; + } + + for (i = 0; i < component_count; i++) { + struct mlxfw_mfa2_component *comp; + + comp = mlxfw_mfa2_file_component_get(mfa2_file, mlxfw_dev->psid, + mlxfw_dev->psid_size, i); + if (IS_ERR(comp)) + return PTR_ERR(comp); + + pr_info("Flashing component type %d\n", comp->index); + err = mlxfw_flash_component(mlxfw_dev, fwhandle, comp); + mlxfw_mfa2_file_component_put(comp); + if (err) + return err; + } + return 0; +} + +int mlxfw_firmware_flash(struct mlxfw_dev *mlxfw_dev, + const struct firmware *firmware) +{ + struct mlxfw_mfa2_file *mfa2_file; + u32 fwhandle; + int err; + + if (!mlxfw_mfa2_check(firmware)) { + pr_err("Firmware file is not MFA2\n"); + return -EINVAL; + } + + mfa2_file = mlxfw_mfa2_file_init(firmware); + if (IS_ERR(mfa2_file)) + return PTR_ERR(mfa2_file); + + pr_info("Initialize firmware flash process\n"); + err = mlxfw_dev->ops->fsm_lock(mlxfw_dev, &fwhandle); + if (err) { + pr_err("Could not lock the firmware FSM\n"); + goto err_fsm_lock; + } + + err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle, + MLXFW_FSM_STATE_LOCKED); + if (err) + goto err_state_wait_idle_to_locked; + + err = mlxfw_flash_components(mlxfw_dev, fwhandle, mfa2_file); + if (err) + goto err_flash_components; + + pr_debug("Activate image\n"); + err = mlxfw_dev->ops->fsm_activate(mlxfw_dev, fwhandle); + if (err) { + pr_err("Could not activate the downloaded image\n"); + goto err_fsm_activate; + } + + err = mlxfw_fsm_state_wait(mlxfw_dev, fwhandle, MLXFW_FSM_STATE_LOCKED); + if (err) + goto err_state_wait_activate_to_locked; + + pr_debug("Handle release\n"); + mlxfw_dev->ops->fsm_release(mlxfw_dev, fwhandle); + + pr_info("Firmware flash done.\n"); + mlxfw_mfa2_file_fini(mfa2_file); + return 0; + +err_state_wait_activate_to_locked: +err_fsm_activate: +err_flash_components: +err_state_wait_idle_to_locked: + mlxfw_dev->ops->fsm_release(mlxfw_dev, fwhandle); +err_fsm_lock: + mlxfw_mfa2_file_fini(mfa2_file); + return err; +} +EXPORT_SYMBOL(mlxfw_firmware_flash); + +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_AUTHOR("Yotam Gigi "); +MODULE_DESCRIPTION("Mellanox firmware flash lib"); +MODULE_VERSION(mlxfw, 1); +MODULE_DEPEND(mlxfw, linuxkpi, 1, 1, 1); +MODULE_DEPEND(mlxfw, xz, 1, 1, 1); Added: head/sys/dev/mlxfw/mlxfw_mfa2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlxfw/mlxfw_mfa2.c Wed May 8 10:49:05 2019 (r347285) @@ -0,0 +1,619 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2017-2019 Mellanox Technologies. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Mellanox nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define pr_fmt(fmt) "mlxfw_mfa2: " fmt + +#include +#include +#include +#include + +#include "mlxfw_mfa2.h" +#include "mlxfw_mfa2_file.h" +#include "mlxfw_mfa2_tlv.h" +#include "mlxfw_mfa2_format.h" +#include "mlxfw_mfa2_tlv_multi.h" + +/* MFA2 FILE + * +----------------------------------+ + * | MFA2 finger print | + * +----------------------------------+ + * | package descriptor multi_tlv | + * | +------------------------------+ | +-----------------+ + * | | package descriptor tlv +-----> |num_devices=n | + * | +------------------------------+ | |num_components=m | + * +----------------------------------+ |CB offset | + * | device descriptor multi_tlv | |... | + * | +------------------------------+ | | | + * | | PSID tlv | | +-----------------+ + * | +------------------------------+ | + * | | component index tlv | | + * | +------------------------------+ | + * +----------------------------------+ + * | component descriptor multi_tlv | + * | +------------------------------+ | +-----------------+ + * | | component descriptor tlv +-----> |Among others: | + * | +------------------------------+ | |CB offset=o | + * +----------------------------------+ |comp index=i | + * | | |... | + * | | | | + * | | +-----------------+ + * | COMPONENT BLOCK (CB) | + * | | + * | | + * | | + * +----------------------------------+ + * + * On the top level, an MFA2 file contains: + * - Fingerprint + * - Several multi_tlvs (TLVs of type MLXFW_MFA2_TLV_MULTI, as defined in + * mlxfw_mfa2_format.h) + * - Compresses content block + * + * The first multi_tlv + * ------------------- + * The first multi TLV is treated as package descriptor, and expected to have a + * first TLV child of type MLXFW_MFA2_TLV_PACKAGE_DESCRIPTOR which contains all + * the global information needed to parse the file. Among others, it contains + * the number of device descriptors and component descriptor following this + * multi TLV. + * + * The device descriptor multi_tlv + * ------------------------------- + * The multi TLVs following the package descriptor are treated as device + * descriptor, and are expected to have the following children: + * - PSID TLV child of type MLXFW_MFA2_TLV_PSID containing that device PSID. + * - Component index of type MLXFW_MFA2_TLV_COMPONENT_PTR that contains that + * device component index. + * + * The component descriptor multi_tlv + * ---------------------------------- + * The multi TLVs following the device descriptor multi TLVs are treated as + * component descriptor, and are expected to have a first child of type + * MLXFW_MFA2_TLV_COMPONENT_DESCRIPTOR that contains mostly the component index, + * needed for the flash process and the offset to the binary within the + * component block. + */ + +static const u8 mlxfw_mfa2_fingerprint[] = "MLNX.MFA2.XZ.00!"; +static const int mlxfw_mfa2_fingerprint_len = + sizeof(mlxfw_mfa2_fingerprint) - 1; + +static const u8 mlxfw_mfa2_comp_magic[] = "#BIN.COMPONENT!#"; +static const int mlxfw_mfa2_comp_magic_len = sizeof(mlxfw_mfa2_comp_magic) - 1; + +bool mlxfw_mfa2_check(const struct firmware *fw) +{ + if (fw->datasize < sizeof(mlxfw_mfa2_fingerprint)) + return false; + + return memcmp(fw->data, mlxfw_mfa2_fingerprint, + mlxfw_mfa2_fingerprint_len) == 0; +} + +static bool +mlxfw_mfa2_tlv_multi_validate(const struct mlxfw_mfa2_file *mfa2_file, + const struct mlxfw_mfa2_tlv_multi *multi) +{ + const struct mlxfw_mfa2_tlv *tlv; + u16 idx; + + /* Check that all children are valid */ + mlxfw_mfa2_tlv_multi_foreach(mfa2_file, tlv, idx, multi) { + if (!tlv) { + pr_err("Multi has invalid child"); + return false; + } + } + return true; +} + +static bool +mlxfw_mfa2_file_dev_validate(const struct mlxfw_mfa2_file *mfa2_file, + const struct mlxfw_mfa2_tlv *dev_tlv, + u16 dev_idx) +{ + const struct mlxfw_mfa2_tlv_component_ptr *cptr; + const struct mlxfw_mfa2_tlv_multi *multi; + const struct mlxfw_mfa2_tlv_psid *psid; + const struct mlxfw_mfa2_tlv *tlv; + u16 cptr_count; + u16 cptr_idx; + int err; + + pr_debug("Device %d\n", dev_idx); + + multi = mlxfw_mfa2_tlv_multi_get(mfa2_file, dev_tlv); + if (!multi) { + pr_err("Device %d is not a valid TLV error\n", dev_idx); + return false; + } + + if (!mlxfw_mfa2_tlv_multi_validate(mfa2_file, multi)) + return false; + + /* Validate the device has PSID tlv */ + tlv = mlxfw_mfa2_tlv_multi_child_find(mfa2_file, multi, + MLXFW_MFA2_TLV_PSID, 0); + if (!tlv) { + pr_err("Device %d does not have PSID\n", dev_idx); + return false; + } + + psid = mlxfw_mfa2_tlv_psid_get(mfa2_file, tlv); + if (!psid) { + pr_err("Device %d PSID TLV is not valid\n", dev_idx); + return false; + } + + print_hex_dump_debug(" -- Device PSID ", DUMP_PREFIX_NONE, 16, 16, + psid->psid, be16_to_cpu(tlv->len), true); + + /* Validate the device has COMPONENT_PTR */ + err = mlxfw_mfa2_tlv_multi_child_count(mfa2_file, multi, + MLXFW_MFA2_TLV_COMPONENT_PTR, + &cptr_count); + if (err) + return false; + + if (cptr_count == 0) { + pr_err("Device %d has no components\n", dev_idx); + return false; + } + + for (cptr_idx = 0; cptr_idx < cptr_count; cptr_idx++) { + tlv = mlxfw_mfa2_tlv_multi_child_find(mfa2_file, multi, + MLXFW_MFA2_TLV_COMPONENT_PTR, + cptr_idx); + if (!tlv) + return false; + + cptr = mlxfw_mfa2_tlv_component_ptr_get(mfa2_file, tlv); + if (!cptr) { + pr_err("Device %d COMPONENT_PTR TLV is not valid\n", + dev_idx); + return false; + } + + pr_debug(" -- Component index %d\n", + be16_to_cpu(cptr->component_index)); + } + return true; +} + +static bool +mlxfw_mfa2_file_comp_validate(const struct mlxfw_mfa2_file *mfa2_file, + const struct mlxfw_mfa2_tlv *comp_tlv, + u16 comp_idx) +{ + const struct mlxfw_mfa2_tlv_component_descriptor *cdesc; + const struct mlxfw_mfa2_tlv_multi *multi; + const struct mlxfw_mfa2_tlv *tlv; + + pr_debug("Component %d\n", comp_idx); + + multi = mlxfw_mfa2_tlv_multi_get(mfa2_file, comp_tlv); + if (!multi) { + pr_err("Component %d is not a valid TLV error\n", comp_idx); + return false; + } + + if (!mlxfw_mfa2_tlv_multi_validate(mfa2_file, multi)) + return false; + + /* Check that component have COMPONENT_DESCRIPTOR as first child */ + tlv = mlxfw_mfa2_tlv_multi_child(mfa2_file, multi); + if (!tlv) { + pr_err("Component descriptor %d multi TLV error\n", comp_idx); + return false; + } + + cdesc = mlxfw_mfa2_tlv_component_descriptor_get(mfa2_file, tlv); + if (!cdesc) { + pr_err("Component %d does not have a valid descriptor\n", + comp_idx); + return false; + } + pr_debug(" -- Component type %d\n", be16_to_cpu(cdesc->identifier)); + pr_debug(" -- Offset %#jx and size %d\n", + (uintmax_t)((u64) be32_to_cpu(cdesc->cb_offset_h) << 32) + | be32_to_cpu(cdesc->cb_offset_l), be32_to_cpu(cdesc->size)); + + return true; +} + +static bool mlxfw_mfa2_file_validate(const struct mlxfw_mfa2_file *mfa2_file) +{ + const struct mlxfw_mfa2_tlv *tlv; + u16 idx; + + pr_debug("Validating file\n"); + + /* check that all the devices exist */ + mlxfw_mfa2_tlv_foreach(mfa2_file, tlv, idx, mfa2_file->first_dev, + mfa2_file->dev_count) { + if (!tlv) { + pr_err("Device TLV error\n"); + return false; + } + + /* Check each device */ + if (!mlxfw_mfa2_file_dev_validate(mfa2_file, tlv, idx)) + return false; + } + + /* check that all the components exist */ + mlxfw_mfa2_tlv_foreach(mfa2_file, tlv, idx, mfa2_file->first_component, + mfa2_file->component_count) { + if (!tlv) { + pr_err("Device TLV error\n"); + return false; + } + + /* Check each component */ + if (!mlxfw_mfa2_file_comp_validate(mfa2_file, tlv, idx)) + return false; + } + return true; +} + +struct mlxfw_mfa2_file *mlxfw_mfa2_file_init(const struct firmware *fw) +{ + const struct mlxfw_mfa2_tlv_package_descriptor *pd; + const struct mlxfw_mfa2_tlv_multi *multi; + const struct mlxfw_mfa2_tlv *multi_child; + const struct mlxfw_mfa2_tlv *first_tlv; + struct mlxfw_mfa2_file *mfa2_file; + const u8 *first_tlv_ptr; + const u8 *cb_top_ptr; + + mfa2_file = kcalloc(1, sizeof(*mfa2_file), GFP_KERNEL); + if (!mfa2_file) + return ERR_PTR(-ENOMEM); + + mfa2_file->fw = fw; + first_tlv_ptr = (const u8 *) fw->data + NLA_ALIGN(mlxfw_mfa2_fingerprint_len); + first_tlv = mlxfw_mfa2_tlv_get(mfa2_file, first_tlv_ptr); + if (!first_tlv) { + pr_err("Could not parse package descriptor TLV\n"); + goto err_out; + } + + multi = mlxfw_mfa2_tlv_multi_get(mfa2_file, first_tlv); + if (!multi) { + pr_err("First TLV is not of valid multi type\n"); + goto err_out; + } + + multi_child = mlxfw_mfa2_tlv_multi_child(mfa2_file, multi); + if (!multi_child) + goto err_out; + + pd = mlxfw_mfa2_tlv_package_descriptor_get(mfa2_file, multi_child); + if (!pd) { + pr_err("Could not parse package descriptor TLV\n"); + goto err_out; + } + + mfa2_file->first_dev = mlxfw_mfa2_tlv_next(mfa2_file, first_tlv); + if (!mfa2_file->first_dev) { + pr_err("First device TLV is not valid\n"); + goto err_out; + } + + mfa2_file->dev_count = be16_to_cpu(pd->num_devices); + mfa2_file->first_component = mlxfw_mfa2_tlv_advance(mfa2_file, + mfa2_file->first_dev, + mfa2_file->dev_count); + mfa2_file->component_count = be16_to_cpu(pd->num_components); + mfa2_file->cb = (const u8 *) fw->data + NLA_ALIGN(be32_to_cpu(pd->cb_offset)); + if (!mlxfw_mfa2_valid_ptr(mfa2_file, mfa2_file->cb)) { + pr_err("Component block is out side the file\n"); + goto err_out; + } + mfa2_file->cb_archive_size = be32_to_cpu(pd->cb_archive_size); + cb_top_ptr = (const u8 *) mfa2_file->cb + mfa2_file->cb_archive_size - 1; + if (!mlxfw_mfa2_valid_ptr(mfa2_file, cb_top_ptr)) { + pr_err("Component block size is too big\n"); + goto err_out; + } + + if (!mlxfw_mfa2_file_validate(mfa2_file)) + goto err_out; + return mfa2_file; +err_out: + kfree(mfa2_file); + return ERR_PTR(-EINVAL); +} + +static const struct mlxfw_mfa2_tlv_multi * +mlxfw_mfa2_tlv_dev_get(const struct mlxfw_mfa2_file *mfa2_file, + const char *psid, u16 psid_size) +{ + const struct mlxfw_mfa2_tlv_psid *tlv_psid; + const struct mlxfw_mfa2_tlv_multi *dev_multi; + const struct mlxfw_mfa2_tlv *dev_tlv; + const struct mlxfw_mfa2_tlv *tlv; + u32 idx; + + /* for each device tlv */ + mlxfw_mfa2_tlv_foreach(mfa2_file, dev_tlv, idx, mfa2_file->first_dev, + mfa2_file->dev_count) { + if (!dev_tlv) + return NULL; + + dev_multi = mlxfw_mfa2_tlv_multi_get(mfa2_file, dev_tlv); + if (!dev_multi) + return NULL; + + /* find psid child and compare */ + tlv = mlxfw_mfa2_tlv_multi_child_find(mfa2_file, dev_multi, + MLXFW_MFA2_TLV_PSID, 0); + if (!tlv) + return NULL; + if (be16_to_cpu(tlv->len) != psid_size) + continue; + + tlv_psid = mlxfw_mfa2_tlv_psid_get(mfa2_file, tlv); + if (!tlv_psid) + return NULL; + + if (memcmp(psid, tlv_psid->psid, psid_size) == 0) + return dev_multi; + } + + return NULL; +} + +int mlxfw_mfa2_file_component_count(const struct mlxfw_mfa2_file *mfa2_file, + const char *psid, u32 psid_size, + u32 *p_count) +{ + const struct mlxfw_mfa2_tlv_multi *dev_multi; + u16 count; + int err; + + dev_multi = mlxfw_mfa2_tlv_dev_get(mfa2_file, psid, psid_size); + if (!dev_multi) + return -EINVAL; + + err = mlxfw_mfa2_tlv_multi_child_count(mfa2_file, dev_multi, + MLXFW_MFA2_TLV_COMPONENT_PTR, + &count); + if (err) + return err; + + *p_count = count; + return 0; +} + +static int mlxfw_mfa2_xz_dec_run(struct xz_dec *xz_dec, struct xz_buf *xz_buf, + bool *finished) +{ + enum xz_ret xz_ret; + + xz_ret = xz_dec_run(xz_dec, xz_buf); + + switch (xz_ret) { + case XZ_STREAM_END: + *finished = true; + return 0; + case XZ_OK: + *finished = false; + return 0; + case XZ_MEM_ERROR: + pr_err("xz no memory\n"); + return -ENOMEM; + case XZ_DATA_ERROR: + pr_err("xz file corrupted\n"); + return -EINVAL; + case XZ_FORMAT_ERROR: + pr_err("xz format not found\n"); + return -EINVAL; + case XZ_OPTIONS_ERROR: + pr_err("unsupported xz option\n"); + return -EINVAL; + case XZ_MEMLIMIT_ERROR: + pr_err("xz dictionary too small\n"); + return -EINVAL; + default: + pr_err("xz error %d\n", xz_ret); + return -EINVAL; + } +} + +static int mlxfw_mfa2_file_cb_offset_xz(const struct mlxfw_mfa2_file *mfa2_file, + off_t off, size_t size, u8 *buf) +{ + struct xz_dec *xz_dec; + struct xz_buf dec_buf; + off_t curr_off = 0; + bool finished; + int err; + + xz_dec = xz_dec_init(XZ_DYNALLOC, (u32) -1); + if (!xz_dec) + return -EINVAL; + + dec_buf.in_size = mfa2_file->cb_archive_size; + dec_buf.in = mfa2_file->cb; + dec_buf.in_pos = 0; + dec_buf.out = buf; + + /* decode up to the offset */ + do { + dec_buf.out_pos = 0; + dec_buf.out_size = min_t(size_t, size, off - curr_off); + if (dec_buf.out_size == 0) + break; + + err = mlxfw_mfa2_xz_dec_run(xz_dec, &dec_buf, &finished); + if (err) + goto out; + if (finished) { + pr_err("xz section too short\n"); + err = -EINVAL; + goto out; + } + curr_off += dec_buf.out_pos; + } while (curr_off != off); + + /* decode the needed section */ + dec_buf.out_pos = 0; + dec_buf.out_size = size; + err = mlxfw_mfa2_xz_dec_run(xz_dec, &dec_buf, &finished); +out: + xz_dec_end(xz_dec); + return err; +} + +static const struct mlxfw_mfa2_tlv_component_descriptor * +mlxfw_mfa2_file_component_tlv_get(const struct mlxfw_mfa2_file *mfa2_file, + u16 comp_index) +{ + const struct mlxfw_mfa2_tlv_multi *multi; + const struct mlxfw_mfa2_tlv *multi_child; + const struct mlxfw_mfa2_tlv *comp_tlv; + + if (comp_index > mfa2_file->component_count) + return NULL; + + comp_tlv = mlxfw_mfa2_tlv_advance(mfa2_file, mfa2_file->first_component, + comp_index); + if (!comp_tlv) + return NULL; + + multi = mlxfw_mfa2_tlv_multi_get(mfa2_file, comp_tlv); + if (!multi) + return NULL; + + multi_child = mlxfw_mfa2_tlv_multi_child(mfa2_file, multi); + if (!multi_child) + return NULL; + + return mlxfw_mfa2_tlv_component_descriptor_get(mfa2_file, multi_child); +} + +struct mlxfw_mfa2_comp_data { + struct mlxfw_mfa2_component comp; + u8 buff[0]; +}; + +static const struct mlxfw_mfa2_tlv_component_descriptor * +mlxfw_mfa2_file_component_find(const struct mlxfw_mfa2_file *mfa2_file, + const char *psid, int psid_size, + int component_index) +{ + const struct mlxfw_mfa2_tlv_component_ptr *cptr; + const struct mlxfw_mfa2_tlv_multi *dev_multi; + const struct mlxfw_mfa2_tlv *cptr_tlv; + u16 comp_idx; + + dev_multi = mlxfw_mfa2_tlv_dev_get(mfa2_file, psid, psid_size); + if (!dev_multi) + return NULL; + + cptr_tlv = mlxfw_mfa2_tlv_multi_child_find(mfa2_file, dev_multi, + MLXFW_MFA2_TLV_COMPONENT_PTR, + component_index); + if (!cptr_tlv) + return NULL; + + cptr = mlxfw_mfa2_tlv_component_ptr_get(mfa2_file, cptr_tlv); + if (!cptr) + return NULL; + + comp_idx = be16_to_cpu(cptr->component_index); + return mlxfw_mfa2_file_component_tlv_get(mfa2_file, comp_idx); +} + +struct mlxfw_mfa2_component * +mlxfw_mfa2_file_component_get(const struct mlxfw_mfa2_file *mfa2_file, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 8 10:49:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E09C15A5AF3; Wed, 8 May 2019 10:49:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA7766A6D6; Wed, 8 May 2019 10:49:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EDAC4C07; Wed, 8 May 2019 10:49:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AnbOS051732; Wed, 8 May 2019 10:49:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AnaZi051730; Wed, 8 May 2019 10:49:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081049.x48AnaZi051730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347286 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA7766A6D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:49:38 -0000 Author: hselasky Date: Wed May 8 10:49:36 2019 New Revision: 347286 URL: https://svnweb.freebsd.org/changeset/base/347286 Log: Add mlxfw callbacks in mlx5core. Add mlx5 implementation for the ones defined by the mlxfw shared module to be used while flashing the device firmware. The callbacks do their job through the MCQI, MCC and MCDA registers. Linux commit: 62bd22cf326dc4ac5be673c11cef4602dc1f5e47 Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_fw.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 10:49:05 2019 (r347285) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 10:49:36 2019 (r347286) @@ -32,6 +32,8 @@ #include #include +#include + #define DRIVER_NAME "mlx5_core" #ifndef DRIVER_VERSION #define DRIVER_VERSION "3.5.0" @@ -92,6 +94,8 @@ void mlx5_recover_device(struct mlx5_core_dev *dev); int mlx5_register_device(struct mlx5_core_dev *dev); void mlx5_unregister_device(struct mlx5_core_dev *dev); + +int mlx5_firmware_flash(struct mlx5_core_dev *dev, const struct firmware *fw); void mlx5e_init(void); void mlx5e_cleanup(void); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:49:05 2019 (r347285) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:49:36 2019 (r347286) @@ -455,3 +455,156 @@ static int mlx5_reg_mcqi_query(struct mlx5_core_dev *d out: return err; } + +struct mlx5_mlxfw_dev { + struct mlxfw_dev mlxfw_dev; + struct mlx5_core_dev *mlx5_core_dev; +}; + +static int mlx5_component_query(struct mlxfw_dev *mlxfw_dev, + u16 component_index, u32 *p_max_size, + u8 *p_align_bits, u16 *p_max_write_size) +{ + struct mlx5_mlxfw_dev *mlx5_mlxfw_dev = + container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev); + struct mlx5_core_dev *dev = mlx5_mlxfw_dev->mlx5_core_dev; + + return mlx5_reg_mcqi_query(dev, component_index, p_max_size, + p_align_bits, p_max_write_size); +} + +static int mlx5_fsm_lock(struct mlxfw_dev *mlxfw_dev, u32 *fwhandle) +{ + struct mlx5_mlxfw_dev *mlx5_mlxfw_dev = + container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev); + struct mlx5_core_dev *dev = mlx5_mlxfw_dev->mlx5_core_dev; + u8 control_state, error_code; + int err; + + *fwhandle = 0; + err = mlx5_reg_mcc_query(dev, fwhandle, &error_code, &control_state); + if (err) + return err; + + if (control_state != MLXFW_FSM_STATE_IDLE) + return -EBUSY; + + return mlx5_reg_mcc_set(dev, MLX5_REG_MCC_INSTRUCTION_LOCK_UPDATE_HANDLE, + 0, *fwhandle, 0); +} + +static int mlx5_fsm_component_update(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + u16 component_index, u32 component_size) +{ + struct mlx5_mlxfw_dev *mlx5_mlxfw_dev = + container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev); + struct mlx5_core_dev *dev = mlx5_mlxfw_dev->mlx5_core_dev; + + return mlx5_reg_mcc_set(dev, MLX5_REG_MCC_INSTRUCTION_UPDATE_COMPONENT, + component_index, fwhandle, component_size); +} + +static int mlx5_fsm_block_download(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + u8 *data, u16 size, u32 offset) +{ + struct mlx5_mlxfw_dev *mlx5_mlxfw_dev = + container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev); + struct mlx5_core_dev *dev = mlx5_mlxfw_dev->mlx5_core_dev; + + return mlx5_reg_mcda_set(dev, fwhandle, offset, size, data); +} + +static int mlx5_fsm_component_verify(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + u16 component_index) +{ + struct mlx5_mlxfw_dev *mlx5_mlxfw_dev = + container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev); + struct mlx5_core_dev *dev = mlx5_mlxfw_dev->mlx5_core_dev; + + return mlx5_reg_mcc_set(dev, MLX5_REG_MCC_INSTRUCTION_VERIFY_COMPONENT, + component_index, fwhandle, 0); +} + +static int mlx5_fsm_activate(struct mlxfw_dev *mlxfw_dev, u32 fwhandle) +{ + struct mlx5_mlxfw_dev *mlx5_mlxfw_dev = + container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev); + struct mlx5_core_dev *dev = mlx5_mlxfw_dev->mlx5_core_dev; + + return mlx5_reg_mcc_set(dev, MLX5_REG_MCC_INSTRUCTION_ACTIVATE, 0, + fwhandle, 0); +} + +static int mlx5_fsm_query_state(struct mlxfw_dev *mlxfw_dev, u32 fwhandle, + enum mlxfw_fsm_state *fsm_state, + enum mlxfw_fsm_state_err *fsm_state_err) +{ + struct mlx5_mlxfw_dev *mlx5_mlxfw_dev = + container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev); + struct mlx5_core_dev *dev = mlx5_mlxfw_dev->mlx5_core_dev; + u8 control_state, error_code; + int err; + + err = mlx5_reg_mcc_query(dev, &fwhandle, &error_code, &control_state); + if (err) + return err; + + *fsm_state = control_state; + *fsm_state_err = min_t(enum mlxfw_fsm_state_err, error_code, + MLXFW_FSM_STATE_ERR_MAX); + return 0; +} + +static void mlx5_fsm_cancel(struct mlxfw_dev *mlxfw_dev, u32 fwhandle) +{ + struct mlx5_mlxfw_dev *mlx5_mlxfw_dev = + container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev); + struct mlx5_core_dev *dev = mlx5_mlxfw_dev->mlx5_core_dev; + + mlx5_reg_mcc_set(dev, MLX5_REG_MCC_INSTRUCTION_CANCEL, 0, fwhandle, 0); +} + +static void mlx5_fsm_release(struct mlxfw_dev *mlxfw_dev, u32 fwhandle) +{ + struct mlx5_mlxfw_dev *mlx5_mlxfw_dev = + container_of(mlxfw_dev, struct mlx5_mlxfw_dev, mlxfw_dev); + struct mlx5_core_dev *dev = mlx5_mlxfw_dev->mlx5_core_dev; + + mlx5_reg_mcc_set(dev, MLX5_REG_MCC_INSTRUCTION_RELEASE_UPDATE_HANDLE, 0, + fwhandle, 0); +} + +static const struct mlxfw_dev_ops mlx5_mlxfw_dev_ops = { + .component_query = mlx5_component_query, + .fsm_lock = mlx5_fsm_lock, + .fsm_component_update = mlx5_fsm_component_update, + .fsm_block_download = mlx5_fsm_block_download, + .fsm_component_verify = mlx5_fsm_component_verify, + .fsm_activate = mlx5_fsm_activate, + .fsm_query_state = mlx5_fsm_query_state, + .fsm_cancel = mlx5_fsm_cancel, + .fsm_release = mlx5_fsm_release +}; + +int mlx5_firmware_flash(struct mlx5_core_dev *dev, + const struct firmware *firmware) +{ + struct mlx5_mlxfw_dev mlx5_mlxfw_dev = { + .mlxfw_dev = { + .ops = &mlx5_mlxfw_dev_ops, + .psid = dev->board_id, + .psid_size = strlen(dev->board_id), + }, + .mlx5_core_dev = dev + }; + + if (!MLX5_CAP_GEN(dev, mcam_reg) || + !MLX5_CAP_MCAM_REG(dev, mcqi) || + !MLX5_CAP_MCAM_REG(dev, mcc) || + !MLX5_CAP_MCAM_REG(dev, mcda)) { + pr_info("%s flashing isn't supported by the running FW\n", __func__); + return -EOPNOTSUPP; + } + + return mlxfw_firmware_flash(&mlx5_mlxfw_dev.mlxfw_dev, firmware); +} Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:49:05 2019 (r347285) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:49:36 2019 (r347286) @@ -50,9 +50,8 @@ static const char mlx5_version[] = "Mellanox Core driv MODULE_AUTHOR("Eli Cohen "); MODULE_DESCRIPTION("Mellanox Connect-IB, ConnectX-4 core driver"); MODULE_LICENSE("Dual BSD/GPL"); -#if (__FreeBSD_version >= 1100000) MODULE_DEPEND(mlx5, linuxkpi, 1, 1, 1); -#endif +MODULE_DEPEND(mlx5, mlxfw, 1, 1, 1); MODULE_VERSION(mlx5, 1); SYSCTL_NODE(_hw, OID_AUTO, mlx5, CTLFLAG_RW, 0, "mlx5 hardware controls"); From owner-svn-src-all@freebsd.org Wed May 8 10:50:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E4FE15A5B83; Wed, 8 May 2019 10:50:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B52406A845; Wed, 8 May 2019 10:50:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 920904C0B; Wed, 8 May 2019 10:50:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Ao9Lp051849; Wed, 8 May 2019 10:50:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Ao8lx051846; Wed, 8 May 2019 10:50:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081050.x48Ao8lx051846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347287 - in head: share/man/man4 sys/dev/mlx5 sys/dev/mlx5/mlx5_core usr.sbin/mlx5tool X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/mlx5 sys/dev/mlx5/mlx5_core usr.sbin/mlx5tool X-SVN-Commit-Revision: 347287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B52406A845 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:50:10 -0000 Author: hselasky Date: Wed May 8 10:50:08 2019 New Revision: 347287 URL: https://svnweb.freebsd.org/changeset/base/347287 Log: Rename mlx5_fwdump_addr to more neutral mlx5_tool_addr in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/share/man/man4/mlx5io.4 head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c head/sys/dev/mlx5/mlx5io.h head/usr.sbin/mlx5tool/mlx5tool.c Modified: head/share/man/man4/mlx5io.4 ============================================================================== --- head/share/man/man4/mlx5io.4 Wed May 8 10:49:36 2019 (r347286) +++ head/share/man/man4/mlx5io.4 Wed May 8 10:50:08 2019 (r347287) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 20, 2018 +.Dd May 7, 2019 .Dt mlx5io 4 .Os .Sh NAME @@ -55,10 +55,10 @@ far, or existing dump cleared with the .Dv MLX5_FWDUMP_RESET command for the specified device. The argument for the command should point to the -.Vt struct mlx5_fwdump_addr +.Vt struct mlx5_tool_addr structure, containing the PCIe bus address of the device. .Bd -literal -struct mlx5_fwdump_addr { +struct mlx5_tool_addr { uint32_t domain; uint8_t bus; uint8_t slot; @@ -69,7 +69,7 @@ struct mlx5_fwdump_addr { Clear the stored firmware dump, preparing the kernel buffer for the next dump. The argument for the command should point to the -.Vt struct mlx5_fwdump_addr +.Vt struct mlx5_tool_addr structure, containing the PCIe bus address of the device. .It Dv MLX5_FWDUMP_GET Fetch the stored firmware dump into the user memory. @@ -88,7 +88,7 @@ in the field. .Bd -literal struct mlx5_fwdump_get { - struct mlx5_fwdump_addr devaddr; + struct mlx5_tool_addr devaddr; struct mlx5_fwdump_reg *buf; size_t reg_cnt; size_t reg_filled; /* out */ Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed May 8 10:49:36 2019 (r347286) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed May 8 10:50:08 2019 (r347287) @@ -170,7 +170,7 @@ mlx5_fwdump_clean(struct mlx5_core_dev *mdev) } static int -mlx5_dbsf_to_core(const struct mlx5_fwdump_addr *devaddr, +mlx5_dbsf_to_core(const struct mlx5_tool_addr *devaddr, struct mlx5_core_dev **mdev) { device_t dev; @@ -231,7 +231,7 @@ mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_ { struct mlx5_core_dev *mdev; struct mlx5_fwdump_get *fwg; - struct mlx5_fwdump_addr *devaddr; + struct mlx5_tool_addr *devaddr; struct mlx5_dump_data *dd; int error; @@ -254,7 +254,7 @@ mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_ error = EBADF; break; } - devaddr = (struct mlx5_fwdump_addr *)data; + devaddr = (struct mlx5_tool_addr *)data; error = mlx5_dbsf_to_core(devaddr, &mdev); if (error != 0) break; @@ -269,7 +269,7 @@ mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_ error = EBADF; break; } - devaddr = (struct mlx5_fwdump_addr *)data; + devaddr = (struct mlx5_tool_addr *)data; error = mlx5_dbsf_to_core(devaddr, &mdev); if (error != 0) break; Modified: head/sys/dev/mlx5/mlx5io.h ============================================================================== --- head/sys/dev/mlx5/mlx5io.h Wed May 8 10:49:36 2019 (r347286) +++ head/sys/dev/mlx5/mlx5io.h Wed May 8 10:50:08 2019 (r347287) @@ -35,7 +35,7 @@ struct mlx5_fwdump_reg { uint32_t val; }; -struct mlx5_fwdump_addr { +struct mlx5_tool_addr { uint32_t domain; uint8_t bus; uint8_t slot; @@ -43,15 +43,15 @@ struct mlx5_fwdump_addr { }; struct mlx5_fwdump_get { - struct mlx5_fwdump_addr devaddr; + struct mlx5_tool_addr devaddr; struct mlx5_fwdump_reg *buf; size_t reg_cnt; size_t reg_filled; /* out */ }; #define MLX5_FWDUMP_GET _IOWR('m', 1, struct mlx5_fwdump_get) -#define MLX5_FWDUMP_RESET _IOW('m', 2, struct mlx5_fwdump_addr) -#define MLX5_FWDUMP_FORCE _IOW('m', 3, struct mlx5_fwdump_addr) +#define MLX5_FWDUMP_RESET _IOW('m', 2, struct mlx5_tool_addr) +#define MLX5_FWDUMP_FORCE _IOW('m', 3, struct mlx5_tool_addr) #ifndef _KERNEL #define MLX5_DEV_PATH _PATH_DEV"mlx5ctl" Modified: head/usr.sbin/mlx5tool/mlx5tool.c ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.c Wed May 8 10:49:36 2019 (r347286) +++ head/usr.sbin/mlx5tool/mlx5tool.c Wed May 8 10:50:08 2019 (r347287) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); /* stolen from pciconf.c: parsesel() */ static int -parse_pci_addr(const char *addrstr, struct mlx5_fwdump_addr *addr) +parse_pci_addr(const char *addrstr, struct mlx5_tool_addr *addr) { char *eppos; unsigned long selarr[4]; @@ -73,7 +73,7 @@ parse_pci_addr(const char *addrstr, struct mlx5_fwdump } static int -mlx5tool_save_dump(int ctldev, const struct mlx5_fwdump_addr *addr, +mlx5tool_save_dump(int ctldev, const struct mlx5_tool_addr *addr, const char *dumpname) { struct mlx5_fwdump_get fdg; @@ -123,7 +123,7 @@ out: } static int -mlx5tool_dump_reset(int ctldev, const struct mlx5_fwdump_addr *addr) +mlx5tool_dump_reset(int ctldev, const struct mlx5_tool_addr *addr) { if (ioctl(ctldev, MLX5_FWDUMP_RESET, addr) == -1) { @@ -134,7 +134,7 @@ mlx5tool_dump_reset(int ctldev, const struct mlx5_fwdu } static int -mlx5tool_dump_force(int ctldev, const struct mlx5_fwdump_addr *addr) +mlx5tool_dump_force(int ctldev, const struct mlx5_tool_addr *addr) { if (ioctl(ctldev, MLX5_FWDUMP_FORCE, addr) == -1) { @@ -166,7 +166,7 @@ enum mlx5_action { int main(int argc, char *argv[]) { - struct mlx5_fwdump_addr addr; + struct mlx5_tool_addr addr; char *dumpname; char *addrstr; int c, ctldev, res; From owner-svn-src-all@freebsd.org Wed May 8 10:50:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B7EC15A5BF8; Wed, 8 May 2019 10:50:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FC606A9AD; Wed, 8 May 2019 10:50:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE7D74C0F; Wed, 8 May 2019 10:50:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Aoal4051916; Wed, 8 May 2019 10:50:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AoaZK051913; Wed, 8 May 2019 10:50:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081050.x48AoaZK051913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347288 - in head: sys/dev/mlx5 sys/dev/mlx5/mlx5_core usr.sbin/mlx5tool X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: sys/dev/mlx5 sys/dev/mlx5/mlx5_core usr.sbin/mlx5tool X-SVN-Commit-Revision: 347288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0FC606A9AD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:50:37 -0000 Author: hselasky Date: Wed May 8 10:50:35 2019 New Revision: 347288 URL: https://svnweb.freebsd.org/changeset/base/347288 Log: Implement userspace firmware update for ConnectX-4/5/6. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c head/sys/dev/mlx5/mlx5io.h head/usr.sbin/mlx5tool/mlx5tool.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed May 8 10:50:08 2019 (r347287) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed May 8 10:50:35 2019 (r347288) @@ -233,6 +233,8 @@ mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_ struct mlx5_fwdump_get *fwg; struct mlx5_tool_addr *devaddr; struct mlx5_dump_data *dd; + struct mlx5_fw_update *fu; + struct firmware fake_fw; int error; error = 0; @@ -274,6 +276,36 @@ mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_ if (error != 0) break; mlx5_fwdump(mdev); + break; + case MLX5_FW_UPDATE: + if ((fflag & FWRITE) == 0) { + error = EBADF; + break; + } + fu = (struct mlx5_fw_update *)data; + if (fu->img_fw_data_len > 10 * 1024 * 1024) { + error = EINVAL; + break; + } + devaddr = &fu->devaddr; + error = mlx5_dbsf_to_core(devaddr, &mdev); + if (error != 0) + break; + bzero(&fake_fw, sizeof(fake_fw)); + fake_fw.name = "umlx_fw_up"; + fake_fw.datasize = fu->img_fw_data_len; + fake_fw.version = 1; + fake_fw.data = (void *)kmem_malloc(fu->img_fw_data_len, + M_WAITOK); + if (fake_fw.data == NULL) { + error = ENOMEM; + break; + } + error = copyin(fu->img_fw_data, __DECONST(void *, fake_fw.data), + fu->img_fw_data_len); + if (error == 0) + error = -mlx5_firmware_flash(mdev, &fake_fw); + kmem_free((vm_offset_t)fake_fw.data, fu->img_fw_data_len); break; default: error = ENOTTY; Modified: head/sys/dev/mlx5/mlx5io.h ============================================================================== --- head/sys/dev/mlx5/mlx5io.h Wed May 8 10:50:08 2019 (r347287) +++ head/sys/dev/mlx5/mlx5io.h Wed May 8 10:50:35 2019 (r347288) @@ -49,9 +49,16 @@ struct mlx5_fwdump_get { size_t reg_filled; /* out */ }; +struct mlx5_fw_update { + struct mlx5_tool_addr devaddr; + void *img_fw_data; + size_t img_fw_data_len; +}; + #define MLX5_FWDUMP_GET _IOWR('m', 1, struct mlx5_fwdump_get) #define MLX5_FWDUMP_RESET _IOW('m', 2, struct mlx5_tool_addr) #define MLX5_FWDUMP_FORCE _IOW('m', 3, struct mlx5_tool_addr) +#define MLX5_FW_UPDATE _IOW('m', 4, struct mlx5_fw_update) #ifndef _KERNEL #define MLX5_DEV_PATH _PATH_DEV"mlx5ctl" Modified: head/usr.sbin/mlx5tool/mlx5tool.c ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.c Wed May 8 10:50:08 2019 (r347287) +++ head/usr.sbin/mlx5tool/mlx5tool.c Wed May 8 10:50:35 2019 (r347288) @@ -28,6 +28,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -144,15 +146,60 @@ mlx5tool_dump_force(int ctldev, const struct mlx5_tool return (0); } +static int +mlx5tool_fw_update(int ctldev, const struct mlx5_tool_addr *addr, + const char *img_fw_path) +{ + struct stat st; + struct mlx5_fw_update fwup; + int error, fd, res; + + res = 0; + fd = open(img_fw_path, O_RDONLY); + if (fd == -1) { + warn("Unable to open %s", img_fw_path); + res = 1; + goto close_fd; + } + error = fstat(fd, &st); + if (error != 0) { + warn("Unable to stat %s", img_fw_path); + res = 1; + goto close_fd; + } + memset(&fwup, 0, sizeof(fwup)); + memcpy(&fwup.devaddr, addr, sizeof(fwup.devaddr)); + fwup.img_fw_data = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, + fd, 0); + if (fwup.img_fw_data == MAP_FAILED) { + warn("Unable to mmap %s", img_fw_path); + res = 1; + goto close_fd; + } + fwup.img_fw_data_len = st.st_size; + + error = ioctl(ctldev, MLX5_FW_UPDATE, &fwup); + if (error == -1) { + warn("MLX5_FW_UPDATE"); + } + + munmap(fwup.img_fw_data, st.st_size); +close_fd: + close(fd); + return (res); +} + static void usage(void) { fprintf(stderr, - "Usage: mlx5tool -d pci [-w -o dump.file | -r | -e]\n"); + "Usage: mlx5tool -d pci [-w -o dump.file | -r |" + " -e | -f fw.mfa2]\n"); fprintf(stderr, "\t-w - write firmware dump to the specified file\n"); fprintf(stderr, "\t-r - reset dump\n"); fprintf(stderr, "\t-e - force dump\n"); + fprintf(stderr, "\t-f fw.img - flash firmware from fw.img\n"); exit(1); } @@ -160,6 +207,7 @@ enum mlx5_action { ACTION_DUMP_GET, ACTION_DUMP_RESET, ACTION_DUMP_FORCE, + ACTION_FW_UPDATE, ACTION_NONE, }; @@ -169,13 +217,15 @@ main(int argc, char *argv[]) struct mlx5_tool_addr addr; char *dumpname; char *addrstr; + char *img_fw_path; int c, ctldev, res; enum mlx5_action act; act = ACTION_NONE; addrstr = NULL; dumpname = NULL; - while ((c = getopt(argc, argv, "d:eho:rw")) != -1) { + img_fw_path = NULL; + while ((c = getopt(argc, argv, "d:ef:ho:rw")) != -1) { switch (c) { case 'd': addrstr = optarg; @@ -192,12 +242,18 @@ main(int argc, char *argv[]) case 'r': act = ACTION_DUMP_RESET; break; + case 'f': + act = ACTION_FW_UPDATE; + img_fw_path = optarg; + break; case 'h': default: usage(); } } - if (act == ACTION_NONE || (dumpname != NULL && act != ACTION_DUMP_GET)) + if (act == ACTION_NONE || (dumpname != NULL && + act != ACTION_DUMP_GET) || (img_fw_path != NULL && + act != ACTION_FW_UPDATE)) usage(); if (parse_pci_addr(addrstr, &addr) != 0) exit(1); @@ -214,6 +270,9 @@ main(int argc, char *argv[]) break; case ACTION_DUMP_FORCE: res = mlx5tool_dump_force(ctldev, &addr); + break; + case ACTION_FW_UPDATE: + res = mlx5tool_fw_update(ctldev, &addr, img_fw_path); break; default: res = 0; From owner-svn-src-all@freebsd.org Wed May 8 10:51:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7652015A5C7C; Wed, 8 May 2019 10:51:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AAF66AB18; Wed, 8 May 2019 10:51:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E81C14C2F; Wed, 8 May 2019 10:51:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Ap78N054965; Wed, 8 May 2019 10:51:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Ap7SX054964; Wed, 8 May 2019 10:51:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081051.x48Ap7SX054964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347289 - in head: share/man/man4 usr.sbin/mlx5tool X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: share/man/man4 usr.sbin/mlx5tool X-SVN-Commit-Revision: 347289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AAF66AB18 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:51:08 -0000 Author: hselasky Date: Wed May 8 10:51:07 2019 New Revision: 347289 URL: https://svnweb.freebsd.org/changeset/base/347289 Log: Document userspace firmware flash in mlx5tool(8) and mlx5io(4). Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/share/man/man4/mlx5io.4 head/usr.sbin/mlx5tool/mlx5tool.8 Modified: head/share/man/man4/mlx5io.4 ============================================================================== --- head/share/man/man4/mlx5io.4 Wed May 8 10:50:35 2019 (r347288) +++ head/share/man/man4/mlx5io.4 Wed May 8 10:51:07 2019 (r347289) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2018 Mellanox Technologies +.\" Copyright (c) 2018, 2019 Mellanox Technologies .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -121,6 +121,27 @@ struct mlx5_fwdump_reg { uint32_t val; }; .Ed +.It Dv MLX5_FW_UPDATE +Requests firmware update (flash) on the adapter specified by the +.Dv devaddr +using the firmware image in +.Dv MFA2 +format. +The argument for the ioctl command is the +.Vt struct mlx5_fw_update +with the following definition. +.Bd -literal +struct mlx5_fw_update { + struct mlx5_tool_addr devaddr; + void *img_fw_data; + size_t img_fw_data_len; +}; +.Ed +Image address in memory is passed in +.Dv img_fw_data , +the length of the image is specified in +.Dv img_fw_data_len +field. .El .Sh FILES The Modified: head/usr.sbin/mlx5tool/mlx5tool.8 ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.8 Wed May 8 10:50:35 2019 (r347288) +++ head/usr.sbin/mlx5tool/mlx5tool.8 Wed May 8 10:51:07 2019 (r347289) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2018 Mellanox Technologies +.\" Copyright (c) 2018, 2019 Mellanox Technologies .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -37,11 +37,14 @@ .Fl e .Nm .Fl d Ar domain:bus:slot:func -.Fl r +.Fl rn .Nm .Fl d Ar domain:bus:slot:func .Fl o Ar file .Fl w +.Nm +.Fl d Ar domain:bus:slot:func +.Fl f Ar file.mfa2 .Sh DESCRIPTION The .Nm @@ -82,6 +85,12 @@ Fetches the stored firmware dump and writes it into th by the .Fl o option argument. +.It Fl f +Flashes the firmware image +.Fa file.mfa2 +to the specified adapter. +Image must be in MFA2 pack format and contain a component suitable +for the adapter hardware. .El .Sh FILES The From owner-svn-src-all@freebsd.org Wed May 8 10:51:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7581415A5CBD; Wed, 8 May 2019 10:51:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C2166AC9C; Wed, 8 May 2019 10:51:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B05E4C49; Wed, 8 May 2019 10:51:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48ApTlv055757; Wed, 8 May 2019 10:51:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48ApToV055756; Wed, 8 May 2019 10:51:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081051.x48ApToV055756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347290 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C2166AC9C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:51:30 -0000 Author: hselasky Date: Wed May 8 10:51:29 2019 New Revision: 347290 URL: https://svnweb.freebsd.org/changeset/base/347290 Log: Fix for double bus master disable in mlx5core. mlx5_pci_disable_device is calling pci_disable_device which disables bus master. No need to explicitly call pci_clear_master. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:51:07 2019 (r347289) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:51:29 2019 (r347290) @@ -866,7 +866,6 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, st return 0; err_clr_master: - pci_clear_master(dev->pdev); release_bar(dev->pdev); err_disable: mlx5_pci_disable_device(dev); @@ -877,7 +876,6 @@ err_dbg: static void mlx5_pci_close(struct mlx5_core_dev *dev, struct mlx5_priv *priv) { iounmap(dev->iseg); - pci_clear_master(dev->pdev); release_bar(dev->pdev); mlx5_pci_disable_device(dev); } From owner-svn-src-all@freebsd.org Wed May 8 10:51:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A25F15A5E70; Wed, 8 May 2019 10:51:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 416CA6AE12; Wed, 8 May 2019 10:51:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C3524C65; Wed, 8 May 2019 10:51:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Apnti055820; Wed, 8 May 2019 10:51:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48ApnPI055819; Wed, 8 May 2019 10:51:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081051.x48ApnPI055819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347291 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 347291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 416CA6AE12 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:51:50 -0000 Author: hselasky Date: Wed May 8 10:51:49 2019 New Revision: 347291 URL: https://svnweb.freebsd.org/changeset/base/347291 Log: Handle IB_EVENT_DEVICE_FATAL event in ipoib. Perform flush if IB_EVENT_DEVICE_FATAL was received. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c Wed May 8 10:51:29 2019 (r347290) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c Wed May 8 10:51:49 2019 (r347291) @@ -282,7 +282,8 @@ void ipoib_event(struct ib_event_handler *handler, queue_work(ipoib_workqueue, &priv->flush_light); } else if (record->event == IB_EVENT_PORT_ERR || record->event == IB_EVENT_PORT_ACTIVE || - record->event == IB_EVENT_LID_CHANGE) { + record->event == IB_EVENT_LID_CHANGE || + record->event == IB_EVENT_DEVICE_FATAL) { queue_work(ipoib_workqueue, &priv->flush_normal); } else if (record->event == IB_EVENT_PKEY_CHANGE) { queue_work(ipoib_workqueue, &priv->flush_heavy); From owner-svn-src-all@freebsd.org Wed May 8 10:52:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 098A615A5EDB; Wed, 8 May 2019 10:52:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2F5E6B0AF; Wed, 8 May 2019 10:52:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F61A4C82; Wed, 8 May 2019 10:52:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AqB8V055888; Wed, 8 May 2019 10:52:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AqB3f055887; Wed, 8 May 2019 10:52:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081052.x48AqB3f055887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347292 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2F5E6B0AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:52:12 -0000 Author: hselasky Date: Wed May 8 10:52:11 2019 New Revision: 347292 URL: https://svnweb.freebsd.org/changeset/base/347292 Log: Add mlx5_firmware_update() in mlx5core. Add support for upgrading firmware on mlx5 module load. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:51:49 2019 (r347291) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:52:11 2019 (r347292) @@ -52,6 +52,7 @@ MODULE_DESCRIPTION("Mellanox Connect-IB, ConnectX-4 co MODULE_LICENSE("Dual BSD/GPL"); MODULE_DEPEND(mlx5, linuxkpi, 1, 1, 1); MODULE_DEPEND(mlx5, mlxfw, 1, 1, 1); +MODULE_DEPEND(mlx5, firmware, 1, 1, 1); MODULE_VERSION(mlx5, 1); SYSCTL_NODE(_hw, OID_AUTO, mlx5, CTLFLAG_RW, 0, "mlx5 hardware controls"); @@ -820,6 +821,23 @@ void *mlx5_get_protocol_dev(struct mlx5_core_dev *mdev } EXPORT_SYMBOL(mlx5_get_protocol_dev); +static int +mlx5_firmware_update(struct mlx5_core_dev *dev) +{ + const struct firmware *fw; + int err; + + fw = firmware_get("mlx5fw_mfa"); + if (fw) { + err = mlx5_firmware_flash(dev, fw); + firmware_put(fw, FIRMWARE_UNLOAD); + } + else + return (-ENOENT); + + return err; +} + static int mlx5_pci_init(struct mlx5_core_dev *dev, struct mlx5_priv *priv) { struct pci_dev *pdev = dev->pdev; @@ -1274,6 +1292,8 @@ static int init_one(struct pci_dev *pdev, } mlx5_fwdump_prep(dev); + + mlx5_firmware_update(dev); pci_save_state(bsddev); return 0; From owner-svn-src-all@freebsd.org Wed May 8 10:52:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC66915A5F56; Wed, 8 May 2019 10:52:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89F9E6B267; Wed, 8 May 2019 10:52:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FD404DAA; Wed, 8 May 2019 10:52:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AqXYq056875; Wed, 8 May 2019 10:52:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AqW0I056874; Wed, 8 May 2019 10:52:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081052.x48AqW0I056874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347293 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89F9E6B267 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:52:34 -0000 Author: hselasky Date: Wed May 8 10:52:32 2019 New Revision: 347293 URL: https://svnweb.freebsd.org/changeset/base/347293 Log: Use software counters for rx_packets and rx_bytes in mlx5en(4). The physical- and virtual- port counters might not reflect the amount of data received after address filtering. Use the software counters instead for rx_packets and rx_bytes to know exactly how much data was received. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:52:11 2019 (r347292) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:52:32 2019 (r347293) @@ -499,6 +499,8 @@ mlx5e_update_stats_locked(struct mlx5e_priv *priv) u64 sw_lro_flushed = 0; u64 rx_csum_none = 0; u64 rx_wqe_err = 0; + u64 rx_packets = 0; + u64 rx_bytes = 0; u32 rx_out_of_buffer = 0; int i; int j; @@ -522,6 +524,8 @@ mlx5e_update_stats_locked(struct mlx5e_priv *priv) lro_bytes += rq_stats->lro_bytes; rx_csum_none += rq_stats->csum_none; rx_wqe_err += rq_stats->wqe_err; + rx_packets += rq_stats->packets; + rx_bytes += rq_stats->bytes; for (j = 0; j < priv->num_tc; j++) { sq_stats = &pch->sq[j].stats; @@ -548,6 +552,8 @@ mlx5e_update_stats_locked(struct mlx5e_priv *priv) s->sw_lro_flushed = sw_lro_flushed; s->rx_csum_none = rx_csum_none; s->rx_wqe_err = rx_wqe_err; + s->rx_packets = rx_packets; + s->rx_bytes = rx_bytes; /* HW counters */ memset(in, 0, sizeof(in)); @@ -610,11 +616,6 @@ mlx5e_update_stats_locked(struct mlx5e_priv *priv) s->tx_broadcast_bytes = MLX5_GET_CTR(out, transmitted_eth_broadcast.octets); - s->rx_packets = s->rx_unicast_packets + - s->rx_multicast_packets + s->rx_broadcast_packets - - s->rx_out_of_buffer; - s->rx_bytes = s->rx_unicast_bytes + s->rx_multicast_bytes + - s->rx_broadcast_bytes; s->tx_packets = s->tx_unicast_packets + s->tx_multicast_packets + s->tx_broadcast_packets; s->tx_bytes = s->tx_unicast_bytes + s->tx_multicast_bytes + From owner-svn-src-all@freebsd.org Wed May 8 10:53:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AB5315A5FF6; Wed, 8 May 2019 10:53:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7F1A6B3D6; Wed, 8 May 2019 10:53:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CA974DAC; Wed, 8 May 2019 10:53:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Ar2u2056952; Wed, 8 May 2019 10:53:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Ar26d056948; Wed, 8 May 2019 10:53:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081053.x48Ar26d056948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347294 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 347294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7F1A6B3D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:53:04 -0000 Author: hselasky Date: Wed May 8 10:53:01 2019 New Revision: 347294 URL: https://svnweb.freebsd.org/changeset/base/347294 Log: Add vnic steering drop statistics in mlx5en(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed May 8 10:52:32 2019 (r347293) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed May 8 10:53:01 2019 (r347294) @@ -412,6 +412,7 @@ static int mlx5_internal_err_ret_value(struct mlx5_cor case MLX5_CMD_OP_MODIFY_HCA_VPORT_CONTEXT: case MLX5_CMD_OP_QUERY_HCA_VPORT_GID: case MLX5_CMD_OP_QUERY_HCA_VPORT_PKEY: + case MLX5_CMD_OP_QUERY_VNIC_ENV: case MLX5_CMD_OP_QUERY_VPORT_COUNTER: case MLX5_CMD_OP_ALLOC_Q_COUNTER: case MLX5_CMD_OP_QUERY_Q_COUNTER: @@ -537,6 +538,7 @@ const char *mlx5_command_str(int command) MLX5_COMMAND_STR_CASE(MODIFY_HCA_VPORT_CONTEXT); MLX5_COMMAND_STR_CASE(QUERY_HCA_VPORT_GID); MLX5_COMMAND_STR_CASE(QUERY_HCA_VPORT_PKEY); + MLX5_COMMAND_STR_CASE(QUERY_VNIC_ENV); MLX5_COMMAND_STR_CASE(QUERY_VPORT_COUNTER); MLX5_COMMAND_STR_CASE(SET_WOL_ROL); MLX5_COMMAND_STR_CASE(QUERY_WOL_ROL); Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:52:32 2019 (r347293) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:53:01 2019 (r347294) @@ -187,7 +187,8 @@ typedef void (mlx5e_cq_comp_t)(struct mlx5_core_cq *); m(+1, u64 tx_queue_dropped, "tx_queue_dropped", "Transmit queue dropped") \ m(+1, u64 tx_defragged, "tx_defragged", "Transmit queue defragged") \ m(+1, u64 rx_wqe_err, "rx_wqe_err", "Receive WQE errors") \ - m(+1, u64 tx_jumbo_packets, "tx_jumbo_packets", "TX packets greater than 1518 octets") + m(+1, u64 tx_jumbo_packets, "tx_jumbo_packets", "TX packets greater than 1518 octets") \ + m(+1, u64 rx_steer_missed_packets, "rx_steer_missed_packets", "RX packets dropped by steering rule(s)") #define MLX5E_VPORT_STATS_NUM (0 MLX5E_VPORT_STATS(MLX5E_STATS_COUNT)) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:52:32 2019 (r347293) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:53:01 2019 (r347294) @@ -468,6 +468,28 @@ free_out: kvfree(out); } +static void +mlx5e_grp_vnic_env_update_stats(struct mlx5e_priv *priv) +{ + u32 out[MLX5_ST_SZ_DW(query_vnic_env_out)] = {}; + u32 in[MLX5_ST_SZ_DW(query_vnic_env_in)] = {}; + + if (!MLX5_CAP_GEN(priv->mdev, nic_receive_steering_discard)) + return; + + MLX5_SET(query_vnic_env_in, in, opcode, + MLX5_CMD_OP_QUERY_VNIC_ENV); + MLX5_SET(query_vnic_env_in, in, op_mod, 0); + MLX5_SET(query_vnic_env_in, in, other_vport, 0); + + if (mlx5_cmd_exec(priv->mdev, in, sizeof(in), out, sizeof(out)) != 0) + return; + + priv->stats.vport.rx_steer_missed_packets = + MLX5_GET64(query_vnic_env_out, out, + vport_env.nic_receive_steering_discard); +} + /* * This function is called regularly to collect all statistics * counters from the firmware. The values can be viewed through the @@ -554,6 +576,8 @@ mlx5e_update_stats_locked(struct mlx5e_priv *priv) s->rx_wqe_err = rx_wqe_err; s->rx_packets = rx_packets; s->rx_bytes = rx_bytes; + + mlx5e_grp_vnic_env_update_stats(priv); /* HW counters */ memset(in, 0, sizeof(in)); Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:52:32 2019 (r347293) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:53:01 2019 (r347294) @@ -151,6 +151,7 @@ enum { MLX5_CMD_OP_MODIFY_HCA_VPORT_CONTEXT = 0x763, MLX5_CMD_OP_QUERY_HCA_VPORT_GID = 0x764, MLX5_CMD_OP_QUERY_HCA_VPORT_PKEY = 0x765, + MLX5_CMD_OP_QUERY_VNIC_ENV = 0x76f, MLX5_CMD_OP_QUERY_VPORT_COUNTER = 0x770, MLX5_CMD_OP_ALLOC_Q_COUNTER = 0x771, MLX5_CMD_OP_DEALLOC_Q_COUNTER = 0x772, @@ -1222,7 +1223,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 reserved_44[0xb]; u8 log_max_xrcd[0x5]; - u8 reserved_45[0x10]; + u8 nic_receive_steering_discard[0x1]; + u8 reserved_45[0x7]; + u8 log_max_flow_counter_bulk[0x8]; u8 max_flow_counter[0x10]; u8 reserved_46[0x3]; @@ -2190,6 +2193,24 @@ struct mlx5_ifc_xrc_srqc_bits { u8 reserved_9[0x80]; }; +struct mlx5_ifc_vnic_diagnostic_statistics_bits { + u8 counter_error_queues[0x20]; + + u8 total_error_queues[0x20]; + + u8 send_queue_priority_update_flow[0x20]; + + u8 reserved_at_60[0x20]; + + u8 nic_receive_steering_discard[0x40]; + + u8 receive_discard_vport_down[0x40]; + + u8 transmit_discard_vport_down[0x40]; + + u8 reserved_at_140[0xec0]; +}; + struct mlx5_ifc_traffic_counter_bits { u8 packets[0x40]; @@ -3964,6 +3985,35 @@ struct mlx5_ifc_query_vport_state_in_bits { u8 vport_number[0x10]; u8 reserved_3[0x20]; +}; + +struct mlx5_ifc_query_vnic_env_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; + + struct mlx5_ifc_vnic_diagnostic_statistics_bits vport_env; +}; + +enum { + MLX5_QUERY_VNIC_ENV_IN_OP_MOD_VPORT_DIAG_STATISTICS = 0x0, +}; + +struct mlx5_ifc_query_vnic_env_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 other_vport[0x1]; + u8 reserved_at_41[0xf]; + u8 vport_number[0x10]; + + u8 reserved_at_60[0x20]; }; struct mlx5_ifc_query_vport_counter_out_bits { From owner-svn-src-all@freebsd.org Wed May 8 10:53:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6BDE15A606A; Wed, 8 May 2019 10:53:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DA756B522; Wed, 8 May 2019 10:53:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 698564DAD; Wed, 8 May 2019 10:53:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48ArQsP057022; Wed, 8 May 2019 10:53:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48ArPtE057020; Wed, 8 May 2019 10:53:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081053.x48ArPtE057020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347295 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DA756B522 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:53:27 -0000 Author: hselasky Date: Wed May 8 10:53:25 2019 New Revision: 347295 URL: https://svnweb.freebsd.org/changeset/base/347295 Log: Let rx_out_of_buffer be a 32-bit counter in mlx5en(4). This fixes counting issues when the firmware resets the counter during allocation of the counter set where the counter belongs. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:53:01 2019 (r347294) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:53:25 2019 (r347295) @@ -196,7 +196,6 @@ struct mlx5e_vport_stats { struct sysctl_ctx_list ctx; u64 arg [0]; MLX5E_VPORT_STATS(MLX5E_STATS_VAR) - u32 rx_out_of_buffer_prev; }; #define MLX5E_PPORT_IEEE802_3_STATS(m) \ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:53:01 2019 (r347294) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:53:25 2019 (r347295) @@ -593,10 +593,7 @@ mlx5e_update_stats_locked(struct mlx5e_priv *priv) if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0 && mlx5_vport_query_out_of_rx_buffer(mdev, priv->counter_set_id, &rx_out_of_buffer) == 0) { - /* accumulate difference into a 64-bit counter */ - s->rx_out_of_buffer += (u64)(u32)(rx_out_of_buffer - - s->rx_out_of_buffer_prev); - s->rx_out_of_buffer_prev = rx_out_of_buffer; + s->rx_out_of_buffer = rx_out_of_buffer; } /* get port statistics */ From owner-svn-src-all@freebsd.org Wed May 8 10:53:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08DB615A60C2; Wed, 8 May 2019 10:53:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0FF36B674; Wed, 8 May 2019 10:53:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B1E44DAE; Wed, 8 May 2019 10:53:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48ArmTl057086; Wed, 8 May 2019 10:53:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Armpg057084; Wed, 8 May 2019 10:53:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081053.x48Armpg057084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347296 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0FF36B674 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:53:49 -0000 Author: hselasky Date: Wed May 8 10:53:47 2019 New Revision: 347296 URL: https://svnweb.freebsd.org/changeset/base/347296 Log: Correct check for the calibration generation in mlx5en(4). If generation is cleared due to hardware clock failure, check for it before the divisor is used. Actually clear generation when failure occurs. While there, stop doing the calculations inside the generation loop. Since all members of mlx5e_clbr_point are used for calculations, get the local copy of the structure and use it after generation stabilized. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:53:25 2019 (r347295) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:53:47 2019 (r347296) @@ -833,11 +833,15 @@ mlx5e_calibration_callout(void *arg) next->clbr_hw_prev = curr->clbr_hw_curr; next->clbr_hw_curr = mlx5e_hw_clock(priv); - if (((next->clbr_hw_curr - curr->clbr_hw_prev) >> MLX5E_TSTMP_PREC) == + if (((next->clbr_hw_curr - curr->clbr_hw_curr) >> MLX5E_TSTMP_PREC) == 0) { - if_printf(priv->ifp, "HW failed tstmp frozen %#jx %#jx," - "disabling\n", next->clbr_hw_curr, curr->clbr_hw_prev); - priv->clbr_done = 0; + if (priv->clbr_done != 0) { + if_printf(priv->ifp, "HW failed tstmp frozen %#jx %#jx," + "disabling\n", + next->clbr_hw_curr, curr->clbr_hw_prev); + priv->clbr_done = 0; + } + atomic_store_rel_int(&curr->clbr_gen, 0); return; } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed May 8 10:53:25 2019 (r347295) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed May 8 10:53:47 2019 (r347296) @@ -222,28 +222,31 @@ mlx5e_lro_update_hdr(struct mbuf *mb, struct mlx5_cqe6 static uint64_t mlx5e_mbuf_tstmp(struct mlx5e_priv *priv, uint64_t hw_tstmp) { - struct mlx5e_clbr_point *cp; + struct mlx5e_clbr_point *cp, dcp; uint64_t a1, a2, res; u_int gen; do { cp = &priv->clbr_points[priv->clbr_curr]; gen = atomic_load_acq_int(&cp->clbr_gen); - a1 = (hw_tstmp - cp->clbr_hw_prev) >> MLX5E_TSTMP_PREC; - a2 = (cp->base_curr - cp->base_prev) >> MLX5E_TSTMP_PREC; - res = (a1 * a2) << MLX5E_TSTMP_PREC; + if (gen == 0) + return (0); + dcp = *cp; + atomic_thread_fence_acq(); + } while (gen != cp->clbr_gen); - /* - * Divisor cannot be zero because calibration callback - * checks for the condition and disables timestamping - * if clock halted. - */ - res /= (cp->clbr_hw_curr - cp->clbr_hw_prev) >> - MLX5E_TSTMP_PREC; + a1 = (hw_tstmp - dcp.clbr_hw_prev) >> MLX5E_TSTMP_PREC; + a2 = (dcp.base_curr - dcp.base_prev) >> MLX5E_TSTMP_PREC; + res = (a1 * a2) << MLX5E_TSTMP_PREC; - res += cp->base_prev; - atomic_thread_fence_acq(); - } while (gen == 0 || gen != cp->clbr_gen); + /* + * Divisor cannot be zero because calibration callback + * checks for the condition and disables timestamping + * if clock halted. + */ + res /= (dcp.clbr_hw_curr - dcp.clbr_hw_prev) >> MLX5E_TSTMP_PREC; + + res += dcp.base_prev; return (res); } From owner-svn-src-all@freebsd.org Wed May 8 10:54:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DAD615A6112; Wed, 8 May 2019 10:54:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EA5C6B7B0; Wed, 8 May 2019 10:54:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 699FF4DAF; Wed, 8 May 2019 10:54:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48As6YK057156; Wed, 8 May 2019 10:54:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48As6fv057155; Wed, 8 May 2019 10:54:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081054.x48As6fv057155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347297 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8EA5C6B7B0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:54:07 -0000 Author: hselasky Date: Wed May 8 10:54:05 2019 New Revision: 347297 URL: https://svnweb.freebsd.org/changeset/base/347297 Log: Control automatic update of firmware on driver load with a tunable in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:53:47 2019 (r347296) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:54:05 2019 (r347297) @@ -821,12 +821,19 @@ void *mlx5_get_protocol_dev(struct mlx5_core_dev *mdev } EXPORT_SYMBOL(mlx5_get_protocol_dev); +static int mlx5_auto_fw_update; +SYSCTL_INT(_hw_mlx5, OID_AUTO, auto_fw_update, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &mlx5_auto_fw_update, 0, + "Allow automatic firmware update on driver start"); static int mlx5_firmware_update(struct mlx5_core_dev *dev) { const struct firmware *fw; int err; + TUNABLE_INT_FETCH("hw.mlx5.auto_fw_update", &mlx5_auto_fw_update); + if (!mlx5_auto_fw_update) + return (0); fw = firmware_get("mlx5fw_mfa"); if (fw) { err = mlx5_firmware_flash(dev, fw); From owner-svn-src-all@freebsd.org Wed May 8 10:54:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C537F15A6176; Wed, 8 May 2019 10:54:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D8616B905; Wed, 8 May 2019 10:54:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48A4C4DB0; Wed, 8 May 2019 10:54:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AsPo4057222; Wed, 8 May 2019 10:54:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AsPSJ057221; Wed, 8 May 2019 10:54:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081054.x48AsPSJ057221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347298 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 347298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D8616B905 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:54:25 -0000 Author: hselasky Date: Wed May 8 10:54:24 2019 New Revision: 347298 URL: https://svnweb.freebsd.org/changeset/base/347298 Log: Remove unused speed enums in mlx5core. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 10:54:05 2019 (r347297) +++ head/sys/dev/mlx5/driver.h Wed May 8 10:54:24 2019 (r347298) @@ -207,36 +207,6 @@ enum mlx5_port_status { MLX5_PORT_DOWN = 1 << 1, }; -enum mlx5_link_mode { - MLX5_1000BASE_CX_SGMII = 0, - MLX5_1000BASE_KX = 1, - MLX5_10GBASE_CX4 = 2, - MLX5_10GBASE_KX4 = 3, - MLX5_10GBASE_KR = 4, - MLX5_20GBASE_KR2 = 5, - MLX5_40GBASE_CR4 = 6, - MLX5_40GBASE_KR4 = 7, - MLX5_56GBASE_R4 = 8, - MLX5_10GBASE_CR = 12, - MLX5_10GBASE_SR = 13, - MLX5_10GBASE_ER = 14, - MLX5_40GBASE_SR4 = 15, - MLX5_40GBASE_LR4 = 16, - MLX5_100GBASE_CR4 = 20, - MLX5_100GBASE_SR4 = 21, - MLX5_100GBASE_KR4 = 22, - MLX5_100GBASE_LR4 = 23, - MLX5_100BASE_TX = 24, - MLX5_1000BASE_T = 25, - MLX5_10GBASE_T = 26, - MLX5_25GBASE_CR = 27, - MLX5_25GBASE_KR = 28, - MLX5_25GBASE_SR = 29, - MLX5_50GBASE_CR2 = 30, - MLX5_50GBASE_KR2 = 31, - MLX5_LINK_MODES_NUMBER, -}; - enum { MLX5_VSC_SPACE_SUPPORTED = 0x1, MLX5_VSC_SPACE_OFFSET = 0x4, From owner-svn-src-all@freebsd.org Wed May 8 10:54:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4274115A6217; Wed, 8 May 2019 10:54:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6E6F6BA5D; Wed, 8 May 2019 10:54:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2EB54DB1; Wed, 8 May 2019 10:54:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Asttj057299; Wed, 8 May 2019 10:54:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AssBx057294; Wed, 8 May 2019 10:54:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081054.x48AssBx057294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347299 - in head/sys/dev/mlx5: . mlx5_core mlx5_en mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core mlx5_en mlx5_ib X-SVN-Commit-Revision: 347299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E6E6F6BA5D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:54:56 -0000 Author: hselasky Date: Wed May 8 10:54:54 2019 New Revision: 347299 URL: https://svnweb.freebsd.org/changeset/base/347299 Log: Add support for 200Gb ethernet speeds to mlx5core. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c head/sys/dev/mlx5/mlx5_ifc.h head/sys/dev/mlx5/port.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fw.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:54:24 2019 (r347298) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fw.c Wed May 8 10:54:54 2019 (r347299) @@ -221,6 +221,12 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev) return err; } + if (MLX5_CAP_GEN(dev, pcam_reg)) { + err = mlx5_get_pcam_reg(dev); + if (err) + return err; + } + err = mlx5_core_query_special_contexts(dev); if (err) return err; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed May 8 10:54:24 2019 (r347298) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed May 8 10:54:54 2019 (r347299) @@ -260,7 +260,7 @@ int mlx5_query_port_eth_proto_oper(struct mlx5_core_de EXPORT_SYMBOL(mlx5_query_port_eth_proto_oper); int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin, - int proto_mask) + int proto_mask, bool ext) { u32 in[MLX5_ST_SZ_DW(ptys_reg)] = {0}; u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {0}; @@ -268,10 +268,14 @@ int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 MLX5_SET(ptys_reg, in, local_port, 1); MLX5_SET(ptys_reg, in, proto_mask, proto_mask); - if (proto_mask == MLX5_PTYS_EN) - MLX5_SET(ptys_reg, in, eth_proto_admin, proto_admin); - else + if (proto_mask == MLX5_PTYS_EN) { + if (ext) + MLX5_SET(ptys_reg, in, ext_eth_proto_admin, proto_admin); + else + MLX5_SET(ptys_reg, in, eth_proto_admin, proto_admin); + } else { MLX5_SET(ptys_reg, in, ib_proto_admin, proto_admin); + } err = mlx5_core_access_reg(dev, in, sizeof(in), out, sizeof(out), MLX5_REG_PTYS, 0, 1); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:54:24 2019 (r347298) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:54:54 2019 (r347299) @@ -47,117 +47,355 @@ struct mlx5e_channel_param { struct mlx5e_cq_param tx_cq; }; -static const struct { +struct media { u32 subtype; u64 baudrate; -} mlx5e_mode_table[MLX5E_LINK_MODES_NUMBER] = { +}; - [MLX5E_1000BASE_CX_SGMII] = { +static const struct media mlx5e_mode_table[MLX5E_LINK_SPEEDS_NUMBER][MLX5E_LINK_MODES_NUMBER] = { + + [MLX5E_1000BASE_CX_SGMII][MLX5E_SGMII] = { .subtype = IFM_1000_CX_SGMII, .baudrate = IF_Mbps(1000ULL), }, - [MLX5E_1000BASE_KX] = { + [MLX5E_1000BASE_KX][MLX5E_KX] = { .subtype = IFM_1000_KX, .baudrate = IF_Mbps(1000ULL), }, - [MLX5E_10GBASE_CX4] = { + [MLX5E_10GBASE_CX4][MLX5E_CX4] = { .subtype = IFM_10G_CX4, .baudrate = IF_Gbps(10ULL), }, - [MLX5E_10GBASE_KX4] = { + [MLX5E_10GBASE_KX4][MLX5E_KX4] = { .subtype = IFM_10G_KX4, .baudrate = IF_Gbps(10ULL), }, - [MLX5E_10GBASE_KR] = { + [MLX5E_10GBASE_KR][MLX5E_KR] = { .subtype = IFM_10G_KR, .baudrate = IF_Gbps(10ULL), }, - [MLX5E_20GBASE_KR2] = { + [MLX5E_20GBASE_KR2][MLX5E_KR2] = { .subtype = IFM_20G_KR2, .baudrate = IF_Gbps(20ULL), }, - [MLX5E_40GBASE_CR4] = { + [MLX5E_40GBASE_CR4][MLX5E_CR4] = { .subtype = IFM_40G_CR4, .baudrate = IF_Gbps(40ULL), }, - [MLX5E_40GBASE_KR4] = { + [MLX5E_40GBASE_KR4][MLX5E_KR4] = { .subtype = IFM_40G_KR4, .baudrate = IF_Gbps(40ULL), }, - [MLX5E_56GBASE_R4] = { + [MLX5E_56GBASE_R4][MLX5E_R] = { .subtype = IFM_56G_R4, .baudrate = IF_Gbps(56ULL), }, - [MLX5E_10GBASE_CR] = { + [MLX5E_10GBASE_CR][MLX5E_CR1] = { .subtype = IFM_10G_CR1, .baudrate = IF_Gbps(10ULL), }, - [MLX5E_10GBASE_SR] = { + [MLX5E_10GBASE_SR][MLX5E_SR] = { .subtype = IFM_10G_SR, .baudrate = IF_Gbps(10ULL), }, - [MLX5E_10GBASE_ER] = { + [MLX5E_10GBASE_ER_LR][MLX5E_ER] = { .subtype = IFM_10G_ER, .baudrate = IF_Gbps(10ULL), }, - [MLX5E_40GBASE_SR4] = { + [MLX5E_10GBASE_ER_LR][MLX5E_LR] = { + .subtype = IFM_10G_LR, + .baudrate = IF_Gbps(10ULL), + }, + [MLX5E_40GBASE_SR4][MLX5E_SR4] = { .subtype = IFM_40G_SR4, .baudrate = IF_Gbps(40ULL), }, - [MLX5E_40GBASE_LR4] = { + [MLX5E_40GBASE_LR4_ER4][MLX5E_LR4] = { .subtype = IFM_40G_LR4, .baudrate = IF_Gbps(40ULL), }, - [MLX5E_100GBASE_CR4] = { + [MLX5E_40GBASE_LR4_ER4][MLX5E_ER4] = { + .subtype = IFM_40G_ER4, + .baudrate = IF_Gbps(40ULL), + }, + [MLX5E_100GBASE_CR4][MLX5E_CR4] = { .subtype = IFM_100G_CR4, .baudrate = IF_Gbps(100ULL), }, - [MLX5E_100GBASE_SR4] = { + [MLX5E_100GBASE_SR4][MLX5E_SR4] = { .subtype = IFM_100G_SR4, .baudrate = IF_Gbps(100ULL), }, - [MLX5E_100GBASE_KR4] = { + [MLX5E_100GBASE_KR4][MLX5E_KR4] = { .subtype = IFM_100G_KR4, .baudrate = IF_Gbps(100ULL), }, - [MLX5E_100GBASE_LR4] = { + [MLX5E_100GBASE_LR4][MLX5E_LR4] = { .subtype = IFM_100G_LR4, .baudrate = IF_Gbps(100ULL), }, - [MLX5E_100BASE_TX] = { + [MLX5E_100BASE_TX][MLX5E_TX] = { .subtype = IFM_100_TX, .baudrate = IF_Mbps(100ULL), }, - [MLX5E_1000BASE_T] = { + [MLX5E_1000BASE_T][MLX5E_T] = { .subtype = IFM_1000_T, .baudrate = IF_Mbps(1000ULL), }, - [MLX5E_10GBASE_T] = { + [MLX5E_10GBASE_T][MLX5E_T] = { .subtype = IFM_10G_T, .baudrate = IF_Gbps(10ULL), }, - [MLX5E_25GBASE_CR] = { + [MLX5E_25GBASE_CR][MLX5E_CR] = { .subtype = IFM_25G_CR, .baudrate = IF_Gbps(25ULL), }, - [MLX5E_25GBASE_KR] = { + [MLX5E_25GBASE_KR][MLX5E_KR] = { .subtype = IFM_25G_KR, .baudrate = IF_Gbps(25ULL), }, - [MLX5E_25GBASE_SR] = { + [MLX5E_25GBASE_SR][MLX5E_SR] = { .subtype = IFM_25G_SR, .baudrate = IF_Gbps(25ULL), }, - [MLX5E_50GBASE_CR2] = { + [MLX5E_50GBASE_CR2][MLX5E_CR2] = { .subtype = IFM_50G_CR2, .baudrate = IF_Gbps(50ULL), }, - [MLX5E_50GBASE_KR2] = { + [MLX5E_50GBASE_KR2][MLX5E_KR2] = { .subtype = IFM_50G_KR2, .baudrate = IF_Gbps(50ULL), }, }; +static const struct media mlx5e_ext_mode_table[MLX5E_EXT_LINK_SPEEDS_NUMBER][MLX5E_LINK_MODES_NUMBER] = { + [MLX5E_SGMII_100M][MLX5E_SGMII] = { + .subtype = IFM_100_SGMII, + .baudrate = IF_Mbps(100), + }, + [MLX5E_1000BASE_X_SGMII][MLX5E_KX] = { + .subtype = IFM_1000_KX, + .baudrate = IF_Mbps(1000), + }, + [MLX5E_1000BASE_X_SGMII][MLX5E_CX_SGMII] = { + .subtype = IFM_1000_CX_SGMII, + .baudrate = IF_Mbps(1000), + }, + [MLX5E_1000BASE_X_SGMII][MLX5E_CX] = { + .subtype = IFM_1000_CX, + .baudrate = IF_Mbps(1000), + }, + [MLX5E_1000BASE_X_SGMII][MLX5E_LX] = { + .subtype = IFM_1000_LX, + .baudrate = IF_Mbps(1000), + }, + [MLX5E_1000BASE_X_SGMII][MLX5E_SX] = { + .subtype = IFM_1000_SX, + .baudrate = IF_Mbps(1000), + }, + [MLX5E_1000BASE_X_SGMII][MLX5E_T] = { + .subtype = IFM_1000_T, + .baudrate = IF_Mbps(1000), + }, + [MLX5E_5GBASE_R][MLX5E_T] = { + .subtype = IFM_5000_T, + .baudrate = IF_Mbps(5000), + }, + [MLX5E_5GBASE_R][MLX5E_KR] = { + .subtype = IFM_5000_KR, + .baudrate = IF_Mbps(5000), + }, + [MLX5E_5GBASE_R][MLX5E_KR1] = { + .subtype = IFM_5000_KR1, + .baudrate = IF_Mbps(5000), + }, + [MLX5E_5GBASE_R][MLX5E_KR_S] = { + .subtype = IFM_5000_KR_S, + .baudrate = IF_Mbps(5000), + }, + [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_ER] = { + .subtype = IFM_10G_ER, + .baudrate = IF_Gbps(10ULL), + }, + [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_KR] = { + .subtype = IFM_10G_KR, + .baudrate = IF_Gbps(10ULL), + }, + [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_LR] = { + .subtype = IFM_10G_LR, + .baudrate = IF_Gbps(10ULL), + }, + [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_SR] = { + .subtype = IFM_10G_SR, + .baudrate = IF_Gbps(10ULL), + }, + [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_T] = { + .subtype = IFM_10G_T, + .baudrate = IF_Gbps(10ULL), + }, + [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_AOC] = { + .subtype = IFM_10G_AOC, + .baudrate = IF_Gbps(10ULL), + }, + [MLX5E_10GBASE_XFI_XAUI_1][MLX5E_CR1] = { + .subtype = IFM_10G_CR1, + .baudrate = IF_Gbps(10ULL), + }, + [MLX5E_40GBASE_XLAUI_4_XLPPI_4][MLX5E_CR4] = { + .subtype = IFM_40G_CR4, + .baudrate = IF_Gbps(40ULL), + }, + [MLX5E_40GBASE_XLAUI_4_XLPPI_4][MLX5E_KR4] = { + .subtype = IFM_40G_KR4, + .baudrate = IF_Gbps(40ULL), + }, + [MLX5E_40GBASE_XLAUI_4_XLPPI_4][MLX5E_LR4] = { + .subtype = IFM_40G_LR4, + .baudrate = IF_Gbps(40ULL), + }, + [MLX5E_40GBASE_XLAUI_4_XLPPI_4][MLX5E_SR4] = { + .subtype = IFM_40G_SR4, + .baudrate = IF_Gbps(40ULL), + }, + [MLX5E_40GBASE_XLAUI_4_XLPPI_4][MLX5E_ER4] = { + .subtype = IFM_40G_ER4, + .baudrate = IF_Gbps(40ULL), + }, + + [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_CR] = { + .subtype = IFM_25G_CR, + .baudrate = IF_Gbps(25ULL), + }, + [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_KR] = { + .subtype = IFM_25G_KR, + .baudrate = IF_Gbps(25ULL), + }, + [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_SR] = { + .subtype = IFM_25G_SR, + .baudrate = IF_Gbps(25ULL), + }, + [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_ACC] = { + .subtype = IFM_25G_ACC, + .baudrate = IF_Gbps(25ULL), + }, + [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_AOC] = { + .subtype = IFM_25G_AOC, + .baudrate = IF_Gbps(25ULL), + }, + [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_CR1] = { + .subtype = IFM_25G_CR1, + .baudrate = IF_Gbps(25ULL), + }, + [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_CR_S] = { + .subtype = IFM_25G_CR_S, + .baudrate = IF_Gbps(25ULL), + }, + [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_KR1] = { + .subtype = IFM_5000_KR1, + .baudrate = IF_Gbps(25ULL), + }, + [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_KR_S] = { + .subtype = IFM_25G_KR_S, + .baudrate = IF_Gbps(25ULL), + }, + [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_LR] = { + .subtype = IFM_25G_LR, + .baudrate = IF_Gbps(25ULL), + }, + [MLX5E_25GAUI_1_25GBASE_CR_KR][MLX5E_T] = { + .subtype = IFM_25G_T, + .baudrate = IF_Gbps(25ULL), + }, + [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_CR2] = { + .subtype = IFM_50G_CR2, + .baudrate = IF_Gbps(50ULL), + }, + [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_KR2] = { + .subtype = IFM_50G_KR2, + .baudrate = IF_Gbps(50ULL), + }, + [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_SR2] = { + .subtype = IFM_50G_SR2, + .baudrate = IF_Gbps(50ULL), + }, + [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_LR2] = { + .subtype = IFM_50G_LR2, + .baudrate = IF_Gbps(50ULL), + }, + [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR][MLX5E_LR] = { + .subtype = IFM_50G_LR, + .baudrate = IF_Gbps(50ULL), + }, + [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR][MLX5E_SR] = { + .subtype = IFM_50G_SR, + .baudrate = IF_Gbps(50ULL), + }, + [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR][MLX5E_CP] = { + .subtype = IFM_50G_CP, + .baudrate = IF_Gbps(50ULL), + }, + [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR][MLX5E_FR] = { + .subtype = IFM_50G_FR, + .baudrate = IF_Gbps(50ULL), + }, + [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR][MLX5E_KR_PAM4] = { + .subtype = IFM_50G_KR_PAM4, + .baudrate = IF_Gbps(50ULL), + }, + [MLX5E_CAUI_4_100GBASE_CR4_KR4][MLX5E_CR4] = { + .subtype = IFM_100G_CR4, + .baudrate = IF_Gbps(100ULL), + }, + [MLX5E_CAUI_4_100GBASE_CR4_KR4][MLX5E_KR4] = { + .subtype = IFM_100G_KR4, + .baudrate = IF_Gbps(100ULL), + }, + [MLX5E_CAUI_4_100GBASE_CR4_KR4][MLX5E_LR4] = { + .subtype = IFM_100G_LR4, + .baudrate = IF_Gbps(100ULL), + }, + [MLX5E_CAUI_4_100GBASE_CR4_KR4][MLX5E_SR4] = { + .subtype = IFM_100G_SR4, + .baudrate = IF_Gbps(100ULL), + }, + [MLX5E_100GAUI_2_100GBASE_CR2_KR2][MLX5E_SR2] = { + .subtype = IFM_100G_SR2, + .baudrate = IF_Gbps(100ULL), + }, + [MLX5E_100GAUI_2_100GBASE_CR2_KR2][MLX5E_CP2] = { + .subtype = IFM_100G_CP2, + .baudrate = IF_Gbps(100ULL), + }, + [MLX5E_100GAUI_2_100GBASE_CR2_KR2][MLX5E_KR2_PAM4] = { + .subtype = IFM_100G_KR2_PAM4, + .baudrate = IF_Gbps(100ULL), + }, + [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_DR4] = { + .subtype = IFM_200G_DR4, + .baudrate = IF_Gbps(200ULL), + }, + [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_LR4] = { + .subtype = IFM_200G_LR4, + .baudrate = IF_Gbps(200ULL), + }, + [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_SR4] = { + .subtype = IFM_200G_SR4, + .baudrate = IF_Gbps(200ULL), + }, + [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_FR4] = { + .subtype = IFM_200G_FR4, + .baudrate = IF_Gbps(200ULL), + }, + [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_CR4_PAM4] = { + .subtype = IFM_200G_CR4_PAM4, + .baudrate = IF_Gbps(200ULL), + }, + [MLX5E_200GAUI_4_200GBASE_CR4_KR4][MLX5E_KR4_PAM4] = { + .subtype = IFM_200G_KR4_PAM4, + .baudrate = IF_Gbps(200ULL), + }, +}; + MALLOC_DEFINE(M_MLX5EN, "MLX5EN", "MLX5 Ethernet"); static void @@ -169,7 +407,9 @@ mlx5e_update_carrier(struct mlx5e_priv *priv) int error; u8 port_state; u8 is_er_type; - u8 i; + u8 i, j; + bool ext; + struct media media_entry = {}; port_state = mlx5_query_vport_state(mdev, MLX5_QUERY_VPORT_STATE_IN_OP_MOD_VNIC_VPORT, 0); @@ -183,49 +423,58 @@ mlx5e_update_carrier(struct mlx5e_priv *priv) return; } - error = mlx5_query_port_ptys(mdev, out, sizeof(out), MLX5_PTYS_EN, 1); + error = mlx5_query_port_ptys(mdev, out, sizeof(out), + MLX5_PTYS_EN, 1); if (error) { priv->media_active_last = IFM_ETHER; priv->ifp->if_baudrate = 1; - if_printf(priv->ifp, "%s: query port ptys failed: 0x%x\n", - __func__, error); + if_printf(priv->ifp, "%s: query port ptys failed: " + "0x%x\n", __func__, error); return; } - eth_proto_oper = MLX5_GET(ptys_reg, out, eth_proto_oper); - for (i = 0; i != MLX5E_LINK_MODES_NUMBER; i++) { - if (mlx5e_mode_table[i].baudrate == 0) - continue; - if (MLX5E_PROT_MASK(i) & eth_proto_oper) { - u32 subtype = mlx5e_mode_table[i].subtype; + ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet); + eth_proto_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, + eth_proto_oper); - priv->ifp->if_baudrate = - mlx5e_mode_table[i].baudrate; + i = ilog2(eth_proto_oper); - switch (subtype) { - case IFM_10G_ER: - error = mlx5_query_pddr_range_info(mdev, 1, &is_er_type); - if (error != 0) { - if_printf(priv->ifp, "%s: query port pddr failed: %d\n", - __func__, error); - } - if (error != 0 || is_er_type == 0) - subtype = IFM_10G_LR; - break; - case IFM_40G_LR4: - error = mlx5_query_pddr_range_info(mdev, 1, &is_er_type); - if (error != 0) { - if_printf(priv->ifp, "%s: query port pddr failed: %d\n", - __func__, error); - } - if (error == 0 && is_er_type != 0) - subtype = IFM_40G_ER4; - break; - } - priv->media_active_last = subtype | IFM_ETHER | IFM_FDX; + for (j = 0; j != MLX5E_LINK_MODES_NUMBER; j++) { + media_entry = ext ? mlx5e_ext_mode_table[i][j] : + mlx5e_mode_table[i][j]; + if (media_entry.baudrate != 0) break; + } + + if (media_entry.subtype == 0) { + if_printf(priv->ifp, "%s: Could not find operational " + "media subtype\n", __func__); + return; + } + + switch (media_entry.subtype) { + case IFM_10G_ER: + error = mlx5_query_pddr_range_info(mdev, 1, &is_er_type); + if (error != 0) { + if_printf(priv->ifp, "%s: query port pddr failed: %d\n", + __func__, error); } + if (error != 0 || is_er_type == 0) + media_entry.subtype = IFM_10G_LR; + break; + case IFM_40G_LR4: + error = mlx5_query_pddr_range_info(mdev, 1, &is_er_type); + if (error != 0) { + if_printf(priv->ifp, "%s: query port pddr failed: %d\n", + __func__, error); + } + if (error == 0 && is_er_type != 0) + media_entry.subtype = IFM_40G_ER4; + break; } + priv->media_active_last = media_entry.subtype | IFM_ETHER | IFM_FDX; + priv->ifp->if_baudrate = media_entry.baudrate; + if_link_state_change(priv->ifp, LINK_STATE_UP); } @@ -242,10 +491,13 @@ mlx5e_media_status(struct ifnet *dev, struct ifmediare } static u32 -mlx5e_find_link_mode(u32 subtype) +mlx5e_find_link_mode(u32 subtype, bool ext) { u32 i; + u32 j; u32 link_mode = 0; + u32 speeds_num = 0; + struct media media_entry = {}; switch (subtype) { case IFM_10G_LR: @@ -256,11 +508,19 @@ mlx5e_find_link_mode(u32 subtype) break; } - for (i = 0; i < MLX5E_LINK_MODES_NUMBER; ++i) { - if (mlx5e_mode_table[i].baudrate == 0) - continue; - if (mlx5e_mode_table[i].subtype == subtype) - link_mode |= MLX5E_PROT_MASK(i); + speeds_num = ext ? MLX5E_EXT_LINK_SPEEDS_NUMBER : + MLX5E_LINK_SPEEDS_NUMBER; + + for (i = 0; i != speeds_num; i++) { + for (j = 0; j < MLX5E_LINK_MODES_NUMBER ; ++j) { + media_entry = ext ? mlx5e_ext_mode_table[i][j] : + mlx5e_mode_table[i][j]; + if (media_entry.baudrate == 0) + continue; + if (media_entry.subtype == subtype) { + link_mode |= MLX5E_PROT_MASK(i); + } + } } return (link_mode); @@ -286,7 +546,8 @@ mlx5e_set_port_pfc(struct mlx5e_priv *priv) } else if (priv->params.rx_pauseframe_control || priv->params.tx_pauseframe_control) { if_printf(priv->ifp, - "Global pauseframes must be disabled before enabling PFC.\n"); + "Global pauseframes must be disabled before " + "enabling PFC.\n"); error = -EINVAL; } else { error = mlx5e_set_port_pause_and_pfc(priv); @@ -301,9 +562,11 @@ mlx5e_media_change(struct ifnet *dev) struct mlx5_core_dev *mdev = priv->mdev; u32 eth_proto_cap; u32 link_mode; + u32 out[MLX5_ST_SZ_DW(ptys_reg)]; int was_opened; int locked; int error; + bool ext; locked = PRIV_LOCKED(priv); if (!locked) @@ -313,14 +576,21 @@ mlx5e_media_change(struct ifnet *dev) error = EINVAL; goto done; } - link_mode = mlx5e_find_link_mode(IFM_SUBTYPE(priv->media.ifm_media)); - /* query supported capabilities */ - error = mlx5_query_port_proto_cap(mdev, ð_proto_cap, MLX5_PTYS_EN); + error = mlx5_query_port_ptys(mdev, out, sizeof(out), + MLX5_PTYS_EN, 1); if (error != 0) { if_printf(dev, "Query port media capability failed\n"); goto done; } + + ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet); + link_mode = mlx5e_find_link_mode(IFM_SUBTYPE(priv->media.ifm_media), ext); + + /* query supported capabilities */ + eth_proto_cap = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, + eth_proto_capability); + /* check for autoselect */ if (IFM_SUBTYPE(priv->media.ifm_media) == IFM_AUTO) { link_mode = eth_proto_cap; @@ -357,7 +627,7 @@ mlx5e_media_change(struct ifnet *dev) /* reconfigure the hardware */ mlx5_set_port_status(mdev, MLX5_PORT_DOWN); - mlx5_set_port_proto(mdev, link_mode, MLX5_PTYS_EN); + mlx5_set_port_proto(mdev, link_mode, MLX5_PTYS_EN, ext); error = -mlx5e_set_port_pause_and_pfc(priv); if (was_opened) mlx5_set_port_status(mdev, MLX5_PORT_UP); @@ -3760,13 +4030,18 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) struct ifnet *ifp; struct mlx5e_priv *priv; u8 dev_addr[ETHER_ADDR_LEN] __aligned(4); + u8 connector_type; struct sysctl_oid_list *child; int ncv = mdev->priv.eq_table.num_comp_vectors; char unit[16]; struct pfil_head_args pa; int err; - int i; + int i,j; u32 eth_proto_cap; + u32 out[MLX5_ST_SZ_DW(ptys_reg)]; + bool ext = 0; + u32 speeds_num; + struct media media_entry = {}; if (mlx5e_check_required_hca_cap(mdev)) { mlx5_core_dbg(mdev, "mlx5e_check_required_hca_cap() failed\n"); @@ -3919,28 +4194,41 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) /* setup default pauseframes configuration */ mlx5e_setup_pauseframes(priv); - err = mlx5_query_port_proto_cap(mdev, ð_proto_cap, MLX5_PTYS_EN); - if (err) { + /* Setup supported medias */ + //TODO: If we failed to query ptys is it ok to proceed?? + if (!mlx5_query_port_ptys(mdev, out, sizeof(out), MLX5_PTYS_EN, 1)) { + ext = MLX5_CAP_PCAM_FEATURE(mdev, + ptys_extended_ethernet); + eth_proto_cap = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, + eth_proto_capability); + if (MLX5_CAP_PCAM_FEATURE(mdev, ptys_connector_type)) + connector_type = MLX5_GET(ptys_reg, out, + connector_type); + } else { eth_proto_cap = 0; - if_printf(ifp, "%s: Query port media capability failed, %d\n", - __func__, err); + if_printf(ifp, "%s: Query port media capability failed," + " %d\n", __func__, err); } - /* Setup supported medias */ ifmedia_init(&priv->media, IFM_IMASK | IFM_ETH_FMASK, mlx5e_media_change, mlx5e_media_status); - for (i = 0; i < MLX5E_LINK_MODES_NUMBER; ++i) { - if (mlx5e_mode_table[i].baudrate == 0) - continue; - if (MLX5E_PROT_MASK(i) & eth_proto_cap) { - ifmedia_add(&priv->media, - mlx5e_mode_table[i].subtype | - IFM_ETHER, 0, NULL); - ifmedia_add(&priv->media, - mlx5e_mode_table[i].subtype | - IFM_ETHER | IFM_FDX | - IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); + speeds_num = ext ? MLX5E_EXT_LINK_SPEEDS_NUMBER : MLX5E_LINK_SPEEDS_NUMBER; + for (i = 0; i != speeds_num; i++) { + for (j = 0; j < MLX5E_LINK_MODES_NUMBER ; ++j) { + media_entry = ext ? mlx5e_ext_mode_table[i][j] : + mlx5e_mode_table[i][j]; + if (media_entry.baudrate == 0) + continue; + if (MLX5E_PROT_MASK(i) & eth_proto_cap) { + ifmedia_add(&priv->media, + media_entry.subtype | + IFM_ETHER, 0, NULL); + ifmedia_add(&priv->media, + media_entry.subtype | + IFM_ETHER | IFM_FDX | + IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); + } } } Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 10:54:24 2019 (r347298) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 10:54:54 2019 (r347299) @@ -180,7 +180,7 @@ static int translate_eth_proto_oper(u32 eth_proto_oper case MLX5E_PROT_MASK(MLX5E_10GBASE_KR): case MLX5E_PROT_MASK(MLX5E_10GBASE_CR): case MLX5E_PROT_MASK(MLX5E_10GBASE_SR): - case MLX5E_PROT_MASK(MLX5E_10GBASE_ER): + case MLX5E_PROT_MASK(MLX5E_10GBASE_ER_LR): *active_width = IB_WIDTH_1X; *active_speed = IB_SPEED_QDR; break; @@ -193,7 +193,7 @@ static int translate_eth_proto_oper(u32 eth_proto_oper case MLX5E_PROT_MASK(MLX5E_40GBASE_CR4): case MLX5E_PROT_MASK(MLX5E_40GBASE_KR4): case MLX5E_PROT_MASK(MLX5E_40GBASE_SR4): - case MLX5E_PROT_MASK(MLX5E_40GBASE_LR4): + case MLX5E_PROT_MASK(MLX5E_40GBASE_LR4_ER4): *active_width = IB_WIDTH_4X; *active_speed = IB_SPEED_QDR; break; Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:54:24 2019 (r347298) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:54:54 2019 (r347299) @@ -7881,28 +7881,29 @@ struct mlx5_ifc_ptys_reg_bits { u8 reserved_3[0xc]; u8 data_rate_oper[0x10]; - u8 fc_proto_capability[0x20]; + u8 ext_eth_proto_capability[0x20]; u8 eth_proto_capability[0x20]; u8 ib_link_width_capability[0x10]; u8 ib_proto_capability[0x10]; - u8 fc_proto_admin[0x20]; + u8 ext_eth_proto_admin[0x20]; u8 eth_proto_admin[0x20]; u8 ib_link_width_admin[0x10]; u8 ib_proto_admin[0x10]; - u8 fc_proto_oper[0x20]; + u8 ext_eth_proto_oper[0x20]; u8 eth_proto_oper[0x20]; u8 ib_link_width_oper[0x10]; u8 ib_proto_oper[0x10]; - u8 reserved_4[0x20]; + u8 reserved_4[0x1c]; + u8 connector_type[0x4]; u8 eth_proto_lp_advertise[0x20]; @@ -8601,8 +8602,17 @@ struct mlx5_ifc_qcam_reg_bits { }; struct mlx5_ifc_pcam_enhanced_features_bits { - u8 reserved_at_0[0x7e]; - + u8 reserved_at_0[0x6d]; + u8 rx_icrc_encapsulated_counter[0x1]; + u8 reserved_at_6e[0x4]; + u8 ptys_extended_ethernet[0x1]; + u8 reserved_at_73[0x3]; + u8 pfcc_mask[0x1]; + u8 reserved_at_77[0x3]; + u8 per_lane_error_counters[0x1]; + u8 rx_buffer_fullness_counters[0x1]; + u8 ptys_connector_type[0x1]; + u8 reserved_at_7d[0x1]; u8 ppcnt_discard_group[0x1]; u8 ppcnt_statistical_group[0x1]; }; Modified: head/sys/dev/mlx5/port.h ============================================================================== --- head/sys/dev/mlx5/port.h Wed May 8 10:54:24 2019 (r347298) +++ head/sys/dev/mlx5/port.h Wed May 8 10:54:54 2019 (r347299) @@ -58,7 +58,7 @@ enum mlx5_an_status { #define MLX5_I2C_ADDR_HIGH 0x51 #define MLX5_EEPROM_PAGE_LENGTH 256 -enum mlx5e_link_mode { +enum mlx5e_link_speed { MLX5E_1000BASE_CX_SGMII = 0, MLX5E_1000BASE_KX = 1, MLX5E_10GBASE_CX4 = 2, @@ -70,9 +70,9 @@ enum mlx5e_link_mode { MLX5E_56GBASE_R4 = 8, MLX5E_10GBASE_CR = 12, MLX5E_10GBASE_SR = 13, - MLX5E_10GBASE_ER = 14, + MLX5E_10GBASE_ER_LR = 14, MLX5E_40GBASE_SR4 = 15, - MLX5E_40GBASE_LR4 = 16, + MLX5E_40GBASE_LR4_ER4 = 16, MLX5E_50GBASE_SR2 = 18, MLX5E_100GBASE_CR4 = 20, MLX5E_100GBASE_SR4 = 21, @@ -86,6 +86,78 @@ enum mlx5e_link_mode { MLX5E_25GBASE_SR = 29, MLX5E_50GBASE_CR2 = 30, MLX5E_50GBASE_KR2 = 31, + MLX5E_LINK_SPEEDS_NUMBER, +}; + +enum mlx5e_ext_link_speed { + MLX5E_SGMII_100M = 0, + MLX5E_1000BASE_X_SGMII = 1, + MLX5E_5GBASE_R = 3, + MLX5E_10GBASE_XFI_XAUI_1 = 4, + MLX5E_40GBASE_XLAUI_4_XLPPI_4 = 5, + MLX5E_25GAUI_1_25GBASE_CR_KR = 6, + MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2 = 7, + MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR = 8, + MLX5E_CAUI_4_100GBASE_CR4_KR4 = 9, + MLX5E_100GAUI_2_100GBASE_CR2_KR2 = 10, + MLX5E_200GAUI_4_200GBASE_CR4_KR4 = 12, + MLX5E_400GAUI_8 = 15, + MLX5E_EXT_LINK_SPEEDS_NUMBER, +}; + +enum mlx5e_link_mode { + MLX5E_ACC, + MLX5E_AOC, + MLX5E_AUI, + MLX5E_AUI_AC, + MLX5E_AUI2, + MLX5E_AUI2_AC, + MLX5E_AUI4, + MLX5E_AUI4_AC, + MLX5E_CAUI2, + MLX5E_CAUI2_AC, + MLX5E_CAUI4, + MLX5E_CAUI4_AC, + MLX5E_CP, + MLX5E_CP2, + MLX5E_CR, + MLX5E_CR_S, + MLX5E_CR1, + MLX5E_CR2, + MLX5E_CR4, + MLX5E_CR_PAM4, + MLX5E_CR4_PAM4, + MLX5E_CX4, + MLX5E_CX, + MLX5E_CX_SGMII, + MLX5E_DR, + MLX5E_DR4, + MLX5E_ER, + MLX5E_ER4, + MLX5E_FR, + MLX5E_FR4, + MLX5E_KR, + MLX5E_KR1, + MLX5E_KR_PAM4, + MLX5E_KR_S, + MLX5E_KR2, + MLX5E_KR2_PAM4, + MLX5E_KR4, + MLX5E_KR4_PAM4, + MLX5E_KX, + MLX5E_KX4, + MLX5E_LR, + MLX5E_LR2, + MLX5E_LR4, + MLX5E_LX, + MLX5E_R, + MLX5E_SGMII, + MLX5E_SR, + MLX5E_SR2, + MLX5E_SR4, + MLX5E_SX, + MLX5E_T, + MLX5E_TX, MLX5E_LINK_MODES_NUMBER, }; @@ -113,6 +185,10 @@ enum mlx5_qpts_trust_state { #define PORT_MODULE_EVENT_MODULE_STATUS_MASK 0xF #define PORT_MODULE_EVENT_ERROR_TYPE_MASK 0xF +#define MLX5_GET_ETH_PROTO(reg, out, ext, field) \ + ((ext) ? MLX5_GET(reg, out, ext_##field) : \ + MLX5_GET(reg, out, field)) + int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps); int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys, int ptys_size, int proto_mask, u8 local_port); @@ -127,7 +203,7 @@ int mlx5_query_port_proto_admin(struct mlx5_core_dev * int mlx5_query_port_eth_proto_oper(struct mlx5_core_dev *dev, u32 *proto_oper, u8 local_port); int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin, - int proto_mask); + int proto_mask, bool ext); int mlx5_set_port_status(struct mlx5_core_dev *dev, enum mlx5_port_status status); int mlx5_query_port_status(struct mlx5_core_dev *dev, u8 *status); From owner-svn-src-all@freebsd.org Wed May 8 10:55:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37EAE15A626F; Wed, 8 May 2019 10:55:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D34366BB8B; Wed, 8 May 2019 10:55:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC6554DB2; Wed, 8 May 2019 10:55:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AtFKQ057397; Wed, 8 May 2019 10:55:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AtFcw057396; Wed, 8 May 2019 10:55:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081055.x48AtFcw057396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347300 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D34366BB8B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:55:16 -0000 Author: hselasky Date: Wed May 8 10:55:15 2019 New Revision: 347300 URL: https://svnweb.freebsd.org/changeset/base/347300 Log: Do not add IFM_10G_LR and IFM_40G_ER4 to supported media types by default in mlx5en(4). IFM_10G_LR and IFM_40G_ER4 media should be added only if the device has the needed capability bit set for it. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:54:54 2019 (r347299) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:55:15 2019 (r347300) @@ -4232,17 +4232,6 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) } } - /* Additional supported medias */ - ifmedia_add(&priv->media, IFM_10G_LR | IFM_ETHER, 0, NULL); - ifmedia_add(&priv->media, IFM_10G_LR | - IFM_ETHER | IFM_FDX | - IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); - - ifmedia_add(&priv->media, IFM_40G_ER4 | IFM_ETHER, 0, NULL); - ifmedia_add(&priv->media, IFM_40G_ER4 | - IFM_ETHER | IFM_FDX | - IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); - ifmedia_add(&priv->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_add(&priv->media, IFM_ETHER | IFM_AUTO | IFM_FDX | IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); From owner-svn-src-all@freebsd.org Wed May 8 10:55:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3124115A630B; Wed, 8 May 2019 10:55:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C67116BD31; Wed, 8 May 2019 10:55:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A17F04DB3; Wed, 8 May 2019 10:55:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Atlne057466; Wed, 8 May 2019 10:55:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AtlQ5057464; Wed, 8 May 2019 10:55:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081055.x48AtlQ5057464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347301 - in head/sys/ofed: drivers/infiniband/core include/rdma X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/ofed: drivers/infiniband/core include/rdma X-SVN-Commit-Revision: 347301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C67116BD31 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:55:48 -0000 Author: hselasky Date: Wed May 8 10:55:47 2019 New Revision: 347301 URL: https://svnweb.freebsd.org/changeset/base/347301 Log: Add new rates to ibcore. Add the new rates that were added to the Infiniband specification as part of HDR and 2x support. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c head/sys/ofed/include/rdma/ib_verbs.h Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_verbs.c Wed May 8 10:55:15 2019 (r347300) +++ head/sys/ofed/drivers/infiniband/core/ib_verbs.c Wed May 8 10:55:47 2019 (r347301) @@ -136,6 +136,10 @@ __attribute_const__ int ib_rate_to_mult(enum ib_rate r case IB_RATE_60_GBPS: return 24; case IB_RATE_80_GBPS: return 32; case IB_RATE_120_GBPS: return 48; + case IB_RATE_28_GBPS: return 11; + case IB_RATE_50_GBPS: return 20; + case IB_RATE_400_GBPS: return 160; + case IB_RATE_600_GBPS: return 240; default: return -1; } } @@ -153,6 +157,18 @@ __attribute_const__ enum ib_rate mult_to_ib_rate(int m case 24: return IB_RATE_60_GBPS; case 32: return IB_RATE_80_GBPS; case 48: return IB_RATE_120_GBPS; + case 6: return IB_RATE_14_GBPS; + case 22: return IB_RATE_56_GBPS; + case 45: return IB_RATE_112_GBPS; + case 67: return IB_RATE_168_GBPS; + case 10: return IB_RATE_25_GBPS; + case 40: return IB_RATE_100_GBPS; + case 80: return IB_RATE_200_GBPS; + case 120: return IB_RATE_300_GBPS; + case 11: return IB_RATE_28_GBPS; + case 20: return IB_RATE_50_GBPS; + case 160: return IB_RATE_400_GBPS; + case 240: return IB_RATE_600_GBPS; default: return IB_RATE_PORT_CURRENT; } } @@ -178,6 +194,10 @@ __attribute_const__ int ib_rate_to_mbps(enum ib_rate r case IB_RATE_100_GBPS: return 103125; case IB_RATE_200_GBPS: return 206250; case IB_RATE_300_GBPS: return 309375; + case IB_RATE_28_GBPS: return 28125; + case IB_RATE_50_GBPS: return 53125; + case IB_RATE_400_GBPS: return 425000; + case IB_RATE_600_GBPS: return 637500; default: return -1; } } Modified: head/sys/ofed/include/rdma/ib_verbs.h ============================================================================== --- head/sys/ofed/include/rdma/ib_verbs.h Wed May 8 10:55:15 2019 (r347300) +++ head/sys/ofed/include/rdma/ib_verbs.h Wed May 8 10:55:47 2019 (r347301) @@ -398,6 +398,7 @@ enum ib_port_cap_flags { enum ib_port_width { IB_WIDTH_1X = 1, + IB_WIDTH_2X = 16, IB_WIDTH_4X = 2, IB_WIDTH_8X = 4, IB_WIDTH_12X = 8 @@ -407,6 +408,7 @@ static inline int ib_width_enum_to_int(enum ib_port_wi { switch (width) { case IB_WIDTH_1X: return 1; + case IB_WIDTH_2X: return 2; case IB_WIDTH_4X: return 4; case IB_WIDTH_8X: return 8; case IB_WIDTH_12X: return 12; @@ -672,7 +674,11 @@ enum ib_rate { IB_RATE_25_GBPS = 15, IB_RATE_100_GBPS = 16, IB_RATE_200_GBPS = 17, - IB_RATE_300_GBPS = 18 + IB_RATE_300_GBPS = 18, + IB_RATE_28_GBPS = 19, + IB_RATE_50_GBPS = 20, + IB_RATE_400_GBPS = 21, + IB_RATE_600_GBPS = 22, }; /** From owner-svn-src-all@freebsd.org Wed May 8 10:56:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 795A115A6396; Wed, 8 May 2019 10:56:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2295B6BE8D; Wed, 8 May 2019 10:56:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D38584DB4; Wed, 8 May 2019 10:56:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AuNGn057545; Wed, 8 May 2019 10:56:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AuNGp057542; Wed, 8 May 2019 10:56:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081056.x48AuNGp057542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347302 - in head/contrib/ofed/libibverbs: . examples X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/contrib/ofed/libibverbs: . examples X-SVN-Commit-Revision: 347302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2295B6BE8D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:56:24 -0000 Author: hselasky Date: Wed May 8 10:56:22 2019 New Revision: 347302 URL: https://svnweb.freebsd.org/changeset/base/347302 Log: Add support for 200Gbit speeds to libibverbs. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/contrib/ofed/libibverbs/examples/devinfo.c head/contrib/ofed/libibverbs/verbs.c head/contrib/ofed/libibverbs/verbs.h Modified: head/contrib/ofed/libibverbs/examples/devinfo.c ============================================================================== --- head/contrib/ofed/libibverbs/examples/devinfo.c Wed May 8 10:55:47 2019 (r347301) +++ head/contrib/ofed/libibverbs/examples/devinfo.c Wed May 8 10:56:22 2019 (r347302) @@ -128,6 +128,7 @@ static const char *width_str(uint8_t width) case 2: return "4"; case 4: return "8"; case 8: return "12"; + case 16: return "2"; default: return "invalid width"; } } @@ -143,6 +144,7 @@ static const char *speed_str(uint8_t speed) case 16: return "14.0 Gbps"; case 32: return "25.0 Gbps"; + case 64: return "50.0 Gbps"; default: return "invalid speed"; } } Modified: head/contrib/ofed/libibverbs/verbs.c ============================================================================== --- head/contrib/ofed/libibverbs/verbs.c Wed May 8 10:55:47 2019 (r347301) +++ head/contrib/ofed/libibverbs/verbs.c Wed May 8 10:56:22 2019 (r347302) @@ -111,6 +111,10 @@ int __attribute__((const)) ibv_rate_to_mult(enum ibv_r case IBV_RATE_60_GBPS: return 24; case IBV_RATE_80_GBPS: return 32; case IBV_RATE_120_GBPS: return 48; + case IBV_RATE_28_GBPS: return 11; + case IBV_RATE_50_GBPS: return 20; + case IBV_RATE_400_GBPS: return 160; + case IBV_RATE_600_GBPS: return 240; default: return -1; } } @@ -127,6 +131,10 @@ enum ibv_rate __attribute__((const)) mult_to_ibv_rate( case 24: return IBV_RATE_60_GBPS; case 32: return IBV_RATE_80_GBPS; case 48: return IBV_RATE_120_GBPS; + case 11: return IBV_RATE_28_GBPS; + case 20: return IBV_RATE_50_GBPS; + case 160: return IBV_RATE_400_GBPS; + case 240: return IBV_RATE_600_GBPS; default: return IBV_RATE_MAX; } } @@ -151,6 +159,10 @@ int __attribute__((const)) ibv_rate_to_mbps(enum ibv_ case IBV_RATE_100_GBPS: return 103125; case IBV_RATE_200_GBPS: return 206250; case IBV_RATE_300_GBPS: return 309375; + case IBV_RATE_28_GBPS: return 28125; + case IBV_RATE_50_GBPS: return 53125; + case IBV_RATE_400_GBPS: return 425000; + case IBV_RATE_600_GBPS: return 637500; default: return -1; } } @@ -175,6 +187,10 @@ enum ibv_rate __attribute__((const)) mbps_to_ibv_rate( case 103125: return IBV_RATE_100_GBPS; case 206250: return IBV_RATE_200_GBPS; case 309375: return IBV_RATE_300_GBPS; + case 28125: return IBV_RATE_28_GBPS; + case 53125: return IBV_RATE_50_GBPS; + case 425000: return IBV_RATE_400_GBPS; + case 637500: return IBV_RATE_600_GBPS; default: return IBV_RATE_MAX; } } Modified: head/contrib/ofed/libibverbs/verbs.h ============================================================================== --- head/contrib/ofed/libibverbs/verbs.h Wed May 8 10:55:47 2019 (r347301) +++ head/contrib/ofed/libibverbs/verbs.h Wed May 8 10:56:22 2019 (r347302) @@ -590,7 +590,11 @@ enum ibv_rate { IBV_RATE_25_GBPS = 15, IBV_RATE_100_GBPS = 16, IBV_RATE_200_GBPS = 17, - IBV_RATE_300_GBPS = 18 + IBV_RATE_300_GBPS = 18, + IBV_RATE_28_GBPS = 19, + IBV_RATE_50_GBPS = 20, + IBV_RATE_400_GBPS = 21, + IBV_RATE_600_GBPS = 22, }; /** From owner-svn-src-all@freebsd.org Wed May 8 10:56:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1ABC15A640F; Wed, 8 May 2019 10:56:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99D0A6C002; Wed, 8 May 2019 10:56:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74F364DB5; Wed, 8 May 2019 10:56:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AuqkL057624; Wed, 8 May 2019 10:56:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AuqLR057622; Wed, 8 May 2019 10:56:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081056.x48AuqLR057622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347303 - head/sys/dev/mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 347303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99D0A6C002 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:56:53 -0000 Author: hselasky Date: Wed May 8 10:56:51 2019 New Revision: 347303 URL: https://svnweb.freebsd.org/changeset/base/347303 Log: Add support for new rates to mlx5ib. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 10:56:22 2019 (r347302) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 10:56:51 2019 (r347303) @@ -223,14 +223,70 @@ static int translate_eth_proto_oper(u32 eth_proto_oper return 0; } +static int translate_eth_ext_proto_oper(u32 eth_proto_oper, u8 *active_speed, + u8 *active_width) +{ + switch (eth_proto_oper) { + case MLX5E_PROT_MASK(MLX5E_SGMII_100M): + case MLX5E_PROT_MASK(MLX5E_1000BASE_X_SGMII): + *active_width = IB_WIDTH_1X; + *active_speed = IB_SPEED_SDR; + break; + case MLX5E_PROT_MASK(MLX5E_5GBASE_R): + *active_width = IB_WIDTH_1X; + *active_speed = IB_SPEED_DDR; + break; + case MLX5E_PROT_MASK(MLX5E_10GBASE_XFI_XAUI_1): + *active_width = IB_WIDTH_1X; + *active_speed = IB_SPEED_QDR; + break; + case MLX5E_PROT_MASK(MLX5E_40GBASE_XLAUI_4_XLPPI_4): + *active_width = IB_WIDTH_4X; + *active_speed = IB_SPEED_QDR; + break; + case MLX5E_PROT_MASK(MLX5E_25GAUI_1_25GBASE_CR_KR): + *active_width = IB_WIDTH_1X; + *active_speed = IB_SPEED_EDR; + break; + case MLX5E_PROT_MASK(MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2): + *active_width = IB_WIDTH_2X; + *active_speed = IB_SPEED_EDR; + break; + case MLX5E_PROT_MASK(MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR): + *active_width = IB_WIDTH_1X; + *active_speed = IB_SPEED_HDR; + break; + case MLX5E_PROT_MASK(MLX5E_CAUI_4_100GBASE_CR4_KR4): + *active_width = IB_WIDTH_4X; + *active_speed = IB_SPEED_EDR; + break; + case MLX5E_PROT_MASK(MLX5E_100GAUI_2_100GBASE_CR2_KR2): + *active_width = IB_WIDTH_2X; + *active_speed = IB_SPEED_HDR; + break; + case MLX5E_PROT_MASK(MLX5E_200GAUI_4_200GBASE_CR4_KR4): + *active_width = IB_WIDTH_4X; + *active_speed = IB_SPEED_HDR; + break; + default: + *active_width = IB_WIDTH_4X; + *active_speed = IB_SPEED_QDR; + return -EINVAL; + } + + return 0; +} + static int mlx5_query_port_roce(struct ib_device *device, u8 port_num, struct ib_port_attr *props) { struct mlx5_ib_dev *dev = to_mdev(device); + u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {}; struct net_device *ndev; enum ib_mtu ndev_ib_mtu; u16 qkey_viol_cntr; u32 eth_prot_oper; + bool ext; int err; memset(props, 0, sizeof(*props)); @@ -238,13 +294,21 @@ static int mlx5_query_port_roce(struct ib_device *devi /* Possible bad flows are checked before filling out props so in case * of an error it will still be zeroed out. */ - err = mlx5_query_port_eth_proto_oper(dev->mdev, ð_prot_oper, port_num); + err = mlx5_query_port_ptys(dev->mdev, out, sizeof(out), MLX5_PTYS_EN, + port_num); if (err) return err; - translate_eth_proto_oper(eth_prot_oper, &props->active_speed, - &props->active_width); + ext = MLX5_CAP_PCAM_FEATURE(dev->mdev, ptys_extended_ethernet); + eth_prot_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_oper); + if (ext) + translate_eth_ext_proto_oper(eth_prot_oper, &props->active_speed, + &props->active_width); + else + translate_eth_proto_oper(eth_prot_oper, &props->active_speed, + &props->active_width); + props->port_cap_flags |= IB_PORT_CM_SUP; props->port_cap_flags |= IB_PORT_IP_BASED_GIDS; @@ -772,9 +836,7 @@ static int translate_active_width(struct ib_device *ib if (active_width & MLX5_IB_WIDTH_1X) { *ib_width = IB_WIDTH_1X; } else if (active_width & MLX5_IB_WIDTH_2X) { - mlx5_ib_dbg(dev, "active_width %d is not supported by IB spec\n", - (int)active_width); - err = -EINVAL; + *ib_width = IB_WIDTH_2X; } else if (active_width & MLX5_IB_WIDTH_4X) { *ib_width = IB_WIDTH_4X; } else if (active_width & MLX5_IB_WIDTH_8X) { Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Wed May 8 10:56:22 2019 (r347302) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Wed May 8 10:56:51 2019 (r347303) @@ -2125,7 +2125,7 @@ static int ib_rate_to_mlx5(struct mlx5_ib_dev *dev, u8 { if (rate == IB_RATE_PORT_CURRENT) { return 0; - } else if (rate < IB_RATE_2_5_GBPS || rate > IB_RATE_300_GBPS) { + } else if (rate < IB_RATE_2_5_GBPS || rate > IB_RATE_600_GBPS) { return -EINVAL; } else { while (rate != IB_RATE_2_5_GBPS && From owner-svn-src-all@freebsd.org Wed May 8 10:57:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D38215A6468; Wed, 8 May 2019 10:57:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 120A16C170; Wed, 8 May 2019 10:57:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E15D94DB6; Wed, 8 May 2019 10:57:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AvGgS057691; Wed, 8 May 2019 10:57:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AvGg9057690; Wed, 8 May 2019 10:57:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081057.x48AvGg9057690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347304 - head/sys/dev/mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 347304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 120A16C170 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:57:17 -0000 Author: hselasky Date: Wed May 8 10:57:16 2019 New Revision: 347304 URL: https://svnweb.freebsd.org/changeset/base/347304 Log: Always return success for RoCE modify port in mlx5ib. CM layer calls ib_modify_port() regardless of the link layer. For the Ethernet ports, qkey violation and Port capabilities are meaningless. Therefore, always return success for ib_modify_port calls on the Ethernet ports. Linux Commit: ec2558796d25e6024071b6bcb8e11392538d57bf Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 10:56:51 2019 (r347303) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 10:57:16 2019 (r347304) @@ -1078,6 +1078,14 @@ static int mlx5_ib_modify_port(struct ib_device *ibdev u32 tmp; int err; + /* + * CM layer calls ib_modify_port() regardless of the link + * layer. For Ethernet ports, qkey violation and Port + * capabilities are meaningless. + */ + if (mlx5_ib_port_link_layer(ibdev, port) == IB_LINK_LAYER_ETHERNET) + return 0; + mutex_lock(&dev->cap_mask_mutex); err = mlx5_ib_query_port(ibdev, port, &attr); From owner-svn-src-all@freebsd.org Wed May 8 10:57:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA46B15A64DC; Wed, 8 May 2019 10:57:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70E406C2BD; Wed, 8 May 2019 10:57:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C2834DB7; Wed, 8 May 2019 10:57:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AvcGH057758; Wed, 8 May 2019 10:57:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AvbMg057755; Wed, 8 May 2019 10:57:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081057.x48AvbMg057755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347305 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 347305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 70E406C2BD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:57:39 -0000 Author: hselasky Date: Wed May 8 10:57:37 2019 New Revision: 347305 URL: https://svnweb.freebsd.org/changeset/base/347305 Log: Move workqueue from mlx5en(4) to mlx5core. This avoids creating more workqueues in mlx5core to do simple firmware command polling tasks. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_health.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 10:57:16 2019 (r347304) +++ head/sys/dev/mlx5/driver.h Wed May 8 10:57:37 2019 (r347305) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2019, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -505,6 +505,7 @@ struct mlx5_core_health { u32 prev; int miss_counter; u32 fatal_error; + struct workqueue_struct *wq_watchdog; /* wq spinlock to synchronize draining */ spinlock_t wq_lock; struct workqueue_struct *wq; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 10:57:16 2019 (r347304) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 10:57:37 2019 (r347305) @@ -604,26 +604,27 @@ void mlx5_health_cleanup(struct mlx5_core_dev *dev) struct mlx5_core_health *health = &dev->priv.health; destroy_workqueue(health->wq); + destroy_workqueue(health->wq_watchdog); } -#define HEALTH_NAME "mlx5_health" int mlx5_health_init(struct mlx5_core_dev *dev) { struct mlx5_core_health *health; - char *name; - int len; + char name[64]; health = &dev->priv.health; - len = strlen(HEALTH_NAME) + strlen(dev_name(&dev->pdev->dev)); - name = kmalloc(len + 1, GFP_KERNEL); - if (!name) - return -ENOMEM; - snprintf(name, len, "%s:%s", HEALTH_NAME, dev_name(&dev->pdev->dev)); + snprintf(name, sizeof(name), "%s-rec", dev_name(&dev->pdev->dev)); health->wq = create_singlethread_workqueue(name); - kfree(name); if (!health->wq) return -ENOMEM; + + snprintf(name, sizeof(name), "%s-wdg", dev_name(&dev->pdev->dev)); + health->wq_watchdog = create_singlethread_workqueue(name); + if (!health->wq_watchdog) { + destroy_workqueue(health->wq); + return -ENOMEM; + } spin_lock_init(&health->wq_lock); INIT_WORK(&health->work, health_care); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:57:16 2019 (r347304) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:57:37 2019 (r347305) @@ -4134,13 +4134,8 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) goto err_free_sysctl; } - snprintf(unit, sizeof(unit), "mce%u_wq", - device_get_unit(mdev->pdev->dev.bsddev)); - priv->wq = alloc_workqueue(unit, 0, 1); - if (priv->wq == NULL) { - if_printf(ifp, "%s: alloc_workqueue failed\n", __func__); - goto err_free_sysctl; - } + /* reuse mlx5core's watchdog workqueue */ + priv->wq = mdev->priv.health.wq_watchdog; err = mlx5_alloc_map_uar(mdev, &priv->cq_uar); if (err) { @@ -4297,7 +4292,7 @@ err_unmap_free_uar: mlx5_unmap_free_uar(mdev, &priv->cq_uar); err_free_wq: - destroy_workqueue(priv->wq); + flush_workqueue(priv->wq); err_free_sysctl: sysctl_ctx_free(&priv->sysctl_ctx); @@ -4383,7 +4378,7 @@ mlx5e_destroy_ifp(struct mlx5_core_dev *mdev, void *vp mlx5_core_dealloc_pd(priv->mdev, priv->pdn); mlx5_unmap_free_uar(priv->mdev, &priv->cq_uar); mlx5e_disable_async_events(priv); - destroy_workqueue(priv->wq); + flush_workqueue(priv->wq); mlx5e_priv_mtx_destroy(priv); free(priv, M_MLX5EN); } From owner-svn-src-all@freebsd.org Wed May 8 10:58:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA5D215A65A5; Wed, 8 May 2019 10:58:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FAED6C451; Wed, 8 May 2019 10:58:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A34A4DB8; Wed, 8 May 2019 10:58:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Aw8VL057835; Wed, 8 May 2019 10:58:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Aw60Z057829; Wed, 8 May 2019 10:58:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081058.x48Aw60Z057829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347306 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6FAED6C451 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:58:09 -0000 Author: hselasky Date: Wed May 8 10:58:06 2019 New Revision: 347306 URL: https://svnweb.freebsd.org/changeset/base/347306 Log: Implement reading PCI power status in mlx5core. Implement a watchdog as part of the healtcare subsystem which reads the PCI power status during startup and upon the PCI power status change event and store it into the core device structure. This value is then exported to user-space via a read-only SYSCTL. A dmesg print has been added to inform the admin about the PCI power status. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_health.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed May 8 10:57:37 2019 (r347305) +++ head/sys/dev/mlx5/device.h Wed May 8 10:58:06 2019 (r347306) @@ -1215,6 +1215,7 @@ static inline int mlx5_get_cqe_format(const struct mlx enum { MLX5_GEN_EVENT_SUBTYPE_DELAY_DROP_TIMEOUT = 0x1, + MLX5_GEN_EVENT_SUBTYPE_PCI_POWER_CHANGE_EVENT = 0x5, }; /* 8 regular priorities + 1 for multicast */ Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 10:57:37 2019 (r347305) +++ head/sys/dev/mlx5/driver.h Wed May 8 10:58:06 2019 (r347306) @@ -506,6 +506,7 @@ struct mlx5_core_health { int miss_counter; u32 fatal_error; struct workqueue_struct *wq_watchdog; + struct work_struct work_watchdog; /* wq spinlock to synchronize draining */ spinlock_t wq_lock; struct workqueue_struct *wq; @@ -705,6 +706,8 @@ struct mlx5_core_dev { struct sysctl_ctx_list sysctl_ctx; int msix_eqvec; + int pwr_status; + int pwr_value; struct { struct mlx5_rsvd_gids reserved_gids; @@ -955,6 +958,7 @@ void mlx5_stop_health_poll(struct mlx5_core_dev *dev, void mlx5_drain_health_wq(struct mlx5_core_dev *dev); void mlx5_drain_health_recovery(struct mlx5_core_dev *dev); void mlx5_trigger_health_work(struct mlx5_core_dev *dev); +void mlx5_trigger_health_watchdog(struct mlx5_core_dev *dev); #define mlx5_buf_alloc_node(dev, size, direct, buf, node) \ mlx5_buf_alloc(dev, size, direct, buf) @@ -1089,6 +1093,8 @@ int mlx5_vsc_write(struct mlx5_core_dev *mdev, u32 add int mlx5_vsc_read(struct mlx5_core_dev *mdev, u32 addr, u32 *data); int mlx5_vsc_lock_addr_space(struct mlx5_core_dev *mdev, u32 addr); int mlx5_vsc_unlock_addr_space(struct mlx5_core_dev *mdev, u32 addr); +int mlx5_pci_read_power_status(struct mlx5_core_dev *mdev, + u16 *p_power, u8 *p_status); static inline u32 mlx5_mkey_to_idx(u32 mkey) { Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 8 10:57:37 2019 (r347305) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 8 10:58:06 2019 (r347306) @@ -561,6 +561,11 @@ int mlx5_start_eqs(struct mlx5_core_dev *dev) if (MLX5_CAP_GEN(dev, temp_warn_event)) async_event_mask |= (1ull << MLX5_EVENT_TYPE_TEMP_WARN_EVENT); + if (MLX5_CAP_GEN(dev, general_notification_event)) { + async_event_mask |= (1ull << + MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT); + } + err = mlx5_create_map_eq(dev, &table->cmd_eq, MLX5_EQ_VEC_CMD, MLX5_NUM_CMD_EQE, 1ull << MLX5_EVENT_TYPE_CMD, "mlx5_cmd_eq", &dev->priv.uuari.uars[0]); @@ -716,14 +721,17 @@ static void mlx5_port_general_notification_event(struc struct mlx5_eqe *eqe) { u8 port = (eqe->data.port.port >> 4) & 0xf; - u32 rqn = 0; - struct mlx5_eqe_general_notification_event *general_event = NULL; + u32 rqn; + struct mlx5_eqe_general_notification_event *general_event; switch (eqe->sub_type) { case MLX5_GEN_EVENT_SUBTYPE_DELAY_DROP_TIMEOUT: general_event = &eqe->data.general_notifications; rqn = be32_to_cpu(general_event->rq_user_index_delay_drop) & 0xffffff; + break; + case MLX5_GEN_EVENT_SUBTYPE_PCI_POWER_CHANGE_EVENT: + mlx5_trigger_health_watchdog(dev); break; default: mlx5_core_warn(dev, Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 10:57:37 2019 (r347305) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 10:58:06 2019 (r347306) @@ -41,6 +41,7 @@ enum { MLX5_DROP_NEW_HEALTH_WORK, MLX5_DROP_NEW_RECOVERY_WORK, + MLX5_DROP_NEW_WATCHDOG_WORK, }; enum { @@ -506,6 +507,66 @@ static void print_health_info(struct mlx5_core_dev *de printf("mlx5_core: INFO: ""raw fw_ver 0x%08x\n", fw); } +static void health_watchdog(struct work_struct *work) +{ + struct mlx5_core_dev *dev; + u16 power; + u8 status; + int err; + + dev = container_of(work, struct mlx5_core_dev, priv.health.work_watchdog); + + if (!MLX5_CAP_GEN(dev, mcam_reg) || + !MLX5_CAP_MCAM_FEATURE(dev, pcie_status_and_power)) + return; + + err = mlx5_pci_read_power_status(dev, &power, &status); + if (err < 0) { + mlx5_core_warn(dev, "Failed reading power status: %d\n", err); + return; + } + + dev->pwr_value = power; + + if (dev->pwr_status != status) { + device_t bsddev = dev->pdev->dev.bsddev; + + switch (status) { + case 0: + dev->pwr_status = status; + device_printf(bsddev, "PCI power is not published by the PCIe slot.\n"); + break; + case 1: + dev->pwr_status = status; + device_printf(bsddev, "PCIe slot advertised sufficient power (%uW).\n", power); + break; + case 2: + dev->pwr_status = status; + device_printf(bsddev, "WARN: Detected insufficient power on the PCIe slot (%uW).\n", power); + break; + default: + dev->pwr_status = 0; + device_printf(bsddev, "WARN: Unknown power state detected(%d).\n", status); + break; + } + } +} + +void +mlx5_trigger_health_watchdog(struct mlx5_core_dev *dev) +{ + struct mlx5_core_health *health = &dev->priv.health; + unsigned long flags; + + spin_lock_irqsave(&health->wq_lock, flags); + if (!test_bit(MLX5_DROP_NEW_WATCHDOG_WORK, &health->flags)) + queue_work(health->wq_watchdog, &health->work_watchdog); + else + dev_err(&dev->pdev->dev, + "scheduling watchdog is not permitted at this stage\n"); + spin_unlock_irqrestore(&health->wq_lock, flags); +} + static void poll_health(unsigned long data) { struct mlx5_core_dev *dev = (struct mlx5_core_dev *)data; @@ -516,9 +577,6 @@ static void poll_health(unsigned long data) if (dev->state != MLX5_DEVICE_STATE_UP) return; - if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) - goto out; - count = ioread32be(health->health_counter); if (count == health->prev) ++health->miss_counter; @@ -540,7 +598,6 @@ static void poll_health(unsigned long data) mlx5_trigger_health_work(dev); } -out: mod_timer(&health->timer, get_next_poll_jiffies()); } @@ -552,12 +609,16 @@ void mlx5_start_health_poll(struct mlx5_core_dev *dev) health->fatal_error = MLX5_SENSOR_NO_ERR; clear_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags); clear_bit(MLX5_DROP_NEW_RECOVERY_WORK, &health->flags); + clear_bit(MLX5_DROP_NEW_WATCHDOG_WORK, &health->flags); health->health = &dev->iseg->health; health->health_counter = &dev->iseg->health_counter; setup_timer(&health->timer, poll_health, (unsigned long)dev); mod_timer(&health->timer, round_jiffies(jiffies + MLX5_HEALTH_POLL_INTERVAL)); + + /* do initial PCI power state readout */ + mlx5_trigger_health_watchdog(dev); } void mlx5_stop_health_poll(struct mlx5_core_dev *dev, bool disable_health) @@ -569,6 +630,7 @@ void mlx5_stop_health_poll(struct mlx5_core_dev *dev, spin_lock_irqsave(&health->wq_lock, flags); set_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags); set_bit(MLX5_DROP_NEW_RECOVERY_WORK, &health->flags); + set_bit(MLX5_DROP_NEW_WATCHDOG_WORK, &health->flags); spin_unlock_irqrestore(&health->wq_lock, flags); } @@ -583,9 +645,11 @@ void mlx5_drain_health_wq(struct mlx5_core_dev *dev) spin_lock_irqsave(&health->wq_lock, flags); set_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags); set_bit(MLX5_DROP_NEW_RECOVERY_WORK, &health->flags); + set_bit(MLX5_DROP_NEW_WATCHDOG_WORK, &health->flags); spin_unlock_irqrestore(&health->wq_lock, flags); cancel_delayed_work_sync(&health->recover_work); cancel_work_sync(&health->work); + cancel_work_sync(&health->work_watchdog); } void mlx5_drain_health_recovery(struct mlx5_core_dev *dev) @@ -628,6 +692,7 @@ int mlx5_health_init(struct mlx5_core_dev *dev) spin_lock_init(&health->wq_lock); INIT_WORK(&health->work, health_care); + INIT_WORK(&health->work_watchdog, health_watchdog); INIT_DELAYED_WORK(&health->recover_work, health_recover); return 0; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:57:37 2019 (r347305) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 10:58:06 2019 (r347306) @@ -197,6 +197,21 @@ static int set_dma_caps(struct pci_dev *pdev) return err; } +int mlx5_pci_read_power_status(struct mlx5_core_dev *dev, + u16 *p_power, u8 *p_status) +{ + u32 in[MLX5_ST_SZ_DW(mpein_reg)] = {}; + u32 out[MLX5_ST_SZ_DW(mpein_reg)] = {}; + int err; + + err = mlx5_core_access_reg(dev, in, sizeof(in), out, sizeof(out), + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MPEIN, 0, 0); + + *p_status = MLX5_GET(mpein_reg, out, pwr_status); + *p_power = MLX5_GET(mpein_reg, out, pci_power); + return err; +} + static int mlx5_pci_enable_device(struct mlx5_core_dev *dev) { struct pci_dev *pdev = dev->pdev; @@ -1273,6 +1288,14 @@ static int init_one(struct pci_dev *pdev, SYSCTL_CHILDREN(device_get_sysctl_tree(bsddev)), OID_AUTO, "msix_eqvec", CTLFLAG_RDTUN, &dev->msix_eqvec, 0, "Maximum number of MSIX event queue vectors, if set"); + SYSCTL_ADD_INT(&dev->sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(bsddev)), + OID_AUTO, "power_status", CTLFLAG_RD, &dev->pwr_status, 0, + "0:Invalid 1:Sufficient 2:Insufficient"); + SYSCTL_ADD_INT(&dev->sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(bsddev)), + OID_AUTO, "power_value", CTLFLAG_RD, &dev->pwr_value, 0, + "Current power value in Watts"); INIT_LIST_HEAD(&priv->ctx_list); spin_lock_init(&priv->ctx_lock); Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:57:37 2019 (r347305) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:58:06 2019 (r347306) @@ -8640,8 +8640,9 @@ struct mlx5_ifc_pcam_reg_bits { }; struct mlx5_ifc_mcam_enhanced_features_bits { - u8 reserved_at_0[0x7f]; - + u8 reserved_at_0[0x6e]; + u8 pcie_status_and_power[0x1]; + u8 reserved_at_111[0x10]; u8 pcie_performance_group[0x1]; }; @@ -9998,6 +9999,91 @@ struct mlx5_ifc_mpcnt_reg_bits { u8 reserved_2[0x1f]; union mlx5_ifc_mpcnt_cntrs_grp_data_layout_bits counter_set; +}; + +enum { + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MPEIN = 0x9050, + MLX5_MPEIN_PWR_STATUS_INVALID = 0, + MLX5_MPEIN_PWR_STATUS_SUFFICIENT = 1, + MLX5_MPEIN_PWR_STATUS_INSUFFICIENT = 2, +}; + +struct mlx5_ifc_mpein_reg_bits { + u8 reserved_at_0[0x2]; + u8 depth[0x6]; + u8 pcie_index[0x8]; + u8 node[0x8]; + u8 reserved_at_18[0x8]; + + u8 capability_mask[0x20]; + + u8 reserved_at_40[0x8]; + u8 link_width_enabled[0x8]; + u8 link_speed_enabled[0x10]; + + u8 lane0_physical_position[0x8]; + u8 link_width_active[0x8]; + u8 link_speed_active[0x10]; + + u8 num_of_pfs[0x10]; + u8 num_of_vfs[0x10]; + + u8 bdf0[0x10]; + u8 reserved_at_b0[0x10]; + + u8 max_read_request_size[0x4]; + u8 max_payload_size[0x4]; + u8 reserved_at_c8[0x5]; + u8 pwr_status[0x3]; + u8 port_type[0x4]; + u8 reserved_at_d4[0xb]; + u8 lane_reversal[0x1]; + + u8 reserved_at_e0[0x14]; + u8 pci_power[0xc]; + + u8 reserved_at_100[0x20]; + + u8 device_status[0x10]; + u8 port_state[0x8]; + u8 reserved_at_138[0x8]; + + u8 reserved_at_140[0x10]; + u8 receiver_detect_result[0x10]; + + u8 reserved_at_160[0x20]; +}; + +struct mlx5_ifc_mpein_reg_ext_bits { + u8 reserved_at_0[0x2]; + u8 depth[0x6]; + u8 pcie_index[0x8]; + u8 node[0x8]; + u8 reserved_at_18[0x8]; + + u8 reserved_at_20[0x20]; + + u8 reserved_at_40[0x8]; + u8 link_width_enabled[0x8]; + u8 link_speed_enabled[0x10]; + + u8 lane0_physical_position[0x8]; + u8 link_width_active[0x8]; + u8 link_speed_active[0x10]; + + u8 num_of_pfs[0x10]; + u8 num_of_vfs[0x10]; + + u8 bdf0[0x10]; + u8 reserved_at_b0[0x10]; + + u8 max_read_request_size[0x4]; + u8 max_payload_size[0x4]; + u8 reserved_at_c8[0x5]; + u8 pwr_status[0x3]; + u8 port_type[0x4]; + u8 reserved_at_d4[0xb]; + u8 lane_reversal[0x1]; }; struct mlx5_ifc_mcqi_cap_bits { From owner-svn-src-all@freebsd.org Wed May 8 10:58:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A46CF15A665C; Wed, 8 May 2019 10:58:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C4C06C5ED; Wed, 8 May 2019 10:58:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCBAD4DB9; Wed, 8 May 2019 10:58:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AwfBd057911; Wed, 8 May 2019 10:58:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AwfMp057908; Wed, 8 May 2019 10:58:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081058.x48AwfMp057908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347307 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C4C06C5ED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:58:42 -0000 Author: hselasky Date: Wed May 8 10:58:41 2019 New Revision: 347307 URL: https://svnweb.freebsd.org/changeset/base/347307 Log: Update performance counter bits in mlx5core. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Wed May 8 10:58:06 2019 (r347306) +++ head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Wed May 8 10:58:41 2019 (r347307) @@ -231,13 +231,13 @@ int mlx5_core_get_diagnostics_full(struct mlx5_core_de MLX5_REG_MPCNT, 0, 0); if (err == 0) { void *pcounters = MLX5_ADDR_OF(mpcnt_reg, out, - counter_set.pcie_performance_counters_data_layout); + counter_set.pcie_perf_counters); pdiag->counter.rx_pci_errors = - MLX5_GET(pcie_performance_counters_data_layout, + MLX5_GET(pcie_perf_counters, pcounters, rx_errors); pdiag->counter.tx_pci_errors = - MLX5_GET(pcie_performance_counters_data_layout, + MLX5_GET(pcie_perf_counters, pcounters, tx_errors); } MLX5_SET(mpcnt_reg, in, grp, @@ -247,13 +247,13 @@ int mlx5_core_get_diagnostics_full(struct mlx5_core_de MLX5_REG_MPCNT, 0, 0); if (err == 0) { void *pcounters = MLX5_ADDR_OF(mpcnt_reg, out, - counter_set.pcie_timers_and_states_data_layout); + counter_set.pcie_timers_states); pdiag->counter.tx_pci_non_fatal_errors = - MLX5_GET(pcie_timers_and_states_data_layout, + MLX5_GET(pcie_timers_states, pcounters, non_fatal_err_msg_sent); pdiag->counter.tx_pci_fatal_errors = - MLX5_GET(pcie_timers_and_states_data_layout, + MLX5_GET(pcie_timers_states, pcounters, fatal_err_msg_sent); } kvfree(in); Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:58:06 2019 (r347306) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 10:58:41 2019 (r347307) @@ -9868,11 +9868,89 @@ struct mlx5_ifc_ppcnt_reg_bits { union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits counter_set; }; -struct mlx5_ifc_pcie_performance_counters_data_layout_bits { +struct mlx5_ifc_pcie_lanes_counters_bits { u8 life_time_counter_high[0x20]; u8 life_time_counter_low[0x20]; + u8 error_counter_lane0[0x20]; + + u8 error_counter_lane1[0x20]; + + u8 error_counter_lane2[0x20]; + + u8 error_counter_lane3[0x20]; + + u8 error_counter_lane4[0x20]; + + u8 error_counter_lane5[0x20]; + + u8 error_counter_lane6[0x20]; + + u8 error_counter_lane7[0x20]; + + u8 error_counter_lane8[0x20]; + + u8 error_counter_lane9[0x20]; + + u8 error_counter_lane10[0x20]; + + u8 error_counter_lane11[0x20]; + + u8 error_counter_lane12[0x20]; + + u8 error_counter_lane13[0x20]; + + u8 error_counter_lane14[0x20]; + + u8 error_counter_lane15[0x20]; + + u8 reserved_at_240[0x580]; +}; + +struct mlx5_ifc_pcie_lanes_counters_ext_bits { + u8 reserved_at_0[0x40]; + + u8 error_counter_lane0[0x20]; + + u8 error_counter_lane1[0x20]; + + u8 error_counter_lane2[0x20]; + + u8 error_counter_lane3[0x20]; + + u8 error_counter_lane4[0x20]; + + u8 error_counter_lane5[0x20]; + + u8 error_counter_lane6[0x20]; + + u8 error_counter_lane7[0x20]; + + u8 error_counter_lane8[0x20]; + + u8 error_counter_lane9[0x20]; + + u8 error_counter_lane10[0x20]; + + u8 error_counter_lane11[0x20]; + + u8 error_counter_lane12[0x20]; + + u8 error_counter_lane13[0x20]; + + u8 error_counter_lane14[0x20]; + + u8 error_counter_lane15[0x20]; + + u8 reserved_at_240[0x580]; +}; + +struct mlx5_ifc_pcie_perf_counters_bits { + u8 life_time_counter_high[0x20]; + + u8 life_time_counter_low[0x20]; + u8 rx_errors[0x20]; u8 tx_errors[0x20]; @@ -9889,10 +9967,46 @@ struct mlx5_ifc_pcie_performance_counters_data_layout_ u8 crc_error_tlp[0x20]; - u8 reserved_0[0x680]; + u8 tx_overflow_buffer_pkt[0x40]; + + u8 outbound_stalled_reads[0x20]; + + u8 outbound_stalled_writes[0x20]; + + u8 outbound_stalled_reads_events[0x20]; + + u8 outbound_stalled_writes_events[0x20]; + + u8 tx_overflow_buffer_marked_pkt[0x40]; + + u8 reserved_at_240[0x580]; }; -struct mlx5_ifc_pcie_timers_and_states_data_layout_bits { +struct mlx5_ifc_pcie_perf_counters_ext_bits { + u8 reserved_at_0[0x40]; + + u8 rx_errors[0x20]; + + u8 tx_errors[0x20]; + + u8 reserved_at_80[0xc0]; + + u8 tx_overflow_buffer_pkt[0x40]; + + u8 outbound_stalled_reads[0x20]; + + u8 outbound_stalled_writes[0x20]; + + u8 outbound_stalled_reads_events[0x20]; + + u8 outbound_stalled_writes_events[0x20]; + + u8 tx_overflow_buffer_marked_pkt[0x40]; + + u8 reserved_at_240[0x580]; +}; + +struct mlx5_ifc_pcie_timers_states_bits { u8 life_time_counter_high[0x20]; u8 life_time_counter_low[0x20]; @@ -9939,66 +10053,97 @@ struct mlx5_ifc_pcie_timers_and_states_data_layout_bit u8 fatal_err_msg_sent[0x20]; - u8 reserved_0[0x4e0]; + u8 reserved_at_2e0[0x4e0]; }; -struct mlx5_ifc_pcie_lanes_counters_data_layout_bits { - u8 life_time_counter_high[0x20]; +struct mlx5_ifc_pcie_timers_states_ext_bits { + u8 reserved_at_0[0x40]; - u8 life_time_counter_low[0x20]; + u8 time_to_boot_image_start[0x20]; - u8 error_counter_lane0[0x20]; + u8 time_to_link_image[0x20]; - u8 error_counter_lane1[0x20]; + u8 calibration_time[0x20]; - u8 error_counter_lane2[0x20]; + u8 time_to_first_perst[0x20]; - u8 error_counter_lane3[0x20]; + u8 time_to_detect_state[0x20]; - u8 error_counter_lane4[0x20]; + u8 time_to_l0[0x20]; - u8 error_counter_lane5[0x20]; + u8 time_to_crs_en[0x20]; - u8 error_counter_lane6[0x20]; + u8 time_to_plastic_image_start[0x20]; - u8 error_counter_lane7[0x20]; + u8 time_to_iron_image_start[0x20]; - u8 error_counter_lane8[0x20]; + u8 perst_handler[0x20]; - u8 error_counter_lane9[0x20]; + u8 times_in_l1[0x20]; - u8 error_counter_lane10[0x20]; + u8 times_in_l23[0x20]; - u8 error_counter_lane11[0x20]; + u8 dl_down[0x20]; - u8 error_counter_lane12[0x20]; + u8 config_cycle1usec[0x20]; - u8 error_counter_lane13[0x20]; + u8 config_cycle2to7usec[0x20]; - u8 error_counter_lane14[0x20]; + u8 config_cycle8to15usec[0x20]; - u8 error_counter_lane15[0x20]; + u8 config_cycle16to63usec[0x20]; - u8 reserved_0[0x580]; + u8 config_cycle64usec[0x20]; + + u8 correctable_err_msg_sent[0x20]; + + u8 non_fatal_err_msg_sent[0x20]; + + u8 fatal_err_msg_sent[0x20]; + + u8 reserved_at_2e0[0x4e0]; }; -union mlx5_ifc_mpcnt_cntrs_grp_data_layout_bits { - struct mlx5_ifc_pcie_performance_counters_data_layout_bits pcie_performance_counters_data_layout; - struct mlx5_ifc_pcie_timers_and_states_data_layout_bits pcie_timers_and_states_data_layout; - struct mlx5_ifc_pcie_lanes_counters_data_layout_bits pcie_lanes_counters_data_layout; - u8 reserved_0[0xf8]; +union mlx5_ifc_mpcnt_reg_counter_set_auto_bits { + struct mlx5_ifc_pcie_perf_counters_bits pcie_perf_counters; + struct mlx5_ifc_pcie_lanes_counters_bits pcie_lanes_counters; + struct mlx5_ifc_pcie_timers_states_bits pcie_timers_states; + u8 reserved_at_0[0x7c0]; }; +union mlx5_ifc_mpcnt_reg_counter_set_auto_ext_bits { + struct mlx5_ifc_pcie_perf_counters_ext_bits pcie_perf_counters_ext; + struct mlx5_ifc_pcie_lanes_counters_ext_bits pcie_lanes_counters_ext; + struct mlx5_ifc_pcie_timers_states_ext_bits pcie_timers_states_ext; + u8 reserved_at_0[0x7c0]; +}; + struct mlx5_ifc_mpcnt_reg_bits { - u8 reserved_0[0x8]; + u8 reserved_at_0[0x2]; + u8 depth[0x6]; u8 pcie_index[0x8]; - u8 reserved_1[0xa]; + u8 node[0x8]; + u8 reserved_at_18[0x2]; u8 grp[0x6]; u8 clr[0x1]; - u8 reserved_2[0x1f]; + u8 reserved_at_21[0x1f]; - union mlx5_ifc_mpcnt_cntrs_grp_data_layout_bits counter_set; + union mlx5_ifc_mpcnt_reg_counter_set_auto_bits counter_set; +}; + +struct mlx5_ifc_mpcnt_reg_ext_bits { + u8 reserved_at_0[0x2]; + u8 depth[0x6]; + u8 pcie_index[0x8]; + u8 node[0x8]; + u8 reserved_at_18[0x2]; + u8 grp[0x6]; + + u8 clr[0x1]; + u8 reserved_at_21[0x1f]; + + union mlx5_ifc_mpcnt_reg_counter_set_auto_ext_bits counter_set; }; enum { From owner-svn-src-all@freebsd.org Wed May 8 10:59:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E6415A66F6; Wed, 8 May 2019 10:59:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C0D16C762; Wed, 8 May 2019 10:59:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66AFB4DBA; Wed, 8 May 2019 10:59:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48AxHIK057989; Wed, 8 May 2019 10:59:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48AxHYV057987; Wed, 8 May 2019 10:59:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081059.x48AxHYV057987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 10:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347308 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8C0D16C762 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 10:59:18 -0000 Author: hselasky Date: Wed May 8 10:59:16 2019 New Revision: 347308 URL: https://svnweb.freebsd.org/changeset/base/347308 Log: Extend the counters framework in mlx5en(4). Allow more macro arguments and split the variable type and name into separate arguments. This allows simple and powerful copy and extraction of values from IFC based structures into SYSCTLs with the use of a single macro. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/en_rl.h Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:58:41 2019 (r347307) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:59:16 2019 (r347308) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved. + * Copyright (c) 2015-2019 Mellanox Technologies. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -147,48 +147,48 @@ struct mlx5e_cq; typedef void (mlx5e_cq_comp_t)(struct mlx5_core_cq *); -#define MLX5E_STATS_COUNT(a,b,c,d) a -#define MLX5E_STATS_VAR(a,b,c,d) b; -#define MLX5E_STATS_DESC(a,b,c,d) c, d, +#define MLX5E_STATS_COUNT(a, ...) a +#define MLX5E_STATS_VAR(a, b, c, ...) b c; +#define MLX5E_STATS_DESC(a, b, c, d, e, ...) d, e, #define MLX5E_VPORT_STATS(m) \ /* HW counters */ \ - m(+1, u64 rx_packets, "rx_packets", "Received packets") \ - m(+1, u64 rx_bytes, "rx_bytes", "Received bytes") \ - m(+1, u64 tx_packets, "tx_packets", "Transmitted packets") \ - m(+1, u64 tx_bytes, "tx_bytes", "Transmitted bytes") \ - m(+1, u64 rx_error_packets, "rx_error_packets", "Received error packets") \ - m(+1, u64 rx_error_bytes, "rx_error_bytes", "Received error bytes") \ - m(+1, u64 tx_error_packets, "tx_error_packets", "Transmitted error packets") \ - m(+1, u64 tx_error_bytes, "tx_error_bytes", "Transmitted error bytes") \ - m(+1, u64 rx_unicast_packets, "rx_unicast_packets", "Received unicast packets") \ - m(+1, u64 rx_unicast_bytes, "rx_unicast_bytes", "Received unicast bytes") \ - m(+1, u64 tx_unicast_packets, "tx_unicast_packets", "Transmitted unicast packets") \ - m(+1, u64 tx_unicast_bytes, "tx_unicast_bytes", "Transmitted unicast bytes") \ - m(+1, u64 rx_multicast_packets, "rx_multicast_packets", "Received multicast packets") \ - m(+1, u64 rx_multicast_bytes, "rx_multicast_bytes", "Received multicast bytes") \ - m(+1, u64 tx_multicast_packets, "tx_multicast_packets", "Transmitted multicast packets") \ - m(+1, u64 tx_multicast_bytes, "tx_multicast_bytes", "Transmitted multicast bytes") \ - m(+1, u64 rx_broadcast_packets, "rx_broadcast_packets", "Received broadcast packets") \ - m(+1, u64 rx_broadcast_bytes, "rx_broadcast_bytes", "Received broadcast bytes") \ - m(+1, u64 tx_broadcast_packets, "tx_broadcast_packets", "Transmitted broadcast packets") \ - m(+1, u64 tx_broadcast_bytes, "tx_broadcast_bytes", "Transmitted broadcast bytes") \ - m(+1, u64 rx_out_of_buffer, "rx_out_of_buffer", "Receive out of buffer, no recv wqes events") \ + m(+1, u64, rx_packets, "rx_packets", "Received packets") \ + m(+1, u64, rx_bytes, "rx_bytes", "Received bytes") \ + m(+1, u64, tx_packets, "tx_packets", "Transmitted packets") \ + m(+1, u64, tx_bytes, "tx_bytes", "Transmitted bytes") \ + m(+1, u64, rx_error_packets, "rx_error_packets", "Received error packets") \ + m(+1, u64, rx_error_bytes, "rx_error_bytes", "Received error bytes") \ + m(+1, u64, tx_error_packets, "tx_error_packets", "Transmitted error packets") \ + m(+1, u64, tx_error_bytes, "tx_error_bytes", "Transmitted error bytes") \ + m(+1, u64, rx_unicast_packets, "rx_unicast_packets", "Received unicast packets") \ + m(+1, u64, rx_unicast_bytes, "rx_unicast_bytes", "Received unicast bytes") \ + m(+1, u64, tx_unicast_packets, "tx_unicast_packets", "Transmitted unicast packets") \ + m(+1, u64, tx_unicast_bytes, "tx_unicast_bytes", "Transmitted unicast bytes") \ + m(+1, u64, rx_multicast_packets, "rx_multicast_packets", "Received multicast packets") \ + m(+1, u64, rx_multicast_bytes, "rx_multicast_bytes", "Received multicast bytes") \ + m(+1, u64, tx_multicast_packets, "tx_multicast_packets", "Transmitted multicast packets") \ + m(+1, u64, tx_multicast_bytes, "tx_multicast_bytes", "Transmitted multicast bytes") \ + m(+1, u64, rx_broadcast_packets, "rx_broadcast_packets", "Received broadcast packets") \ + m(+1, u64, rx_broadcast_bytes, "rx_broadcast_bytes", "Received broadcast bytes") \ + m(+1, u64, tx_broadcast_packets, "tx_broadcast_packets", "Transmitted broadcast packets") \ + m(+1, u64, tx_broadcast_bytes, "tx_broadcast_bytes", "Transmitted broadcast bytes") \ + m(+1, u64, rx_out_of_buffer, "rx_out_of_buffer", "Receive out of buffer, no recv wqes events") \ /* SW counters */ \ - m(+1, u64 tso_packets, "tso_packets", "Transmitted TSO packets") \ - m(+1, u64 tso_bytes, "tso_bytes", "Transmitted TSO bytes") \ - m(+1, u64 lro_packets, "lro_packets", "Received LRO packets") \ - m(+1, u64 lro_bytes, "lro_bytes", "Received LRO bytes") \ - m(+1, u64 sw_lro_queued, "sw_lro_queued", "Packets queued for SW LRO") \ - m(+1, u64 sw_lro_flushed, "sw_lro_flushed", "Packets flushed from SW LRO") \ - m(+1, u64 rx_csum_good, "rx_csum_good", "Received checksum valid packets") \ - m(+1, u64 rx_csum_none, "rx_csum_none", "Received no checksum packets") \ - m(+1, u64 tx_csum_offload, "tx_csum_offload", "Transmit checksum offload packets") \ - m(+1, u64 tx_queue_dropped, "tx_queue_dropped", "Transmit queue dropped") \ - m(+1, u64 tx_defragged, "tx_defragged", "Transmit queue defragged") \ - m(+1, u64 rx_wqe_err, "rx_wqe_err", "Receive WQE errors") \ - m(+1, u64 tx_jumbo_packets, "tx_jumbo_packets", "TX packets greater than 1518 octets") \ - m(+1, u64 rx_steer_missed_packets, "rx_steer_missed_packets", "RX packets dropped by steering rule(s)") + m(+1, u64, tso_packets, "tso_packets", "Transmitted TSO packets") \ + m(+1, u64, tso_bytes, "tso_bytes", "Transmitted TSO bytes") \ + m(+1, u64, lro_packets, "lro_packets", "Received LRO packets") \ + m(+1, u64, lro_bytes, "lro_bytes", "Received LRO bytes") \ + m(+1, u64, sw_lro_queued, "sw_lro_queued", "Packets queued for SW LRO") \ + m(+1, u64, sw_lro_flushed, "sw_lro_flushed", "Packets flushed from SW LRO") \ + m(+1, u64, rx_csum_good, "rx_csum_good", "Received checksum valid packets") \ + m(+1, u64, rx_csum_none, "rx_csum_none", "Received no checksum packets") \ + m(+1, u64, tx_csum_offload, "tx_csum_offload", "Transmit checksum offload packets") \ + m(+1, u64, tx_queue_dropped, "tx_queue_dropped", "Transmit queue dropped") \ + m(+1, u64, tx_defragged, "tx_defragged", "Transmit queue defragged") \ + m(+1, u64, rx_wqe_err, "rx_wqe_err", "Receive WQE errors") \ + m(+1, u64, tx_jumbo_packets, "tx_jumbo_packets", "TX packets greater than 1518 octets") \ + m(+1, u64, rx_steer_missed_packets, "rx_steer_missed_packets", "RX packets dropped by steering rule(s)") #define MLX5E_VPORT_STATS_NUM (0 MLX5E_VPORT_STATS(MLX5E_STATS_COUNT)) @@ -199,128 +199,129 @@ struct mlx5e_vport_stats { }; #define MLX5E_PPORT_IEEE802_3_STATS(m) \ - m(+1, u64 frames_tx, "frames_tx", "Frames transmitted") \ - m(+1, u64 frames_rx, "frames_rx", "Frames received") \ - m(+1, u64 check_seq_err, "check_seq_err", "Sequence errors") \ - m(+1, u64 alignment_err, "alignment_err", "Alignment errors") \ - m(+1, u64 octets_tx, "octets_tx", "Bytes transmitted") \ - m(+1, u64 octets_received, "octets_received", "Bytes received") \ - m(+1, u64 multicast_xmitted, "multicast_xmitted", "Multicast transmitted") \ - m(+1, u64 broadcast_xmitted, "broadcast_xmitted", "Broadcast transmitted") \ - m(+1, u64 multicast_rx, "multicast_rx", "Multicast received") \ - m(+1, u64 broadcast_rx, "broadcast_rx", "Broadcast received") \ - m(+1, u64 in_range_len_errors, "in_range_len_errors", "In range length errors") \ - m(+1, u64 out_of_range_len, "out_of_range_len", "Out of range length errors") \ - m(+1, u64 too_long_errors, "too_long_errors", "Too long errors") \ - m(+1, u64 symbol_err, "symbol_err", "Symbol errors") \ - m(+1, u64 mac_control_tx, "mac_control_tx", "MAC control transmitted") \ - m(+1, u64 mac_control_rx, "mac_control_rx", "MAC control received") \ - m(+1, u64 unsupported_op_rx, "unsupported_op_rx", "Unsupported operation received") \ - m(+1, u64 pause_ctrl_rx, "pause_ctrl_rx", "Pause control received") \ - m(+1, u64 pause_ctrl_tx, "pause_ctrl_tx", "Pause control transmitted") + m(+1, u64, frames_tx, "frames_tx", "Frames transmitted") \ + m(+1, u64, frames_rx, "frames_rx", "Frames received") \ + m(+1, u64, check_seq_err, "check_seq_err", "Sequence errors") \ + m(+1, u64, alignment_err, "alignment_err", "Alignment errors") \ + m(+1, u64, octets_tx, "octets_tx", "Bytes transmitted") \ + m(+1, u64, octets_received, "octets_received", "Bytes received") \ + m(+1, u64, multicast_xmitted, "multicast_xmitted", "Multicast transmitted") \ + m(+1, u64, broadcast_xmitted, "broadcast_xmitted", "Broadcast transmitted") \ + m(+1, u64, multicast_rx, "multicast_rx", "Multicast received") \ + m(+1, u64, broadcast_rx, "broadcast_rx", "Broadcast received") \ + m(+1, u64, in_range_len_errors, "in_range_len_errors", "In range length errors") \ + m(+1, u64, out_of_range_len, "out_of_range_len", "Out of range length errors") \ + m(+1, u64, too_long_errors, "too_long_errors", "Too long errors") \ + m(+1, u64, symbol_err, "symbol_err", "Symbol errors") \ + m(+1, u64, mac_control_tx, "mac_control_tx", "MAC control transmitted") \ + m(+1, u64, mac_control_rx, "mac_control_rx", "MAC control received") \ + m(+1, u64, unsupported_op_rx, "unsupported_op_rx", "Unsupported operation received") \ + m(+1, u64, pause_ctrl_rx, "pause_ctrl_rx", "Pause control received") \ + m(+1, u64, pause_ctrl_tx, "pause_ctrl_tx", "Pause control transmitted") #define MLX5E_PPORT_RFC2819_STATS(m) \ - m(+1, u64 drop_events, "drop_events", "Dropped events") \ - m(+1, u64 octets, "octets", "Octets") \ - m(+1, u64 pkts, "pkts", "Packets") \ - m(+1, u64 broadcast_pkts, "broadcast_pkts", "Broadcast packets") \ - m(+1, u64 multicast_pkts, "multicast_pkts", "Multicast packets") \ - m(+1, u64 crc_align_errors, "crc_align_errors", "CRC alignment errors") \ - m(+1, u64 undersize_pkts, "undersize_pkts", "Undersized packets") \ - m(+1, u64 oversize_pkts, "oversize_pkts", "Oversized packets") \ - m(+1, u64 fragments, "fragments", "Fragments") \ - m(+1, u64 jabbers, "jabbers", "Jabbers") \ - m(+1, u64 collisions, "collisions", "Collisions") + m(+1, u64, drop_events, "drop_events", "Dropped events") \ + m(+1, u64, octets, "octets", "Octets") \ + m(+1, u64, pkts, "pkts", "Packets") \ + m(+1, u64, broadcast_pkts, "broadcast_pkts", "Broadcast packets") \ + m(+1, u64, multicast_pkts, "multicast_pkts", "Multicast packets") \ + m(+1, u64, crc_align_errors, "crc_align_errors", "CRC alignment errors") \ + m(+1, u64, undersize_pkts, "undersize_pkts", "Undersized packets") \ + m(+1, u64, oversize_pkts, "oversize_pkts", "Oversized packets") \ + m(+1, u64, fragments, "fragments", "Fragments") \ + m(+1, u64, jabbers, "jabbers", "Jabbers") \ + m(+1, u64, collisions, "collisions", "Collisions") #define MLX5E_PPORT_RFC2819_STATS_DEBUG(m) \ - m(+1, u64 p64octets, "p64octets", "Bytes") \ - m(+1, u64 p65to127octets, "p65to127octets", "Bytes") \ - m(+1, u64 p128to255octets, "p128to255octets", "Bytes") \ - m(+1, u64 p256to511octets, "p256to511octets", "Bytes") \ - m(+1, u64 p512to1023octets, "p512to1023octets", "Bytes") \ - m(+1, u64 p1024to1518octets, "p1024to1518octets", "Bytes") \ - m(+1, u64 p1519to2047octets, "p1519to2047octets", "Bytes") \ - m(+1, u64 p2048to4095octets, "p2048to4095octets", "Bytes") \ - m(+1, u64 p4096to8191octets, "p4096to8191octets", "Bytes") \ - m(+1, u64 p8192to10239octets, "p8192to10239octets", "Bytes") + m(+1, u64, p64octets, "p64octets", "Bytes") \ + m(+1, u64, p65to127octets, "p65to127octets", "Bytes") \ + m(+1, u64, p128to255octets, "p128to255octets", "Bytes") \ + m(+1, u64, p256to511octets, "p256to511octets", "Bytes") \ + m(+1, u64, p512to1023octets, "p512to1023octets", "Bytes") \ + m(+1, u64, p1024to1518octets, "p1024to1518octets", "Bytes") \ + m(+1, u64, p1519to2047octets, "p1519to2047octets", "Bytes") \ + m(+1, u64, p2048to4095octets, "p2048to4095octets", "Bytes") \ + m(+1, u64, p4096to8191octets, "p4096to8191octets", "Bytes") \ + m(+1, u64, p8192to10239octets, "p8192to10239octets", "Bytes") #define MLX5E_PPORT_RFC2863_STATS_DEBUG(m) \ - m(+1, u64 in_octets, "in_octets", "In octets") \ - m(+1, u64 in_ucast_pkts, "in_ucast_pkts", "In unicast packets") \ - m(+1, u64 in_discards, "in_discards", "In discards") \ - m(+1, u64 in_errors, "in_errors", "In errors") \ - m(+1, u64 in_unknown_protos, "in_unknown_protos", "In unknown protocols") \ - m(+1, u64 out_octets, "out_octets", "Out octets") \ - m(+1, u64 out_ucast_pkts, "out_ucast_pkts", "Out unicast packets") \ - m(+1, u64 out_discards, "out_discards", "Out discards") \ - m(+1, u64 out_errors, "out_errors", "Out errors") \ - m(+1, u64 in_multicast_pkts, "in_multicast_pkts", "In multicast packets") \ - m(+1, u64 in_broadcast_pkts, "in_broadcast_pkts", "In broadcast packets") \ - m(+1, u64 out_multicast_pkts, "out_multicast_pkts", "Out multicast packets") \ - m(+1, u64 out_broadcast_pkts, "out_broadcast_pkts", "Out broadcast packets") + m(+1, u64, in_octets, "in_octets", "In octets") \ + m(+1, u64, in_ucast_pkts, "in_ucast_pkts", "In unicast packets") \ + m(+1, u64, in_discards, "in_discards", "In discards") \ + m(+1, u64, in_errors, "in_errors", "In errors") \ + m(+1, u64, in_unknown_protos, "in_unknown_protos", "In unknown protocols") \ + m(+1, u64, out_octets, "out_octets", "Out octets") \ + m(+1, u64, out_ucast_pkts, "out_ucast_pkts", "Out unicast packets") \ + m(+1, u64, out_discards, "out_discards", "Out discards") \ + m(+1, u64, out_errors, "out_errors", "Out errors") \ + m(+1, u64, in_multicast_pkts, "in_multicast_pkts", "In multicast packets") \ + m(+1, u64, in_broadcast_pkts, "in_broadcast_pkts", "In broadcast packets") \ + m(+1, u64, out_multicast_pkts, "out_multicast_pkts", "Out multicast packets") \ + m(+1, u64, out_broadcast_pkts, "out_broadcast_pkts", "Out broadcast packets") #define MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(m) \ - m(+1, u64 port_transmit_wait_high, "port_transmit_wait_high", "Port transmit wait high") \ - m(+1, u64 ecn_marked, "ecn_marked", "ECN marked") \ - m(+1, u64 no_buffer_discard_mc, "no_buffer_discard_mc", "No buffer discard mc") \ - m(+1, u64 rx_ebp, "rx_ebp", "RX EBP") \ - m(+1, u64 tx_ebp, "tx_ebp", "TX EBP") \ - m(+1, u64 rx_buffer_almost_full, "rx_buffer_almost_full", "RX buffer almost full") \ - m(+1, u64 rx_buffer_full, "rx_buffer_full", "RX buffer full") \ - m(+1, u64 rx_icrc_encapsulated, "rx_icrc_encapsulated", "RX ICRC encapsulated") \ - m(+1, u64 ex_reserved_0, "ex_reserved_0", "Reserved") \ - m(+1, u64 ex_reserved_1, "ex_reserved_1", "Reserved") \ - m(+1, u64 tx_stat_p64octets, "tx_stat_p64octets", "Bytes") \ - m(+1, u64 tx_stat_p65to127octets, "tx_stat_p65to127octets", "Bytes") \ - m(+1, u64 tx_stat_p128to255octets, "tx_stat_p128to255octets", "Bytes") \ - m(+1, u64 tx_stat_p256to511octets, "tx_stat_p256to511octets", "Bytes") \ - m(+1, u64 tx_stat_p512to1023octets, "tx_stat_p512to1023octets", "Bytes") \ - m(+1, u64 tx_stat_p1024to1518octets, "tx_stat_p1024to1518octets", "Bytes") \ - m(+1, u64 tx_stat_p1519to2047octets, "tx_stat_p1519to2047octets", "Bytes") \ - m(+1, u64 tx_stat_p2048to4095octets, "tx_stat_p2048to4095octets", "Bytes") \ - m(+1, u64 tx_stat_p4096to8191octets, "tx_stat_p4096to8191octets", "Bytes") \ - m(+1, u64 tx_stat_p8192to10239octets, "tx_stat_p8192to10239octets", "Bytes") + m(+1, u64, port_transmit_wait_high, "port_transmit_wait_high", "Port transmit wait high") \ + m(+1, u64, ecn_marked, "ecn_marked", "ECN marked") \ + m(+1, u64, no_buffer_discard_mc, "no_buffer_discard_mc", "No buffer discard mc") \ + m(+1, u64, rx_ebp, "rx_ebp", "RX EBP") \ + m(+1, u64, tx_ebp, "tx_ebp", "TX EBP") \ + m(+1, u64, rx_buffer_almost_full, "rx_buffer_almost_full", "RX buffer almost full") \ + m(+1, u64, rx_buffer_full, "rx_buffer_full", "RX buffer full") \ + m(+1, u64, rx_icrc_encapsulated, "rx_icrc_encapsulated", "RX ICRC encapsulated") \ + m(+1, u64, ex_reserved_0, "ex_reserved_0", "Reserved") \ + m(+1, u64, ex_reserved_1, "ex_reserved_1", "Reserved") \ + m(+1, u64, tx_stat_p64octets, "tx_stat_p64octets", "Bytes") \ + m(+1, u64, tx_stat_p65to127octets, "tx_stat_p65to127octets", "Bytes") \ + m(+1, u64, tx_stat_p128to255octets, "tx_stat_p128to255octets", "Bytes") \ + m(+1, u64, tx_stat_p256to511octets, "tx_stat_p256to511octets", "Bytes") \ + m(+1, u64, tx_stat_p512to1023octets, "tx_stat_p512to1023octets", "Bytes") \ + m(+1, u64, tx_stat_p1024to1518octets, "tx_stat_p1024to1518octets", "Bytes") \ + m(+1, u64, tx_stat_p1519to2047octets, "tx_stat_p1519to2047octets", "Bytes") \ + m(+1, u64, tx_stat_p2048to4095octets, "tx_stat_p2048to4095octets", "Bytes") \ + m(+1, u64, tx_stat_p4096to8191octets, "tx_stat_p4096to8191octets", "Bytes") \ + m(+1, u64, tx_stat_p8192to10239octets, "tx_stat_p8192to10239octets", "Bytes") -#define MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(m) \ - m(+1, u64 time_since_last_clear, "time_since_last_clear", \ - "Time since the last counters clear event (msec)") \ - m(+1, u64 symbol_errors, "symbol_errors", "Symbol errors") \ - m(+1, u64 sync_headers_errors, "sync_headers_errors", "Sync header error counter") \ - m(+1, u64 bip_errors_lane0, "edpl_bip_errors_lane0", \ - "Indicates the number of PRBS errors on lane 0") \ - m(+1, u64 bip_errors_lane1, "edpl_bip_errors_lane1", \ - "Indicates the number of PRBS errors on lane 1") \ - m(+1, u64 bip_errors_lane2, "edpl_bip_errors_lane2", \ - "Indicates the number of PRBS errors on lane 2") \ - m(+1, u64 bip_errors_lane3, "edpl_bip_errors_lane3", \ - "Indicates the number of PRBS errors on lane 3") \ - m(+1, u64 fc_corrected_blocks_lane0, "fc_corrected_blocks_lane0", \ - "FEC correctable block counter lane 0") \ - m(+1, u64 fc_corrected_blocks_lane1, "fc_corrected_blocks_lane1", \ - "FEC correctable block counter lane 1") \ - m(+1, u64 fc_corrected_blocks_lane2, "fc_corrected_blocks_lane2", \ - "FEC correctable block counter lane 2") \ - m(+1, u64 fc_corrected_blocks_lane3, "fc_corrected_blocks_lane3", \ - "FEC correctable block counter lane 3") \ - m(+1, u64 rs_corrected_blocks, "rs_corrected_blocks", \ - "FEC correcable block counter") \ - m(+1, u64 rs_uncorrectable_blocks, "rs_uncorrectable_blocks", \ - "FEC uncorrecable block counter") \ - m(+1, u64 rs_no_errors_blocks, "rs_no_errors_blocks", \ - "The number of RS-FEC blocks received that had no errors") \ - m(+1, u64 rs_single_error_blocks, "rs_single_error_blocks", \ - "The number of corrected RS-FEC blocks received that had" \ - "exactly 1 error symbol") \ - m(+1, u64 rs_corrected_symbols_total, "rs_corrected_symbols_total", \ - "Port FEC corrected symbol counter") \ - m(+1, u64 rs_corrected_symbols_lane0, "rs_corrected_symbols_lane0", \ - "FEC corrected symbol counter lane 0") \ - m(+1, u64 rs_corrected_symbols_lane1, "rs_corrected_symbols_lane1", \ - "FEC corrected symbol counter lane 1") \ - m(+1, u64 rs_corrected_symbols_lane2, "rs_corrected_symbols_lane2", \ - "FEC corrected symbol counter lane 2") \ - m(+1, u64 rs_corrected_symbols_lane3, "rs_corrected_symbols_lane3", \ - "FEC corrected symbol counter lane 3") +#define MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(m) \ + m(+1, u64, time_since_last_clear, "time_since_last_clear", \ + "Time since the last counters clear event (msec)") \ + m(+1, u64, symbol_errors, "symbol_errors", "Symbol errors") \ + m(+1, u64, sync_headers_errors, "sync_headers_errors", \ + "Sync header error counter") \ + m(+1, u64, bip_errors_lane0, "edpl_bip_errors_lane0", \ + "Indicates the number of PRBS errors on lane 0") \ + m(+1, u64, bip_errors_lane1, "edpl_bip_errors_lane1", \ + "Indicates the number of PRBS errors on lane 1") \ + m(+1, u64, bip_errors_lane2, "edpl_bip_errors_lane2", \ + "Indicates the number of PRBS errors on lane 2") \ + m(+1, u64, bip_errors_lane3, "edpl_bip_errors_lane3", \ + "Indicates the number of PRBS errors on lane 3") \ + m(+1, u64, fc_corrected_blocks_lane0, "fc_corrected_blocks_lane0", \ + "FEC correctable block counter lane 0") \ + m(+1, u64, fc_corrected_blocks_lane1, "fc_corrected_blocks_lane1", \ + "FEC correctable block counter lane 1") \ + m(+1, u64, fc_corrected_blocks_lane2, "fc_corrected_blocks_lane2", \ + "FEC correctable block counter lane 2") \ + m(+1, u64, fc_corrected_blocks_lane3, "fc_corrected_blocks_lane3", \ + "FEC correctable block counter lane 3") \ + m(+1, u64, rs_corrected_blocks, "rs_corrected_blocks", \ + "FEC correcable block counter") \ + m(+1, u64, rs_uncorrectable_blocks, "rs_uncorrectable_blocks", \ + "FEC uncorrecable block counter") \ + m(+1, u64, rs_no_errors_blocks, "rs_no_errors_blocks", \ + "The number of RS-FEC blocks received that had no errors") \ + m(+1, u64, rs_single_error_blocks, "rs_single_error_blocks", \ + "The number of corrected RS-FEC blocks received that had" \ + "exactly 1 error symbol") \ + m(+1, u64, rs_corrected_symbols_total, "rs_corrected_symbols_total", \ + "Port FEC corrected symbol counter") \ + m(+1, u64, rs_corrected_symbols_lane0, "rs_corrected_symbols_lane0", \ + "FEC corrected symbol counter lane 0") \ + m(+1, u64, rs_corrected_symbols_lane1, "rs_corrected_symbols_lane1", \ + "FEC corrected symbol counter lane 1") \ + m(+1, u64, rs_corrected_symbols_lane2, "rs_corrected_symbols_lane2", \ + "FEC corrected symbol counter lane 2") \ + m(+1, u64, rs_corrected_symbols_lane3, "rs_corrected_symbols_lane3", \ + "FEC corrected symbol counter lane 3") /* Per priority statistics for PFC */ #define MLX5E_PPORT_PER_PRIO_STATS_SUB(m,n,p) \ @@ -349,7 +350,7 @@ struct mlx5e_vport_stats { "device_stall_critical_watermark", "Device stall critical watermark") #define MLX5E_PPORT_PER_PRIO_STATS_PREFIX(m,p,c,t,f,s,d) \ - m(c, t pri_##p##_##f, "prio" #p "_" s, "Priority " #p " - " d) + m(c, t, pri_##p##_##f, "prio" #p "_" s, "Priority " #p " - " d) #define MLX5E_PPORT_PER_PRIO_STATS_NUM_PRIO 8 @@ -411,14 +412,14 @@ struct mlx5e_port_stats_debug { }; #define MLX5E_RQ_STATS(m) \ - m(+1, u64 packets, "packets", "Received packets") \ - m(+1, u64 bytes, "bytes", "Received bytes") \ - m(+1, u64 csum_none, "csum_none", "Received packets") \ - m(+1, u64 lro_packets, "lro_packets", "Received LRO packets") \ - m(+1, u64 lro_bytes, "lro_bytes", "Received LRO bytes") \ - m(+1, u64 sw_lro_queued, "sw_lro_queued", "Packets queued for SW LRO") \ - m(+1, u64 sw_lro_flushed, "sw_lro_flushed", "Packets flushed from SW LRO") \ - m(+1, u64 wqe_err, "wqe_err", "Received packets") + m(+1, u64, packets, "packets", "Received packets") \ + m(+1, u64, bytes, "bytes", "Received bytes") \ + m(+1, u64, csum_none, "csum_none", "Received packets") \ + m(+1, u64, lro_packets, "lro_packets", "Received LRO packets") \ + m(+1, u64, lro_bytes, "lro_bytes", "Received LRO bytes") \ + m(+1, u64, sw_lro_queued, "sw_lro_queued", "Packets queued for SW LRO") \ + m(+1, u64, sw_lro_flushed, "sw_lro_flushed", "Packets flushed from SW LRO") \ + m(+1, u64, wqe_err, "wqe_err", "Received packets") #define MLX5E_RQ_STATS_NUM (0 MLX5E_RQ_STATS(MLX5E_STATS_COUNT)) @@ -429,14 +430,14 @@ struct mlx5e_rq_stats { }; #define MLX5E_SQ_STATS(m) \ - m(+1, u64 packets, "packets", "Transmitted packets") \ - m(+1, u64 bytes, "bytes", "Transmitted bytes") \ - m(+1, u64 tso_packets, "tso_packets", "Transmitted packets") \ - m(+1, u64 tso_bytes, "tso_bytes", "Transmitted bytes") \ - m(+1, u64 csum_offload_none, "csum_offload_none", "Transmitted packets") \ - m(+1, u64 defragged, "defragged", "Transmitted packets") \ - m(+1, u64 dropped, "dropped", "Transmitted packets") \ - m(+1, u64 nop, "nop", "Transmitted packets") + m(+1, u64, packets, "packets", "Transmitted packets") \ + m(+1, u64, bytes, "bytes", "Transmitted bytes") \ + m(+1, u64, tso_packets, "tso_packets", "Transmitted packets") \ + m(+1, u64, tso_bytes, "tso_bytes", "Transmitted bytes") \ + m(+1, u64, csum_offload_none, "csum_offload_none", "Transmitted packets") \ + m(+1, u64, defragged, "defragged", "Transmitted packets") \ + m(+1, u64, dropped, "dropped", "Transmitted packets") \ + m(+1, u64, nop, "nop", "Transmitted packets") #define MLX5E_SQ_STATS_NUM (0 MLX5E_SQ_STATS(MLX5E_STATS_COUNT)) @@ -494,32 +495,31 @@ struct mlx5e_params { }; #define MLX5E_PARAMS(m) \ - m(+1, u64 tx_queue_size_max, "tx_queue_size_max", "Max send queue size") \ - m(+1, u64 rx_queue_size_max, "rx_queue_size_max", "Max receive queue size") \ - m(+1, u64 tx_queue_size, "tx_queue_size", "Default send queue size") \ - m(+1, u64 rx_queue_size, "rx_queue_size", "Default receive queue size") \ - m(+1, u64 channels, "channels", "Default number of channels") \ - m(+1, u64 channels_rsss, "channels_rsss", "Default channels receive side scaling stride") \ - m(+1, u64 coalesce_usecs_max, "coalesce_usecs_max", "Maximum usecs for joining packets") \ - m(+1, u64 coalesce_pkts_max, "coalesce_pkts_max", "Maximum packets to join") \ - m(+1, u64 rx_coalesce_usecs, "rx_coalesce_usecs", "Limit in usec for joining rx packets") \ - m(+1, u64 rx_coalesce_pkts, "rx_coalesce_pkts", "Maximum number of rx packets to join") \ - m(+1, u64 rx_coalesce_mode, "rx_coalesce_mode", "0: EQE fixed mode 1: CQE fixed mode 2: EQE auto mode 3: CQE auto mode") \ - m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ - m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ - m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ - m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ - m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ - m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ - m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") \ - m(+1, u64 modify_tx_dma, "modify_tx_dma", "0: Enable TX 1: Disable TX") \ - m(+1, u64 modify_rx_dma, "modify_rx_dma", "0: Enable RX 1: Disable RX") \ - m(+1, u64 diag_pci_enable, "diag_pci_enable", "0: Disabled 1: Enabled") \ - m(+1, u64 diag_general_enable, "diag_general_enable", "0: Disabled 1: Enabled") \ - m(+1, u64 hw_mtu, "hw_mtu", "Current hardware MTU value") \ - m(+1, u64 mc_local_lb, "mc_local_lb", "0: Local multicast loopback enabled 1: Disabled") \ - m(+1, u64 uc_local_lb, "uc_local_lb", "0: Local unicast loopback enabled 1: Disabled") - + m(+1, u64, tx_queue_size_max, "tx_queue_size_max", "Max send queue size") \ + m(+1, u64, rx_queue_size_max, "rx_queue_size_max", "Max receive queue size") \ + m(+1, u64, tx_queue_size, "tx_queue_size", "Default send queue size") \ + m(+1, u64, rx_queue_size, "rx_queue_size", "Default receive queue size") \ + m(+1, u64, channels, "channels", "Default number of channels") \ + m(+1, u64, channels_rsss, "channels_rsss", "Default channels receive side scaling stride") \ + m(+1, u64, coalesce_usecs_max, "coalesce_usecs_max", "Maximum usecs for joining packets") \ + m(+1, u64, coalesce_pkts_max, "coalesce_pkts_max", "Maximum packets to join") \ + m(+1, u64, rx_coalesce_usecs, "rx_coalesce_usecs", "Limit in usec for joining rx packets") \ + m(+1, u64, rx_coalesce_pkts, "rx_coalesce_pkts", "Maximum number of rx packets to join") \ + m(+1, u64, rx_coalesce_mode, "rx_coalesce_mode", "0: EQE fixed mode 1: CQE fixed mode 2: EQE auto mode 3: CQE auto mode") \ + m(+1, u64, tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ + m(+1, u64, tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ + m(+1, u64, tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ + m(+1, u64, tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ + m(+1, u64, tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ + m(+1, u64, hw_lro, "hw_lro", "set to enable hw_lro") \ + m(+1, u64, cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") \ + m(+1, u64, modify_tx_dma, "modify_tx_dma", "0: Enable TX 1: Disable TX") \ + m(+1, u64, modify_rx_dma, "modify_rx_dma", "0: Enable RX 1: Disable RX") \ + m(+1, u64, diag_pci_enable, "diag_pci_enable", "0: Disabled 1: Enabled") \ + m(+1, u64, diag_general_enable, "diag_general_enable", "0: Disabled 1: Enabled") \ + m(+1, u64, hw_mtu, "hw_mtu", "Current hardware MTU value") \ + m(+1, u64, mc_local_lb, "mc_local_lb", "0: Local multicast loopback enabled 1: Disabled") \ + m(+1, u64, uc_local_lb, "uc_local_lb", "0: Local unicast loopback enabled 1: Disabled") #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) Modified: head/sys/dev/mlx5/mlx5_en/en_rl.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en_rl.h Wed May 8 10:58:41 2019 (r347307) +++ head/sys/dev/mlx5/mlx5_en/en_rl.h Wed May 8 10:59:16 2019 (r347308) @@ -59,42 +59,42 @@ #define MLX5E_RL_WUNLOCK(rl) sx_xunlock(&(rl)->rl_sxlock) #define MLX5E_RL_PARAMS(m) \ - m(+1, u64 tx_queue_size, "tx_queue_size", "Default send queue size") \ - m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining TX packets") \ - m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of TX packets to join") \ - m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ - m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ - m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ - m(+1, u64 tx_worker_threads_max, "tx_worker_threads_max", "Max number of TX worker threads") \ - m(+1, u64 tx_worker_threads_def, "tx_worker_threads_def", "Default number of TX worker threads") \ - m(+1, u64 tx_channels_per_worker_max, "tx_channels_per_worker_max", "Max number of TX channels per worker") \ - m(+1, u64 tx_channels_per_worker_def, "tx_channels_per_worker_def", "Default number of TX channels per worker") \ - m(+1, u64 tx_rates_max, "tx_rates_max", "Max number of TX rates") \ - m(+1, u64 tx_rates_def, "tx_rates_def", "Default number of TX rates") \ - m(+1, u64 tx_limit_min, "tx_limit_min", "Minimum TX rate in bits/s") \ - m(+1, u64 tx_limit_max, "tx_limit_max", "Maximum TX rate in bits/s") \ - m(+1, u64 tx_burst_size, "tx_burst_size", "Current burst size in number of packets. A value of zero means use firmware default.") \ - m(+1, u64 tx_burst_size_max, "tx_burst_size_max", "Maximum burst size in number of packets") \ - m(+1, u64 tx_burst_size_min, "tx_burst_size_min", "Minimum burst size in number of packets") + m(+1, u64, tx_queue_size, "tx_queue_size", "Default send queue size") \ + m(+1, u64, tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining TX packets") \ + m(+1, u64, tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of TX packets to join") \ + m(+1, u64, tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ + m(+1, u64, tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ + m(+1, u64, tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ + m(+1, u64, tx_worker_threads_max, "tx_worker_threads_max", "Max number of TX worker threads") \ + m(+1, u64, tx_worker_threads_def, "tx_worker_threads_def", "Default number of TX worker threads") \ + m(+1, u64, tx_channels_per_worker_max, "tx_channels_per_worker_max", "Max number of TX channels per worker") \ + m(+1, u64, tx_channels_per_worker_def, "tx_channels_per_worker_def", "Default number of TX channels per worker") \ + m(+1, u64, tx_rates_max, "tx_rates_max", "Max number of TX rates") \ + m(+1, u64, tx_rates_def, "tx_rates_def", "Default number of TX rates") \ + m(+1, u64, tx_limit_min, "tx_limit_min", "Minimum TX rate in bits/s") \ + m(+1, u64, tx_limit_max, "tx_limit_max", "Maximum TX rate in bits/s") \ + m(+1, u64, tx_burst_size, "tx_burst_size", "Current burst size in number of packets. A value of zero means use firmware default.") \ + m(+1, u64, tx_burst_size_max, "tx_burst_size_max", "Maximum burst size in number of packets") \ + m(+1, u64, tx_burst_size_min, "tx_burst_size_min", "Minimum burst size in number of packets") #define MLX5E_RL_PARAMS_NUM (0 MLX5E_RL_PARAMS(MLX5E_STATS_COUNT)) #define MLX5E_RL_STATS(m) \ - m(+1, u64 tx_allocate_resource_failure, "tx_allocate_resource_failure", "Number of times firmware resource allocation failed") \ - m(+1, u64 tx_add_new_rate_failure, "tx_add_new_rate_failure", "Number of times adding a new firmware rate failed") \ - m(+1, u64 tx_modify_rate_failure, "tx_modify_rate_failure", "Number of times modifying a firmware rate failed") \ - m(+1, u64 tx_active_connections, "tx_active_connections", "Number of active connections") \ - m(+1, u64 tx_open_queues, "tx_open_queues", "Number of open TX queues") \ - m(+1, u64 tx_available_resource_failure, "tx_available_resource_failure", "Number of times TX resources were not available") + m(+1, u64, tx_allocate_resource_failure, "tx_allocate_resource_failure", "Number of times firmware resource allocation failed") \ + m(+1, u64, tx_add_new_rate_failure, "tx_add_new_rate_failure", "Number of times adding a new firmware rate failed") \ + m(+1, u64, tx_modify_rate_failure, "tx_modify_rate_failure", "Number of times modifying a firmware rate failed") \ + m(+1, u64, tx_active_connections, "tx_active_connections", "Number of active connections") \ + m(+1, u64, tx_open_queues, "tx_open_queues", "Number of open TX queues") \ + m(+1, u64, tx_available_resource_failure, "tx_available_resource_failure", "Number of times TX resources were not available") #define MLX5E_RL_STATS_NUM (0 MLX5E_RL_STATS(MLX5E_STATS_COUNT)) #define MLX5E_RL_TABLE_PARAMS(m) \ - m(+1, u64 tx_limit_add, "tx_limit_add", "Add TX rate limit in bits/s to empty slot") \ - m(+1, u64 tx_limit_clr, "tx_limit_clr", "Clear all TX rates in table") \ - m(+1, u64 tx_allowed_deviation, "tx_allowed_deviation", "Relative rate deviation allowed in 1/1000") \ - m(+1, u64 tx_allowed_deviation_min, "tx_allowed_deviation_min", "Minimum allowed rate deviation in 1/1000") \ - m(+1, u64 tx_allowed_deviation_max, "tx_allowed_deviation_max", "Maximum allowed rate deviation in 1/1000") + m(+1, u64, tx_limit_add, "tx_limit_add", "Add TX rate limit in bits/s to empty slot") \ + m(+1, u64, tx_limit_clr, "tx_limit_clr", "Clear all TX rates in table") \ + m(+1, u64, tx_allowed_deviation, "tx_allowed_deviation", "Relative rate deviation allowed in 1/1000") \ + m(+1, u64, tx_allowed_deviation_min, "tx_allowed_deviation_min", "Minimum allowed rate deviation in 1/1000") \ + m(+1, u64, tx_allowed_deviation_max, "tx_allowed_deviation_max", "Maximum allowed rate deviation in 1/1000") #define MLX5E_RL_TABLE_PARAMS_NUM (0 MLX5E_RL_TABLE_PARAMS(MLX5E_STATS_COUNT)) From owner-svn-src-all@freebsd.org Wed May 8 11:02:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0166815A69F5; Wed, 8 May 2019 11:02:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99A076CD58; Wed, 8 May 2019 11:02:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 729844F5A; Wed, 8 May 2019 11:02:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B2br8063124; Wed, 8 May 2019 11:02:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B2bY6063123; Wed, 8 May 2019 11:02:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081102.x48B2bY6063123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347309 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99A076CD58 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:02:38 -0000 Author: hselasky Date: Wed May 8 11:02:36 2019 New Revision: 347309 URL: https://svnweb.freebsd.org/changeset/base/347309 Log: Add support for extended PCIe counters in mlx5en(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 10:59:16 2019 (r347308) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 11:02:36 2019 (r347309) @@ -364,6 +364,151 @@ struct mlx5e_vport_stats { MLX5E_PPORT_PER_PRIO_STATS_SUB(MLX5E_PPORT_PER_PRIO_STATS_PREFIX,m,6) \ MLX5E_PPORT_PER_PRIO_STATS_SUB(MLX5E_PPORT_PER_PRIO_STATS_PREFIX,m,7) +#define MLX5E_PCIE_PERFORMANCE_COUNTERS_64(m) \ + m(+1, u64, life_time_counter_high, "life_time_counter", \ + "Life time counter.", pcie_perf_counters) \ + m(+1, u64, tx_overflow_buffer_pkt, "tx_overflow_buffer_pkt", \ + "The number of packets dropped due to lack of PCIe buffers " \ + "in receive path from NIC port toward the hosts.", \ + pcie_perf_counters) \ + m(+1, u64, tx_overflow_buffer_marked_pkt, \ + "tx_overflow_buffer_marked_pkt", \ + "The number of packets marked due to lack of PCIe buffers " \ + "in receive path from NIC port toward the hosts.", \ + pcie_perf_counters) + +#define MLX5E_PCIE_PERFORMANCE_COUNTERS_32(m) \ + m(+1, u64, rx_errors, "rx_errors", \ + "Number of transitions to recovery due to Framing " \ + "errors and CRC errors.", pcie_perf_counters) \ + m(+1, u64, tx_errors, "tx_errors", "Number of transitions " \ + "to recovery due to EIEOS and TS errors.", pcie_perf_counters) \ + m(+1, u64, l0_to_recovery_eieos, "l0_to_recovery_eieos", "Number of " \ + "transitions to recovery due to getting EIEOS.", pcie_perf_counters)\ + m(+1, u64, l0_to_recovery_ts, "l0_to_recovery_ts", "Number of " \ + "transitions to recovery due to getting TS.", pcie_perf_counters) \ + m(+1, u64, l0_to_recovery_framing, "l0_to_recovery_framing", "Number "\ + "of transitions to recovery due to identifying framing " \ + "errors at gen3/4.", pcie_perf_counters) \ + m(+1, u64, l0_to_recovery_retrain, "l0_to_recovery_retrain", \ + "Number of transitions to recovery due to link retrain request " \ + "from data link.", pcie_perf_counters) \ + m(+1, u64, crc_error_dllp, "crc_error_dllp", "Number of transitions " \ + "to recovery due to identifying CRC DLLP errors.", \ + pcie_perf_counters) \ + m(+1, u64, crc_error_tlp, "crc_error_tlp", "Number of transitions to "\ + "recovery due to identifying CRC TLP errors.", pcie_perf_counters) \ + m(+1, u64, outbound_stalled_reads, "outbound_stalled_reads", \ + "The percentage of time within the last second that the NIC had " \ + "outbound non-posted read requests but could not perform the " \ + "operation due to insufficient non-posted credits.", \ + pcie_perf_counters) \ + m(+1, u64, outbound_stalled_writes, "outbound_stalled_writes", \ + "The percentage of time within the last second that the NIC had " \ + "outbound posted writes requests but could not perform the " \ + "operation due to insufficient posted credits.", \ + pcie_perf_counters) \ + m(+1, u64, outbound_stalled_reads_events, \ + "outbound_stalled_reads_events", "The number of events where " \ + "outbound_stalled_reads was above a threshold.", \ + pcie_perf_counters) \ + m(+1, u64, outbound_stalled_writes_events, \ + "outbound_stalled_writes_events", \ + "The number of events where outbound_stalled_writes was above " \ + "a threshold.", pcie_perf_counters) + +#define MLX5E_PCIE_TIMERS_AND_STATES_COUNTERS_32(m) \ + m(+1, u64, time_to_boot_image_start, "time_to_boot_image_start", \ + "Time from start until FW boot image starts running in usec.", \ + pcie_timers_states) \ + m(+1, u64, time_to_link_image, "time_to_link_image", \ + "Time from start until FW pci_link image starts running in usec.", \ + pcie_timers_states) \ + m(+1, u64, calibration_time, "calibration_time", \ + "Time it took FW to do calibration in usec.", \ + pcie_timers_states) \ + m(+1, u64, time_to_first_perst, "time_to_first_perst", \ + "Time form start until FW handle first perst. in usec.", \ + pcie_timers_states) \ + m(+1, u64, time_to_detect_state, "time_to_detect_state", \ + "Time from start until first transition to LTSSM.Detect_Q in usec", \ + pcie_timers_states) \ + m(+1, u64, time_to_l0, "time_to_l0", \ + "Time from start until first transition to LTSSM.L0 in usec", \ + pcie_timers_states) \ + m(+1, u64, time_to_crs_en, "time_to_crs_en", \ + "Time from start until crs is enabled in usec", \ + pcie_timers_states) \ + m(+1, u64, time_to_plastic_image_start, "time_to_plastic_image_start",\ + "Time form start until FW plastic image starts running in usec.", \ + pcie_timers_states) \ + m(+1, u64, time_to_iron_image_start, "time_to_iron_image_start", \ + "Time form start until FW iron image starts running in usec.", \ + pcie_timers_states) \ + m(+1, u64, perst_handler, "perst_handler", \ + "Number of persts arrived.", pcie_timers_states) \ + m(+1, u64, times_in_l1, "times_in_l1", \ + "Number of times LTSSM entered L1 flow.", pcie_timers_states) \ + m(+1, u64, times_in_l23, "times_in_l23", \ + "Number of times LTSSM entered L23 flow.", pcie_timers_states) \ + m(+1, u64, dl_down, "dl_down", \ + "Number of moves for DL_active to DL_down.", pcie_timers_states) \ + m(+1, u64, config_cycle1usec, "config_cycle1usec", \ + "Number of configuration requests that firmware " \ + "handled in less than 1 usec.", pcie_timers_states) \ + m(+1, u64, config_cycle2to7usec, "config_cycle2to7usec", \ + "Number of configuration requests that firmware " \ + "handled within 2 to 7 usec.", pcie_timers_states) \ + m(+1, u64, config_cycle8to15usec, "config_cycle8to15usec", \ + "Number of configuration requests that firmware " \ + "handled within 8 to 15 usec.", pcie_timers_states) \ + m(+1, u64, config_cycle16to63usec, "config_cycle16to63usec", \ + "Number of configuration requests that firmware " \ + "handled within 16 to 63 usec.", pcie_timers_states) \ + m(+1, u64, config_cycle64usec, "config_cycle64usec", \ + "Number of configuration requests that firmware " \ + "handled took more than 64 usec.", pcie_timers_states) \ + m(+1, u64, correctable_err_msg_sent, "correctable_err_msg_sent", \ + "Number of correctable error messages sent.", pcie_timers_states) \ + m(+1, u64, non_fatal_err_msg_sent, "non_fatal_err_msg_sent", \ + "Number of non-Fatal error msg sent.", pcie_timers_states) \ + m(+1, u64, fatal_err_msg_sent, "fatal_err_msg_sent", \ + "Number of fatal error msg sent.", pcie_timers_states) + +#define MLX5E_PCIE_LANE_COUNTERS_32(m) \ + m(+1, u64, error_counter_lane0, "error_counter_lane0", \ + "Error counter for PCI lane 0", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane1, "error_counter_lane1", \ + "Error counter for PCI lane 1", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane2, "error_counter_lane2", \ + "Error counter for PCI lane 2", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane3, "error_counter_lane3", \ + "Error counter for PCI lane 3", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane4, "error_counter_lane4", \ + "Error counter for PCI lane 4", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane5, "error_counter_lane5", \ + "Error counter for PCI lane 5", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane6, "error_counter_lane6", \ + "Error counter for PCI lane 6", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane7, "error_counter_lane7", \ + "Error counter for PCI lane 7", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane8, "error_counter_lane8", \ + "Error counter for PCI lane 8", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane9, "error_counter_lane9", \ + "Error counter for PCI lane 9", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane10, "error_counter_lane10", \ + "Error counter for PCI lane 10", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane11, "error_counter_lane11", \ + "Error counter for PCI lane 11", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane12, "error_counter_lane12", \ + "Error counter for PCI lane 12", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane13, "error_counter_lane13", \ + "Error counter for PCI lane 13", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane14, "error_counter_lane14", \ + "Error counter for PCI lane 14", pcie_lanes_counters) \ + m(+1, u64, error_counter_lane15, "error_counter_lane15", \ + "Error counter for PCI lane 15", pcie_lanes_counters) + /* * Make sure to update mlx5e_update_pport_counters() * when adding a new MLX5E_PPORT_STATS block @@ -377,7 +522,11 @@ struct mlx5e_vport_stats { MLX5E_PPORT_RFC2819_STATS_DEBUG(m) \ MLX5E_PPORT_RFC2863_STATS_DEBUG(m) \ MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(m) \ - MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(m) + MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(m) \ + MLX5E_PCIE_PERFORMANCE_COUNTERS_64(m) \ + MLX5E_PCIE_PERFORMANCE_COUNTERS_32(m) \ + MLX5E_PCIE_TIMERS_AND_STATES_COUNTERS_32(m) \ + MLX5E_PCIE_LANE_COUNTERS_32(m) #define MLX5E_PPORT_IEEE802_3_STATS_NUM \ (0 MLX5E_PPORT_IEEE802_3_STATS(MLX5E_STATS_COUNT)) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:59:16 2019 (r347308) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 11:02:36 2019 (r347309) @@ -650,6 +650,56 @@ mlx5e_update_carrier_work(struct work_struct *work) PRIV_UNLOCK(priv); } +#define MLX5E_PCIE_PERF_GET_64(a,b,c,d,e,f) \ + s_debug->c = MLX5_GET64(mpcnt_reg, out, counter_set.f.c); + +#define MLX5E_PCIE_PERF_GET_32(a,b,c,d,e,f) \ + s_debug->c = MLX5_GET(mpcnt_reg, out, counter_set.f.c); + +static void +mlx5e_update_pcie_counters(struct mlx5e_priv *priv) +{ + struct mlx5_core_dev *mdev = priv->mdev; + struct mlx5e_port_stats_debug *s_debug = &priv->stats.port_stats_debug; + const unsigned sz = MLX5_ST_SZ_BYTES(mpcnt_reg); + void *out; + void *in; + int err; + + /* allocate firmware request structures */ + in = mlx5_vzalloc(sz); + out = mlx5_vzalloc(sz); + if (in == NULL || out == NULL) + goto free_out; + + MLX5_SET(mpcnt_reg, in, grp, MLX5_PCIE_PERFORMANCE_COUNTERS_GROUP); + err = mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_MPCNT, 0, 0); + if (err != 0) + goto free_out; + + MLX5E_PCIE_PERFORMANCE_COUNTERS_64(MLX5E_PCIE_PERF_GET_64) + MLX5E_PCIE_PERFORMANCE_COUNTERS_32(MLX5E_PCIE_PERF_GET_32) + + MLX5_SET(mpcnt_reg, in, grp, MLX5_PCIE_TIMERS_AND_STATES_COUNTERS_GROUP); + err = mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_MPCNT, 0, 0); + if (err != 0) + goto free_out; + + MLX5E_PCIE_TIMERS_AND_STATES_COUNTERS_32(MLX5E_PCIE_PERF_GET_32) + + MLX5_SET(mpcnt_reg, in, grp, MLX5_PCIE_LANE_COUNTERS_GROUP); + err = mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_MPCNT, 0, 0); + if (err != 0) + goto free_out; + + MLX5E_PCIE_LANE_COUNTERS_32(MLX5E_PCIE_PERF_GET_32) + +free_out: + /* free firmware request structures */ + kvfree(in); + kvfree(out); +} + /* * This function reads the physical port counters from the firmware * using a pre-defined layout defined by various MLX5E_PPORT_XXX() @@ -696,6 +746,7 @@ mlx5e_update_pport_counters(struct mlx5e_priv *priv) mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_RFC2819_STATS_NUM; x++, y++) s->arg[y] = be64toh(ptr[x]); + for (y = 0; x != MLX5E_PPORT_RFC2819_STATS_NUM + MLX5E_PPORT_RFC2819_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); @@ -717,6 +768,9 @@ mlx5e_update_pport_counters(struct mlx5e_priv *priv) mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); + + /* read PCIE counters */ + mlx5e_update_pcie_counters(priv); /* read per-priority counters */ MLX5_SET(ppcnt_reg, in, grp, MLX5_PER_PRIORITY_COUNTERS_GROUP); From owner-svn-src-all@freebsd.org Wed May 8 11:03:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A2A715A6A9B; Wed, 8 May 2019 11:03:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3ABB6CEE0; Wed, 8 May 2019 11:03:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7FDF4F5B; Wed, 8 May 2019 11:03:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B3Tgb063212; Wed, 8 May 2019 11:03:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B3TBP063211; Wed, 8 May 2019 11:03:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081103.x48B3TBP063211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347310 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3ABB6CEE0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:03:30 -0000 Author: hselasky Date: Wed May 8 11:03:29 2019 New Revision: 347310 URL: https://svnweb.freebsd.org/changeset/base/347310 Log: Expose per-lane counters before correction mechanism in mlx5en(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 11:02:36 2019 (r347309) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 11:03:29 2019 (r347310) @@ -281,6 +281,24 @@ struct mlx5e_vport_stats { m(+1, u64, tx_stat_p4096to8191octets, "tx_stat_p4096to8191octets", "Bytes") \ m(+1, u64, tx_stat_p8192to10239octets, "tx_stat_p8192to10239octets", "Bytes") +#define MLX5E_PPORT_STATISTICAL_DEBUG(m) \ + m(+1, u64, phy_time_since_last_clear, "phy_time_since_last_clear", \ + "Time since last clear in milliseconds") \ + m(+1, u64, phy_received_bits, "phy_received_bits", \ + "Total amount of traffic received in bits before error correction") \ + m(+1, u64, phy_symbol_errors, "phy_symbol_errors", \ + "Total number of symbol errors before error correction") \ + m(+1, u64, phy_corrected_bits, "phy_corrected_bits", \ + "Total number of corrected bits ") \ + m(+1, u64, phy_corrected_bits_lane0, "phy_corrected_bits_lane0", \ + "Total number of corrected bits for lane 0") \ + m(+1, u64, phy_corrected_bits_lane1, "phy_corrected_bits_lane1", \ + "Total number of corrected bits for lane 1") \ + m(+1, u64, phy_corrected_bits_lane2, "phy_corrected_bits_lane2", \ + "Total number of corrected bits for lane 2") \ + m(+1, u64, phy_corrected_bits_lane3, "phy_corrected_bits_lane3", \ + "Total number of corrected bits for lane 3") + #define MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(m) \ m(+1, u64, time_since_last_clear, "time_since_last_clear", \ "Time since the last counters clear event (msec)") \ @@ -523,6 +541,7 @@ struct mlx5e_vport_stats { MLX5E_PPORT_RFC2863_STATS_DEBUG(m) \ MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(m) \ MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(m) \ + MLX5E_PPORT_STATISTICAL_DEBUG(m) \ MLX5E_PCIE_PERFORMANCE_COUNTERS_64(m) \ MLX5E_PCIE_PERFORMANCE_COUNTERS_32(m) \ MLX5E_PCIE_TIMERS_AND_STATES_COUNTERS_32(m) \ @@ -545,6 +564,8 @@ struct mlx5e_vport_stats { (0 MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(MLX5E_STATS_COUNT)) #define MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG_NUM \ (0 MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(MLX5E_STATS_COUNT)) +#define MLX5E_PPORT_STATISTICAL_DEBUG_NUM \ + (0 MLX5E_PPORT_STATISTICAL_DEBUG(MLX5E_STATS_COUNT)) #define MLX5E_PORT_STATS_DEBUG_NUM \ (0 MLX5E_PORT_STATS_DEBUG(MLX5E_STATS_COUNT)) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 11:02:36 2019 (r347309) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 11:03:29 2019 (r347310) @@ -769,6 +769,18 @@ mlx5e_update_pport_counters(struct mlx5e_priv *priv) for (x = 0; x != MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); + /* read Extended Statistical Group */ + if (MLX5_CAP_GEN(mdev, pcam_reg) && + MLX5_CAP_PCAM_FEATURE(mdev, ppcnt_statistical_group) && + MLX5_CAP_PCAM_FEATURE(mdev, per_lane_error_counters)) { + /* read Extended Statistical counter group using predefined counter layout */ + MLX5_SET(ppcnt_reg, in, grp, MLX5_PHYSICAL_LAYER_STATISTICAL_GROUP); + mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); + + for (x = 0; x != MLX5E_PPORT_STATISTICAL_DEBUG_NUM; x++, y++) + s_debug->arg[y] = be64toh(ptr[x]); + } + /* read PCIE counters */ mlx5e_update_pcie_counters(priv); From owner-svn-src-all@freebsd.org Wed May 8 11:04:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17FCE15A6B00; Wed, 8 May 2019 11:04:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F0446D022; Wed, 8 May 2019 11:04:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FCA54F5C; Wed, 8 May 2019 11:04:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B4A46063296; Wed, 8 May 2019 11:04:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B4AIE063295; Wed, 8 May 2019 11:04:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081104.x48B4AIE063295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347311 - head/contrib/ofed/libmlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/contrib/ofed/libmlx5 X-SVN-Commit-Revision: 347311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F0446D022 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:04:11 -0000 Author: hselasky Date: Wed May 8 11:04:09 2019 New Revision: 347311 URL: https://svnweb.freebsd.org/changeset/base/347311 Log: Add ConnectX-6 DX HCA ID to libmlx5. In addition, add "ConnectX family mlx5Gen Virtual Function" device ID. Every new HCA VF will be identified with this device ID. Submitted by: slavash@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/contrib/ofed/libmlx5/mlx5.c Modified: head/contrib/ofed/libmlx5/mlx5.c ============================================================================== --- head/contrib/ofed/libmlx5/mlx5.c Wed May 8 11:03:29 2019 (r347310) +++ head/contrib/ofed/libmlx5/mlx5.c Wed May 8 11:04:09 2019 (r347311) @@ -79,6 +79,8 @@ static struct { HCA(MELLANOX, 4122), /* ConnectX-5 Ex VF */ HCA(MELLANOX, 4123), /* ConnectX-6 */ HCA(MELLANOX, 4124), /* ConnectX-6 VF */ + HCA(MELLANOX, 4125), /* ConnectX-6 DX */ + HCA(MELLANOX, 4126), /* ConnectX family mlx5Gen Virtual Function */ HCA(MELLANOX, 41682), /* BlueField integrated ConnectX-5 network controller */ HCA(MELLANOX, 41683), /* BlueField integrated ConnectX-5 network controller VF */ }; From owner-svn-src-all@freebsd.org Wed May 8 11:04:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DCC115A6B51; Wed, 8 May 2019 11:04:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30BA46D161; Wed, 8 May 2019 11:04:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A03F4F5D; Wed, 8 May 2019 11:04:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B4f2r063381; Wed, 8 May 2019 11:04:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B4f6D063376; Wed, 8 May 2019 11:04:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081104.x48B4f6D063376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347312 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 30BA46D161 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:04:42 -0000 Author: hselasky Date: Wed May 8 11:04:40 2019 New Revision: 347312 URL: https://svnweb.freebsd.org/changeset/base/347312 Log: Add Firmware Reset Level, MFRL, register accessors in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed May 8 11:04:09 2019 (r347311) +++ head/sys/dev/mlx5/device.h Wed May 8 11:04:40 2019 (r347312) @@ -1218,6 +1218,11 @@ enum { MLX5_GEN_EVENT_SUBTYPE_PCI_POWER_CHANGE_EVENT = 0x5, }; +enum { + MLX5_FRL_LEVEL3 = 0x8, + MLX5_FRL_LEVEL6 = 0x40, +}; + /* 8 regular priorities + 1 for multicast */ #define MLX5_NUM_BYPASS_FTS 9 Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 11:04:09 2019 (r347311) +++ head/sys/dev/mlx5/driver.h Wed May 8 11:04:40 2019 (r347312) @@ -154,6 +154,7 @@ enum { MLX5_REG_HOST_ENDIANNESS = 0x7004, MLX5_REG_MTMP = 0x900a, MLX5_REG_MCIA = 0x9014, + MLX5_REG_MFRL = 0x9028, MLX5_REG_MPCNT = 0x9051, MLX5_REG_MCQI = 0x9061, MLX5_REG_MCC = 0x9062, Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 11:04:09 2019 (r347311) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 11:04:40 2019 (r347312) @@ -82,6 +82,8 @@ int mlx5_query_pcam_reg(struct mlx5_core_dev *dev, u32 u8 feature_group, u8 access_reg_group); int mlx5_query_mcam_reg(struct mlx5_core_dev *dev, u32 *mcap, u8 feature_group, u8 access_reg_group); +int mlx5_query_mfrl_reg(struct mlx5_core_dev *mdev, u8 *reset_level); +int mlx5_set_mfrl_reg(struct mlx5_core_dev *mdev, u8 reset_level); int mlx5_cmd_init_hca(struct mlx5_core_dev *dev); int mlx5_cmd_teardown_hca(struct mlx5_core_dev *dev); int mlx5_cmd_force_teardown_hca(struct mlx5_core_dev *dev); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed May 8 11:04:09 2019 (r347311) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed May 8 11:04:40 2019 (r347312) @@ -1210,3 +1210,29 @@ int mlx5_query_pddr_range_info(struct mlx5_core_dev *m return (0); } EXPORT_SYMBOL_GPL(mlx5_query_pddr_range_info); + +int +mlx5_query_mfrl_reg(struct mlx5_core_dev *mdev, u8 *reset_level) +{ + u32 mfrl[MLX5_ST_SZ_DW(mfrl_reg)] = {}; + int sz = MLX5_ST_SZ_BYTES(mfrl_reg); + int err; + + err = mlx5_core_access_reg(mdev, mfrl, sz, mfrl, sz, MLX5_REG_MFRL, + 0, 0); + if (err == 0) + *reset_level = MLX5_GET(mfrl_reg, mfrl, reset_level); + return (err); +} + +int +mlx5_set_mfrl_reg(struct mlx5_core_dev *mdev, u8 reset_level) +{ + u32 mfrl[MLX5_ST_SZ_DW(mfrl_reg)] = {}; + int sz = MLX5_ST_SZ_BYTES(mfrl_reg); + + MLX5_SET(mfrl_reg, mfrl, reset_level, reset_level); + + return (mlx5_core_access_reg(mdev, mfrl, sz, mfrl, sz, MLX5_REG_MFRL, + 0, 1)); +} Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 11:04:09 2019 (r347311) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed May 8 11:04:40 2019 (r347312) @@ -10409,4 +10409,9 @@ struct mlx5_ifc_qpts_reg_bits { u8 trust_state[0x3]; }; +struct mlx5_ifc_mfrl_reg_bits { + u8 reserved_at_0[0x38]; + u8 reset_level[0x8]; +}; + #endif /* MLX5_IFC_H */ From owner-svn-src-all@freebsd.org Wed May 8 11:05:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB77A15A6BB9; Wed, 8 May 2019 11:05:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 920896D27F; Wed, 8 May 2019 11:05:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C2E14F5E; Wed, 8 May 2019 11:05:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B5AYi063465; Wed, 8 May 2019 11:05:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B59UP063457; Wed, 8 May 2019 11:05:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081105.x48B59UP063457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347313 - in head: share/man/man4 sys/dev/mlx5 sys/dev/mlx5/mlx5_core usr.sbin/mlx5tool X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/mlx5 sys/dev/mlx5/mlx5_core usr.sbin/mlx5tool X-SVN-Commit-Revision: 347313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 920896D27F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:05:11 -0000 Author: hselasky Date: Wed May 8 11:05:09 2019 New Revision: 347313 URL: https://svnweb.freebsd.org/changeset/base/347313 Log: Implement firmware reset from userspace in mlx5tool(8). Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/share/man/man4/mlx5io.4 head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c head/sys/dev/mlx5/mlx5io.h head/usr.sbin/mlx5tool/mlx5tool.8 head/usr.sbin/mlx5tool/mlx5tool.c Modified: head/share/man/man4/mlx5io.4 ============================================================================== --- head/share/man/man4/mlx5io.4 Wed May 8 11:04:40 2019 (r347312) +++ head/share/man/man4/mlx5io.4 Wed May 8 11:05:09 2019 (r347313) @@ -142,6 +142,11 @@ Image address in memory is passed in the length of the image is specified in .Dv img_fw_data_len field. +.It Dv MLX5_FW_RESET +Requests PCIe link-level reset on the device. +The address of the device is specified by the +.Vt struct mlx5_tool_addr +structure, which should be passed as an argument. .El .Sh FILES The Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed May 8 11:04:40 2019 (r347312) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed May 8 11:05:09 2019 (r347313) @@ -226,6 +226,24 @@ out: } static int +mlx5_fw_reset(struct mlx5_core_dev *mdev) +{ + device_t dev, bus; + int error; + + error = -mlx5_set_mfrl_reg(mdev, MLX5_FRL_LEVEL3); + if (error == 0) { + dev = mdev->pdev->dev.bsddev; + mtx_lock(&Giant); + bus = device_get_parent(dev); + error = BUS_RESET_CHILD(device_get_parent(bus), bus, + DEVF_RESET_DETACH); + mtx_unlock(&Giant); + } + return (error); +} + +static int mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { @@ -306,6 +324,17 @@ mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_ if (error == 0) error = -mlx5_firmware_flash(mdev, &fake_fw); kmem_free((vm_offset_t)fake_fw.data, fu->img_fw_data_len); + break; + case MLX5_FW_RESET: + if ((fflag & FWRITE) == 0) { + error = EBADF; + break; + } + devaddr = (struct mlx5_tool_addr *)data; + error = mlx5_dbsf_to_core(devaddr, &mdev); + if (error != 0) + break; + error = mlx5_fw_reset(mdev); break; default: error = ENOTTY; Modified: head/sys/dev/mlx5/mlx5io.h ============================================================================== --- head/sys/dev/mlx5/mlx5io.h Wed May 8 11:04:40 2019 (r347312) +++ head/sys/dev/mlx5/mlx5io.h Wed May 8 11:05:09 2019 (r347313) @@ -59,6 +59,7 @@ struct mlx5_fw_update { #define MLX5_FWDUMP_RESET _IOW('m', 2, struct mlx5_tool_addr) #define MLX5_FWDUMP_FORCE _IOW('m', 3, struct mlx5_tool_addr) #define MLX5_FW_UPDATE _IOW('m', 4, struct mlx5_fw_update) +#define MLX5_FW_RESET _IOW('m', 5, struct mlx5_tool_addr) #ifndef _KERNEL #define MLX5_DEV_PATH _PATH_DEV"mlx5ctl" Modified: head/usr.sbin/mlx5tool/mlx5tool.8 ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.8 Wed May 8 11:04:40 2019 (r347312) +++ head/usr.sbin/mlx5tool/mlx5tool.8 Wed May 8 11:05:09 2019 (r347313) @@ -45,6 +45,9 @@ .Nm .Fl d Ar domain:bus:slot:func .Fl f Ar file.mfa2 +.Nm +.Fl d Ar domain:bus:slot:func +.Fl z .Sh DESCRIPTION The .Nm @@ -91,6 +94,14 @@ Flashes the firmware image to the specified adapter. Image must be in MFA2 pack format and contain a component suitable for the adapter hardware. +.Pp +Typically, PCIe link-level reset is required to activate the +newly flashed image, which can be performed by the system reboot +or using the +.Fl z +option. +.It Fl z +Performs PCIe link-level reset on the specified device. .El .Sh FILES The Modified: head/usr.sbin/mlx5tool/mlx5tool.c ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.c Wed May 8 11:04:40 2019 (r347312) +++ head/usr.sbin/mlx5tool/mlx5tool.c Wed May 8 11:05:09 2019 (r347313) @@ -189,17 +189,29 @@ close_fd: return (res); } +static int +mlx5tool_fw_reset(int ctldev, const struct mlx5_tool_addr *addr) +{ + + if (ioctl(ctldev, MLX5_FW_RESET, addr) == -1) { + warn("MLX5_FW_RESET"); + return (1); + } + return (0); +} + static void usage(void) { fprintf(stderr, "Usage: mlx5tool -d pci [-w -o dump.file | -r |" - " -e | -f fw.mfa2]\n"); + " -e | -f fw.mfa2 | -z]\n"); fprintf(stderr, "\t-w - write firmware dump to the specified file\n"); fprintf(stderr, "\t-r - reset dump\n"); fprintf(stderr, "\t-e - force dump\n"); fprintf(stderr, "\t-f fw.img - flash firmware from fw.img\n"); + fprintf(stderr, "\t-z - initiate firmware reset\n"); exit(1); } @@ -208,6 +220,7 @@ enum mlx5_action { ACTION_DUMP_RESET, ACTION_DUMP_FORCE, ACTION_FW_UPDATE, + ACTION_FW_RESET, ACTION_NONE, }; @@ -225,7 +238,7 @@ main(int argc, char *argv[]) addrstr = NULL; dumpname = NULL; img_fw_path = NULL; - while ((c = getopt(argc, argv, "d:ef:ho:rw")) != -1) { + while ((c = getopt(argc, argv, "d:ef:ho:rwz")) != -1) { switch (c) { case 'd': addrstr = optarg; @@ -246,6 +259,9 @@ main(int argc, char *argv[]) act = ACTION_FW_UPDATE; img_fw_path = optarg; break; + case 'z': + act = ACTION_FW_RESET; + break; case 'h': default: usage(); @@ -273,6 +289,9 @@ main(int argc, char *argv[]) break; case ACTION_FW_UPDATE: res = mlx5tool_fw_update(ctldev, &addr, img_fw_path); + break; + case ACTION_FW_RESET: + res = mlx5tool_fw_reset(ctldev, &addr); break; default: res = 0; From owner-svn-src-all@freebsd.org Wed May 8 11:05:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1405015A6BF9; Wed, 8 May 2019 11:05:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEF3A6D390; Wed, 8 May 2019 11:05:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E5AB4F5F; Wed, 8 May 2019 11:05:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B5USY063527; Wed, 8 May 2019 11:05:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B5UgZ063526; Wed, 8 May 2019 11:05:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081105.x48B5UgZ063526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347314 - head/usr.sbin/mlx5tool X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/usr.sbin/mlx5tool X-SVN-Commit-Revision: 347314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AEF3A6D390 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:05:31 -0000 Author: hselasky Date: Wed May 8 11:05:30 2019 New Revision: 347314 URL: https://svnweb.freebsd.org/changeset/base/347314 Log: Ensure that only one command is specified at a time in mlx5tool(8). Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/usr.sbin/mlx5tool/mlx5tool.c Modified: head/usr.sbin/mlx5tool/mlx5tool.c ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.c Wed May 8 11:05:09 2019 (r347313) +++ head/usr.sbin/mlx5tool/mlx5tool.c Wed May 8 11:05:30 2019 (r347314) @@ -244,22 +244,32 @@ main(int argc, char *argv[]) addrstr = optarg; break; case 'w': + if (act != ACTION_NONE) + usage(); act = ACTION_DUMP_GET; break; case 'e': + if (act != ACTION_NONE) + usage(); act = ACTION_DUMP_FORCE; break; case 'o': dumpname = optarg; break; case 'r': + if (act != ACTION_NONE) + usage(); act = ACTION_DUMP_RESET; break; case 'f': + if (act != ACTION_NONE) + usage(); act = ACTION_FW_UPDATE; img_fw_path = optarg; break; case 'z': + if (act != ACTION_NONE) + usage(); act = ACTION_FW_RESET; break; case 'h': From owner-svn-src-all@freebsd.org Wed May 8 11:06:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A662A15A6C76; Wed, 8 May 2019 11:06:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC376D4F8; Wed, 8 May 2019 11:06:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23C754F60; Wed, 8 May 2019 11:06:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B60Aa063596; Wed, 8 May 2019 11:06:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B5xaq063592; Wed, 8 May 2019 11:05:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081105.x48B5xaq063592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347315 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 347315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4AC376D4F8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:06:00 -0000 Author: hselasky Date: Wed May 8 11:05:59 2019 New Revision: 347315 URL: https://svnweb.freebsd.org/changeset/base/347315 Log: Rename functions from mlx5_fwdump to mlx5_ctl in mlx5core. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 11:05:30 2019 (r347314) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 11:05:59 2019 (r347315) @@ -104,8 +104,8 @@ void mlx5e_cleanup(void); int mlx5_rename_eq(struct mlx5_core_dev *dev, int eq_ix, char *name); -int mlx5_fwdump_init(void); -void mlx5_fwdump_fini(void); +int mlx5_ctl_init(void); +void mlx5_ctl_fini(void); void mlx5_fwdump_prep(struct mlx5_core_dev *mdev); void mlx5_fwdump(struct mlx5_core_dev *mdev); void mlx5_fwdump_clean(struct mlx5_core_dev *mdev); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed May 8 11:05:30 2019 (r347314) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed May 8 11:05:59 2019 (r347315) @@ -244,7 +244,7 @@ mlx5_fw_reset(struct mlx5_core_dev *mdev) } static int -mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, +mlx5_ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { struct mlx5_core_dev *mdev; @@ -343,34 +343,34 @@ mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_ return (error); } -static struct cdevsw mlx5_fwdump_devsw = { +static struct cdevsw mlx5_ctl_devsw = { .d_version = D_VERSION, - .d_ioctl = mlx5_fwdump_ioctl, + .d_ioctl = mlx5_ctl_ioctl, }; -static struct cdev *mlx5_fwdump_dev; +static struct cdev *mlx5_ctl_dev; int -mlx5_fwdump_init(void) +mlx5_ctl_init(void) { struct make_dev_args mda; int error; make_dev_args_init(&mda); mda.mda_flags = MAKEDEV_WAITOK | MAKEDEV_CHECKNAME; - mda.mda_devsw = &mlx5_fwdump_devsw; + mda.mda_devsw = &mlx5_ctl_devsw; mda.mda_uid = UID_ROOT; mda.mda_gid = GID_OPERATOR; mda.mda_mode = 0640; - error = make_dev_s(&mda, &mlx5_fwdump_dev, "mlx5ctl"); + error = make_dev_s(&mda, &mlx5_ctl_dev, "mlx5ctl"); return (-error); } void -mlx5_fwdump_fini(void) +mlx5_ctl_fini(void) { - if (mlx5_fwdump_dev != NULL) - destroy_dev(mlx5_fwdump_dev); + if (mlx5_ctl_dev != NULL) + destroy_dev(mlx5_ctl_dev); } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 11:05:30 2019 (r347314) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 11:05:59 2019 (r347315) @@ -1608,13 +1608,13 @@ static int __init init(void) if (err) goto err_debug; - err = mlx5_fwdump_init(); + err = mlx5_ctl_init(); if (err) - goto err_fwdump; + goto err_ctl; return 0; -err_fwdump: +err_ctl: pci_unregister_driver(&mlx5_core_driver); err_debug: @@ -1623,7 +1623,7 @@ err_debug: static void __exit cleanup(void) { - mlx5_fwdump_fini(); + mlx5_ctl_fini(); pci_unregister_driver(&mlx5_core_driver); } From owner-svn-src-all@freebsd.org Wed May 8 11:06:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A15C415A6CBD; Wed, 8 May 2019 11:06:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4795B6D629; Wed, 8 May 2019 11:06:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 224724F61; Wed, 8 May 2019 11:06:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B6N7e063674; Wed, 8 May 2019 11:06:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B6MXK063672; Wed, 8 May 2019 11:06:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081106.x48B6MXK063672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347316 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4795B6D629 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:06:23 -0000 Author: hselasky Date: Wed May 8 11:06:22 2019 New Revision: 347316 URL: https://svnweb.freebsd.org/changeset/base/347316 Log: Fix for compilation warning in mlx5en(4). Function 'mlx5e_alloc_rx_wqe' can never be inlined because it uses alloca (override using the always_inline attribute) MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 11:05:59 2019 (r347315) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 11:06:22 2019 (r347316) @@ -87,6 +87,8 @@ #define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE 0xa #define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xe +#define MLX5E_MAX_BUSDMA_RX_SEGS 15 + #define MLX5E_MAX_RX_SEGS 7 #ifndef MLX5E_MAX_RX_BYTES Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 11:05:59 2019 (r347315) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 11:06:22 2019 (r347316) @@ -2243,6 +2243,9 @@ mlx5e_get_wqe_sz(struct mlx5e_priv *priv, u32 *wqe_sz, for (n = howmany(r, MLX5E_MAX_RX_BYTES); !powerof2(n + 1); n++) ; + if (n > MLX5E_MAX_BUSDMA_RX_SEGS) + return (-ENOMEM); + *wqe_sz = r; *nsegs = n; return (0); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed May 8 11:05:59 2019 (r347315) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed May 8 11:06:22 2019 (r347316) @@ -32,7 +32,7 @@ static inline int mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq, struct mlx5e_rx_wqe *wqe, u16 ix) { - bus_dma_segment_t segs[rq->nsegs]; + bus_dma_segment_t segs[MLX5E_MAX_BUSDMA_RX_SEGS]; struct mbuf *mb; int nsegs; int err; From owner-svn-src-all@freebsd.org Wed May 8 11:06:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F7DF15A6D08; Wed, 8 May 2019 11:06:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 064186D74A; Wed, 8 May 2019 11:06:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2AE14F62; Wed, 8 May 2019 11:06:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B6gcv063738; Wed, 8 May 2019 11:06:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B6gkD063736; Wed, 8 May 2019 11:06:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081106.x48B6gkD063736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347317 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 064186D74A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:06:43 -0000 Author: hselasky Date: Wed May 8 11:06:42 2019 New Revision: 347317 URL: https://svnweb.freebsd.org/changeset/base/347317 Log: Remove non-functional MLX5E_MAX_RX_SEGS macro in mlx5en(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 11:06:22 2019 (r347316) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed May 8 11:06:42 2019 (r347317) @@ -89,19 +89,13 @@ #define MLX5E_MAX_BUSDMA_RX_SEGS 15 -#define MLX5E_MAX_RX_SEGS 7 - #ifndef MLX5E_MAX_RX_BYTES #define MLX5E_MAX_RX_BYTES MCLBYTES #endif -#if (MLX5E_MAX_RX_SEGS == 1) -/* FreeBSD HW LRO is limited by 16KB - the size of max mbuf */ -#define MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ MJUM16BYTES -#else #define MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ \ - MIN(65535, MLX5E_MAX_RX_SEGS * MLX5E_MAX_RX_BYTES) -#endif + MIN(65535, 7 * MLX5E_MAX_RX_BYTES) + #define MLX5E_DIM_DEFAULT_PROFILE 3 #define MLX5E_DIM_MAX_RX_CQ_MODERATION_PKTS_WITH_LRO 16 #define MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_USEC 0x10 Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 11:06:22 2019 (r347316) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 11:06:42 2019 (r347317) @@ -1253,11 +1253,7 @@ mlx5e_create_rq(struct mlx5e_channel *c, rq->mbuf = malloc(wq_sz * sizeof(rq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); for (i = 0; i != wq_sz; i++) { struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(&rq->wq, i); -#if (MLX5E_MAX_RX_SEGS == 1) - uint32_t byte_count = rq->wqe_sz - MLX5E_NET_IP_ALIGN; -#else int j; -#endif err = -bus_dmamap_create(rq->dma_tag, 0, &rq->mbuf[i].dma_map); if (err != 0) { @@ -1267,13 +1263,8 @@ mlx5e_create_rq(struct mlx5e_channel *c, } /* set value for constant fields */ -#if (MLX5E_MAX_RX_SEGS == 1) - wqe->data[0].lkey = c->mkey_be; - wqe->data[0].byte_count = cpu_to_be32(byte_count | MLX5_HW_START_PADDING); -#else for (j = 0; j < rq->nsegs; j++) wqe->data[j].lkey = c->mkey_be; -#endif } INIT_WORK(&rq->dim.work, mlx5e_dim_work); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed May 8 11:06:22 2019 (r347316) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed May 8 11:06:42 2019 (r347317) @@ -36,20 +36,12 @@ mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq, struct mbuf *mb; int nsegs; int err; -#if (MLX5E_MAX_RX_SEGS != 1) struct mbuf *mb_head; int i; -#endif + if (rq->mbuf[ix].mbuf != NULL) return (0); -#if (MLX5E_MAX_RX_SEGS == 1) - mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, rq->wqe_sz); - if (unlikely(!mb)) - return (-ENOMEM); - - mb->m_pkthdr.len = mb->m_len = rq->wqe_sz; -#else mb_head = mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MLX5E_MAX_RX_BYTES); if (unlikely(mb == NULL)) @@ -72,7 +64,7 @@ mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq, } /* rewind to first mbuf in chain */ mb = mb_head; -#endif + /* get IP header aligned */ m_adj(mb, MLX5E_NET_IP_ALIGN); @@ -85,10 +77,7 @@ mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq, err = -ENOMEM; goto err_free_mbuf; } -#if (MLX5E_MAX_RX_SEGS == 1) wqe->data[0].addr = cpu_to_be64(segs[0].ds_addr); -#else - wqe->data[0].addr = cpu_to_be64(segs[0].ds_addr); wqe->data[0].byte_count = cpu_to_be32(segs[0].ds_len | MLX5_HW_START_PADDING); for (i = 1; i != nsegs; i++) { @@ -99,7 +88,6 @@ mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq, wqe->data[i].addr = 0; wqe->data[i].byte_count = 0; } -#endif rq->mbuf[ix].mbuf = mb; rq->mbuf[ix].data = mb->m_data; @@ -257,9 +245,7 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, { struct ifnet *ifp = rq->ifp; struct mlx5e_channel *c; -#if (MLX5E_MAX_RX_SEGS != 1) struct mbuf *mb_head; -#endif int lro_num_seg; /* HW LRO session aggregated packets counter */ uint64_t tstmp; @@ -270,9 +256,6 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, rq->stats.lro_bytes += cqe_bcnt; } -#if (MLX5E_MAX_RX_SEGS == 1) - mb->m_pkthdr.len = mb->m_len = cqe_bcnt; -#else mb->m_pkthdr.len = cqe_bcnt; for (mb_head = mb; mb != NULL; mb = mb->m_next) { if (mb->m_len > cqe_bcnt) @@ -289,7 +272,7 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe, } /* rewind to first mbuf in chain */ mb = mb_head; -#endif + /* check if a Toeplitz hash was computed */ if (cqe->rss_hash_type != 0) { mb->m_pkthdr.flowid = be32_to_cpu(cqe->rss_hash_result); @@ -508,10 +491,8 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget) } if ((MHLEN - MLX5E_NET_IP_ALIGN) >= byte_cnt && (mb = m_gethdr(M_NOWAIT, MT_DATA)) != NULL) { -#if (MLX5E_MAX_RX_SEGS != 1) /* set maximum mbuf length */ mb->m_len = MHLEN - MLX5E_NET_IP_ALIGN; -#endif /* get IP header aligned */ mb->m_data += MLX5E_NET_IP_ALIGN; From owner-svn-src-all@freebsd.org Wed May 8 11:07:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91EFB15A6D62; Wed, 8 May 2019 11:07:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 373456D86D; Wed, 8 May 2019 11:07:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13D8A4F63; Wed, 8 May 2019 11:07:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B70J0063808; Wed, 8 May 2019 11:07:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B70Z4063807; Wed, 8 May 2019 11:07:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081107.x48B70Z4063807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347318 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 347318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 373456D86D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:07:01 -0000 Author: hselasky Date: Wed May 8 11:07:00 2019 New Revision: 347318 URL: https://svnweb.freebsd.org/changeset/base/347318 Log: Make command timeout way shorter in mlx5core. The command timeout is terribly long, whole two hours. Make it 60s so if things do go wrong, the user gets feedback in relatively short time, so they can take corrective actions and/or investigate using tools and such. Linux commit: 6b6c07bdcdc97ccac2596063bfc32a5faddfe884 MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 11:06:42 2019 (r347317) +++ head/sys/dev/mlx5/driver.h Wed May 8 11:07:00 2019 (r347318) @@ -55,7 +55,7 @@ enum { }; enum { - MLX5_CMD_TIMEOUT_MSEC = 8 * 60 * 1000, + MLX5_CMD_TIMEOUT_MSEC = 60 * 1000, MLX5_CMD_WQ_MAX_NAME = 32, }; From owner-svn-src-all@freebsd.org Wed May 8 11:07:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38B2C15A6DC1; Wed, 8 May 2019 11:07:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CA7A6D9A4; Wed, 8 May 2019 11:07:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 676704F64; Wed, 8 May 2019 11:07:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B7Ltb063872; Wed, 8 May 2019 11:07:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B7L7r063871; Wed, 8 May 2019 11:07:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081107.x48B7L7r063871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347319 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8CA7A6D9A4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:07:22 -0000 Author: hselasky Date: Wed May 8 11:07:20 2019 New Revision: 347319 URL: https://svnweb.freebsd.org/changeset/base/347319 Log: Flush command workqueue when command completion is triggered in mlx5core. Avoid race for command completion when triggering a command completions event. Serialize operation by queueing all commands on the same work queue. This can happen when healthcare triggers. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_health.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 11:07:00 2019 (r347318) +++ head/sys/dev/mlx5/driver.h Wed May 8 11:07:20 2019 (r347319) @@ -515,6 +515,7 @@ struct mlx5_core_health { struct work_struct work; struct delayed_work recover_work; unsigned int last_reset_req; + struct work_struct work_cmd_completion; }; #ifdef RATELIMIT Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 11:07:00 2019 (r347318) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 11:07:20 2019 (r347319) @@ -135,8 +135,10 @@ static bool sensor_fw_synd_rfr(struct mlx5_core_dev *d return rfr && synd; } -static void mlx5_trigger_cmd_completions(struct mlx5_core_dev *dev) +static void mlx5_trigger_cmd_completions(struct work_struct *work) { + struct mlx5_core_dev *dev = + container_of(work, struct mlx5_core_dev, priv.health.work_cmd_completion); unsigned long flags; u64 vector; @@ -271,7 +273,15 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, return; if (!force) mlx5_core_err(dev, "internal state error detected\n"); - mlx5_trigger_cmd_completions(dev); + + /* + * Queue the command completion handler on the command + * work queue to avoid racing with the real command + * completion handler and then wait for it to + * complete: + */ + queue_work(dev->cmd.wq, &dev->priv.health.work_cmd_completion); + flush_workqueue(dev->cmd.wq); } mutex_lock(&dev->intf_state_mutex); @@ -693,6 +703,7 @@ int mlx5_health_init(struct mlx5_core_dev *dev) spin_lock_init(&health->wq_lock); INIT_WORK(&health->work, health_care); INIT_WORK(&health->work_watchdog, health_watchdog); + INIT_WORK(&health->work_cmd_completion, mlx5_trigger_cmd_completions); INIT_DELAYED_WORK(&health->recover_work, health_recover); return 0; From owner-svn-src-all@freebsd.org Wed May 8 11:07:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F1B415A6E29; Wed, 8 May 2019 11:07:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F10D36DAE1; Wed, 8 May 2019 11:07:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBE144F65; Wed, 8 May 2019 11:07:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B7gKX063936; Wed, 8 May 2019 11:07:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B7gpB063935; Wed, 8 May 2019 11:07:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081107.x48B7gpB063935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347320 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F10D36DAE1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:07:43 -0000 Author: hselasky Date: Wed May 8 11:07:42 2019 New Revision: 347320 URL: https://svnweb.freebsd.org/changeset/base/347320 Log: Make sure the flow destination structure does not use values off the stack in mlx5en(4). MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed May 8 11:07:20 2019 (r347319) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed May 8 11:07:42 2019 (r347320) @@ -227,7 +227,7 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, struct mlx5e_eth_addr_info *ai, int type, u32 *mc, u32 *mv) { - struct mlx5_flow_destination dest; + struct mlx5_flow_destination dest = {}; u8 mc_enable = 0; struct mlx5_flow_rule **rule_p; struct mlx5_flow_table *ft = priv->fts.main.t; @@ -507,7 +507,7 @@ mlx5e_add_vlan_rule_sub(struct mlx5e_priv *priv, u32 *mc, u32 *mv) { struct mlx5_flow_table *ft = priv->fts.vlan.t; - struct mlx5_flow_destination dest; + struct mlx5_flow_destination dest = {}; u8 mc_enable = 0; struct mlx5_flow_rule **rule_p; int err = 0; From owner-svn-src-all@freebsd.org Wed May 8 11:08:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 849DC15A6E98; Wed, 8 May 2019 11:08:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 181CB6DC0D; Wed, 8 May 2019 11:08:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E51B14F67; Wed, 8 May 2019 11:08:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B81RV064005; Wed, 8 May 2019 11:08:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B81rI064004; Wed, 8 May 2019 11:08:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081108.x48B81rI064004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347321 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 181CB6DC0D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:08:02 -0000 Author: hselasky Date: Wed May 8 11:08:01 2019 New Revision: 347321 URL: https://svnweb.freebsd.org/changeset/base/347321 Log: Undo previous steps upon returning failure in mlx5en(4). Else flowtable resources may not be properly freed. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed May 8 11:07:42 2019 (r347320) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed May 8 11:08:01 2019 (r347321) @@ -633,7 +633,11 @@ mlx5e_add_any_vid_rules(struct mlx5e_priv *priv) if (err) return (err); - return (mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_STAG_VID, 0)); + err = mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_STAG_VID, 0); + if (err) + mlx5e_del_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_ANY_CTAG_VID, 0); + + return (err); } void @@ -701,19 +705,22 @@ mlx5e_add_all_vlan_rules(struct mlx5e_priv *priv) err = mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_MATCH_VID, i); if (err) - return (err); + goto error; } err = mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_UNTAGGED, 0); if (err) - return (err); + goto error; if (priv->vlan.filter_disabled) { err = mlx5e_add_any_vid_rules(priv); if (err) - return (err); + goto error; } return (0); +error: + mlx5e_del_all_vlan_rules(priv); + return (err); } void From owner-svn-src-all@freebsd.org Wed May 8 11:08:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B45515A6EF7; Wed, 8 May 2019 11:08:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B03A36DD5D; Wed, 8 May 2019 11:08:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BB7E4F68; Wed, 8 May 2019 11:08:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B8LGL064067; Wed, 8 May 2019 11:08:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B8Lst064066; Wed, 8 May 2019 11:08:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081108.x48B8Lst064066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347322 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B03A36DD5D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:08:22 -0000 Author: hselasky Date: Wed May 8 11:08:21 2019 New Revision: 347322 URL: https://svnweb.freebsd.org/changeset/base/347322 Log: Ensure the flowtable rules are not freed twice in mlx5en(4). This can happen when re-loading the driver. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed May 8 11:08:01 2019 (r347321) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Wed May 8 11:08:21 2019 (r347322) @@ -131,6 +131,9 @@ mlx5e_del_eth_addr_from_flow_table(struct mlx5e_priv * if (ai->tt_vec & (1 << MLX5E_TT_ANY)) mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_ANY]); + + /* ensure the rules are not freed again */ + ai->tt_vec = 0; } static int From owner-svn-src-all@freebsd.org Wed May 8 11:08:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE13A15A6F5F; Wed, 8 May 2019 11:08:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65D216DE97; Wed, 8 May 2019 11:08:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 393904F69; Wed, 8 May 2019 11:08:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B8nGZ064143; Wed, 8 May 2019 11:08:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B8m1R064141; Wed, 8 May 2019 11:08:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081108.x48B8m1R064141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347323 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65D216DE97 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:08:50 -0000 Author: hselasky Date: Wed May 8 11:08:48 2019 New Revision: 347323 URL: https://svnweb.freebsd.org/changeset/base/347323 Log: Fix race between driver unload and dumping firmware in mlx5core. Present code uses lock-less accesses to the dump data to prevent top level ioctls from blocking bottom-level call to dump. Unfortunately, this depends on the type stability of the dump data structure, which makes it non-functional during driver teardown. Switch to the mutex locking scheme where top levels use the mutex in the bound regions, while copyouts and drain for completion utilize condvars. The mutex lifetime is guaranteed to be strictly larger than the time interval where driver can initiate dump, and most of the control fields of the old struct mlx5_dump_data are directly embedded into struct mlx5_core_dev. Submitted by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 11:08:21 2019 (r347322) +++ head/sys/dev/mlx5/driver.h Wed May 8 11:08:48 2019 (r347323) @@ -664,7 +664,6 @@ struct mlx5_special_contexts { }; struct mlx5_flow_root_namespace; -struct mlx5_dump_data; struct mlx5_core_dev { struct pci_dev *pdev; /* sync pci state */ @@ -704,7 +703,12 @@ struct mlx5_core_dev { struct mlx5_flow_root_namespace *sniffer_rx_root_ns; struct mlx5_flow_root_namespace *sniffer_tx_root_ns; u32 num_q_counter_allocated[MLX5_INTERFACE_NUMBER]; - struct mlx5_dump_data *dump_data; + const struct mlx5_crspace_regmap *dump_rege; + uint32_t *dump_data; + unsigned dump_size; + bool dump_valid; + bool dump_copyout; + struct mtx dump_lock; struct sysctl_ctx_list sysctl_ctx; int msix_eqvec; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed May 8 11:08:21 2019 (r347322) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Wed May 8 11:08:48 2019 (r347323) @@ -39,14 +39,6 @@ extern const struct mlx5_crspace_regmap mlx5_crspace_r extern const struct mlx5_crspace_regmap mlx5_crspace_regmap_mt4115[]; extern const struct mlx5_crspace_regmap mlx5_crspace_regmap_connectx5[]; -struct mlx5_dump_data { - const struct mlx5_crspace_regmap *rege; - uint32_t *dump; - unsigned dump_size; - int dump_valid; - struct mtx dump_lock; -}; - static MALLOC_DEFINE(M_MLX5_DUMP, "MLX5DUMP", "MLX5 Firmware dump"); static unsigned @@ -61,20 +53,20 @@ mlx5_fwdump_getsize(const struct mlx5_crspace_regmap * } static void -mlx5_fwdump_destroy_dd(struct mlx5_dump_data *dd) +mlx5_fwdump_destroy_dd(struct mlx5_core_dev *mdev) { - mtx_destroy(&dd->dump_lock); - free(dd->dump, M_MLX5_DUMP); - free(dd, M_MLX5_DUMP); + mtx_assert(&mdev->dump_lock, MA_OWNED); + free(mdev->dump_data, M_MLX5_DUMP); + mdev->dump_data = NULL; } void mlx5_fwdump_prep(struct mlx5_core_dev *mdev) { - struct mlx5_dump_data *dd; int error; + mdev->dump_data = NULL; error = mlx5_vsc_find_cap(mdev); if (error != 0) { /* Inability to create a firmware dump is not fatal. */ @@ -82,47 +74,39 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) "mlx5_fwdump_prep failed %d\n", error); return; } - dd = malloc(sizeof(struct mlx5_dump_data), M_MLX5_DUMP, M_WAITOK); switch (pci_get_device(mdev->pdev->dev.bsddev)) { case 0x1013: - dd->rege = mlx5_crspace_regmap_mt4115; + mdev->dump_rege = mlx5_crspace_regmap_mt4115; break; case 0x1015: - dd->rege = mlx5_crspace_regmap_mt4117; + mdev->dump_rege = mlx5_crspace_regmap_mt4117; break; case 0x1017: case 0x1019: - dd->rege = mlx5_crspace_regmap_connectx5; + mdev->dump_rege = mlx5_crspace_regmap_connectx5; break; default: - free(dd, M_MLX5_DUMP); return; /* silently fail, do not prevent driver attach */ } - dd->dump_size = mlx5_fwdump_getsize(dd->rege); - dd->dump = malloc(dd->dump_size * sizeof(uint32_t), M_MLX5_DUMP, - M_WAITOK | M_ZERO); - dd->dump_valid = 0; - mtx_init(&dd->dump_lock, "mlx5dmp", NULL, MTX_DEF | MTX_NEW); - if (atomic_cmpset_rel_ptr((uintptr_t *)&mdev->dump_data, 0, - (uintptr_t)dd) == 0) - mlx5_fwdump_destroy_dd(dd); + mdev->dump_size = mlx5_fwdump_getsize(mdev->dump_rege); + mdev->dump_data = malloc(mdev->dump_size * sizeof(uint32_t), + M_MLX5_DUMP, M_WAITOK | M_ZERO); + mdev->dump_valid = false; + mdev->dump_copyout = false; } void mlx5_fwdump(struct mlx5_core_dev *mdev) { - struct mlx5_dump_data *dd; const struct mlx5_crspace_regmap *r; uint32_t i, ri; int error; dev_info(&mdev->pdev->dev, "Issuing FW dump\n"); - dd = (struct mlx5_dump_data *)atomic_load_acq_ptr((uintptr_t *) - &mdev->dump_data); - if (dd == NULL) - return; - mtx_lock(&dd->dump_lock); - if (dd->dump_valid) { + mtx_lock(&mdev->dump_lock); + if (mdev->dump_data == NULL) + goto failed; + if (mdev->dump_valid) { /* only one dump */ dev_warn(&mdev->pdev->dev, "Only one FW dump can be captured aborting FW dump\n"); @@ -136,37 +120,51 @@ mlx5_fwdump(struct mlx5_core_dev *mdev) error = mlx5_vsc_set_space(mdev, MLX5_VSC_DOMAIN_PROTECTED_CRSPACE); if (error != 0) goto unlock_vsc; - for (i = 0, r = dd->rege; r->cnt != 0; r++) { + for (i = 0, r = mdev->dump_rege; r->cnt != 0; r++) { for (ri = 0; ri < r->cnt; ri++) { error = mlx5_vsc_read(mdev, r->addr + ri * 4, - &dd->dump[i]); + &mdev->dump_data[i]); if (error != 0) goto unlock_vsc; i++; } } - atomic_store_rel_int(&dd->dump_valid, 1); + mdev->dump_valid = true; unlock_vsc: mlx5_vsc_unlock(mdev); failed: - mtx_unlock(&dd->dump_lock); + mtx_unlock(&mdev->dump_lock); } void mlx5_fwdump_clean(struct mlx5_core_dev *mdev) { - struct mlx5_dump_data *dd; - for (;;) { - dd = mdev->dump_data; - if (dd == NULL) - return; - if (atomic_cmpset_ptr((uintptr_t *)&mdev->dump_data, - (uintptr_t)dd, 0) == 1) { - mlx5_fwdump_destroy_dd(dd); - return; + mtx_lock(&mdev->dump_lock); + while (mdev->dump_copyout) + msleep(&mdev->dump_copyout, &mdev->dump_lock, 0, "mlx5fwc", 0); + mlx5_fwdump_destroy_dd(mdev); + mtx_unlock(&mdev->dump_lock); +} + +static int +mlx5_fwdump_reset(struct mlx5_core_dev *mdev) +{ + int error; + + error = 0; + mtx_lock(&mdev->dump_lock); + if (mdev->dump_data != NULL) { + while (mdev->dump_copyout) { + msleep(&mdev->dump_copyout, &mdev->dump_lock, + 0, "mlx5fwr", 0); } + mdev->dump_valid = false; + } else { + error = ENOENT; } + mtx_unlock(&mdev->dump_lock); + return (error); } static int @@ -190,29 +188,37 @@ mlx5_dbsf_to_core(const struct mlx5_tool_addr *devaddr } static int -mlx5_fwdump_copyout(struct mlx5_dump_data *dd, struct mlx5_fwdump_get *fwg) +mlx5_fwdump_copyout(struct mlx5_core_dev *mdev, struct mlx5_fwdump_get *fwg) { const struct mlx5_crspace_regmap *r; struct mlx5_fwdump_reg rv, *urv; uint32_t i, ri; int error; - if (dd == NULL) + mtx_lock(&mdev->dump_lock); + if (mdev->dump_data == NULL) { + mtx_unlock(&mdev->dump_lock); return (ENOENT); + } if (fwg->buf == NULL) { - fwg->reg_filled = dd->dump_size; + fwg->reg_filled = mdev->dump_size; + mtx_unlock(&mdev->dump_lock); return (0); } - if (atomic_load_acq_int(&dd->dump_valid) == 0) + if (!mdev->dump_valid) { + mtx_unlock(&mdev->dump_lock); return (ENOENT); + } + mdev->dump_copyout = true; + mtx_unlock(&mdev->dump_lock); urv = fwg->buf; - for (i = 0, r = dd->rege; r->cnt != 0; r++) { + for (i = 0, r = mdev->dump_rege; r->cnt != 0; r++) { for (ri = 0; ri < r->cnt; ri++) { if (i >= fwg->reg_cnt) goto out; rv.addr = r->addr + ri * 4; - rv.val = dd->dump[i]; + rv.val = mdev->dump_data[i]; error = copyout(&rv, urv, sizeof(rv)); if (error != 0) return (error); @@ -222,6 +228,10 @@ mlx5_fwdump_copyout(struct mlx5_dump_data *dd, struct } out: fwg->reg_filled = i; + mtx_lock(&mdev->dump_lock); + mdev->dump_copyout = false; + wakeup(&mdev->dump_copyout); + mtx_unlock(&mdev->dump_lock); return (0); } @@ -250,7 +260,6 @@ mlx5_ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t d struct mlx5_core_dev *mdev; struct mlx5_fwdump_get *fwg; struct mlx5_tool_addr *devaddr; - struct mlx5_dump_data *dd; struct mlx5_fw_update *fu; struct firmware fake_fw; int error; @@ -267,7 +276,7 @@ mlx5_ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t d error = mlx5_dbsf_to_core(devaddr, &mdev); if (error != 0) break; - error = mlx5_fwdump_copyout(mdev->dump_data, fwg); + error = mlx5_fwdump_copyout(mdev, fwg); break; case MLX5_FWDUMP_RESET: if ((fflag & FWRITE) == 0) { @@ -276,13 +285,8 @@ mlx5_ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t d } devaddr = (struct mlx5_tool_addr *)data; error = mlx5_dbsf_to_core(devaddr, &mdev); - if (error != 0) - break; - dd = mdev->dump_data; - if (dd != NULL) - atomic_store_rel_int(&dd->dump_valid, 0); - else - error = ENOENT; + if (error == 0) + error = mlx5_fwdump_reset(mdev); break; case MLX5_FWDUMP_FORCE: if ((fflag & FWRITE) == 0) { Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 11:08:21 2019 (r347322) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 8 11:08:48 2019 (r347323) @@ -1301,6 +1301,7 @@ static int init_one(struct pci_dev *pdev, spin_lock_init(&priv->ctx_lock); mutex_init(&dev->pci_status_mutex); mutex_init(&dev->intf_state_mutex); + mtx_init(&dev->dump_lock, "mlx5dmp", NULL, MTX_DEF | MTX_NEW); err = mlx5_pci_init(dev, priv); if (err) { device_printf(bsddev, "ERR: mlx5_pci_init failed %d\n", err); @@ -1335,6 +1336,7 @@ close_pci: mlx5_pci_close(dev, priv); clean_dev: sysctl_ctx_free(&dev->sysctl_ctx); + mtx_destroy(&dev->dump_lock); kfree(dev); return err; } @@ -1350,10 +1352,11 @@ static void remove_one(struct pci_dev *pdev) return; } - mlx5_fwdump_clean(dev); mlx5_pagealloc_cleanup(dev); mlx5_health_cleanup(dev); + mlx5_fwdump_clean(dev); mlx5_pci_close(dev, priv); + mtx_destroy(&dev->dump_lock); pci_set_drvdata(pdev, NULL); sysctl_ctx_free(&dev->sysctl_ctx); kfree(dev); From owner-svn-src-all@freebsd.org Wed May 8 11:09:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11C9215A6FC5; Wed, 8 May 2019 11:09:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABBFB6DFEC; Wed, 8 May 2019 11:09:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 867C04F6A; Wed, 8 May 2019 11:09:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48B997n064211; Wed, 8 May 2019 11:09:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48B98co064208; Wed, 8 May 2019 11:09:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081109.x48B98co064208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347324 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ABBFB6DFEC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:09:10 -0000 Author: hselasky Date: Wed May 8 11:09:08 2019 New Revision: 347324 URL: https://svnweb.freebsd.org/changeset/base/347324 Log: Make command workqueue persistant in mlx5core. There is no reason to re-create the command workqueue during healthcare. This also fixes an issue where a previous work struct may refer to a destroyed workqueue. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c head/sys/dev/mlx5/mlx5_core/mlx5_health.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed May 8 11:08:48 2019 (r347323) +++ head/sys/dev/mlx5/driver.h Wed May 8 11:09:08 2019 (r347324) @@ -56,7 +56,6 @@ enum { enum { MLX5_CMD_TIMEOUT_MSEC = 60 * 1000, - MLX5_CMD_WQ_MAX_NAME = 32, }; enum { @@ -353,8 +352,6 @@ struct mlx5_cmd { spinlock_t token_lock; u8 token; unsigned long bitmask; - char wq_name[MLX5_CMD_WQ_MAX_NAME]; - struct workqueue_struct *wq; struct semaphore sem; struct semaphore pages_sem; enum mlx5_cmd_mode mode; @@ -516,6 +513,7 @@ struct mlx5_core_health { struct delayed_work recover_work; unsigned int last_reset_req; struct work_struct work_cmd_completion; + struct workqueue_struct *wq_cmd; }; #ifdef RATELIMIT Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed May 8 11:08:48 2019 (r347323) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed May 8 11:09:08 2019 (r347324) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2019, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -997,7 +997,7 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, INIT_WORK(&ent->work, cmd_work_handler); if (page_queue) { cmd_work_handler(&ent->work); - } else if (!queue_work(cmd->wq, &ent->work)) { + } else if (!queue_work(dev->priv.health.wq_cmd, &ent->work)) { mlx5_core_warn(dev, "failed to queue work\n"); err = -ENOMEM; goto out_free; @@ -1127,14 +1127,6 @@ mlx5_free_cmd_msg(struct mlx5_core_dev *dev, struct ml mlx5_fwp_free(msg); } -static void set_wqname(struct mlx5_core_dev *dev) -{ - struct mlx5_cmd *cmd = &dev->cmd; - - snprintf(cmd->wq_name, sizeof(cmd->wq_name), "mlx5_cmd_%s", - dev_name(&dev->pdev->dev)); -} - static void clean_debug_files(struct mlx5_core_dev *dev) { } @@ -1562,20 +1554,8 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) device_printf((&dev->pdev->dev)->bsddev, "ERR: ""failed to create command cache\n"); goto err_free_page; } - - set_wqname(dev); - cmd->wq = create_singlethread_workqueue(cmd->wq_name); - if (!cmd->wq) { - device_printf((&dev->pdev->dev)->bsddev, "ERR: ""failed to create command workqueue\n"); - err = -ENOMEM; - goto err_cache; - } - return 0; -err_cache: - destroy_msg_cache(dev); - err_free_page: free_cmd_page(dev, cmd); @@ -1589,7 +1569,7 @@ void mlx5_cmd_cleanup(struct mlx5_core_dev *dev) struct mlx5_cmd *cmd = &dev->cmd; clean_debug_files(dev); - destroy_workqueue(cmd->wq); + flush_workqueue(dev->priv.health.wq_cmd); destroy_msg_cache(dev); free_cmd_page(dev, cmd); } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 11:08:48 2019 (r347323) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Wed May 8 11:09:08 2019 (r347324) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2019, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -280,8 +280,8 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, * completion handler and then wait for it to * complete: */ - queue_work(dev->cmd.wq, &dev->priv.health.work_cmd_completion); - flush_workqueue(dev->cmd.wq); + queue_work(dev->priv.health.wq_cmd, &dev->priv.health.work_cmd_completion); + flush_workqueue(dev->priv.health.wq_cmd); } mutex_lock(&dev->intf_state_mutex); @@ -679,6 +679,7 @@ void mlx5_health_cleanup(struct mlx5_core_dev *dev) destroy_workqueue(health->wq); destroy_workqueue(health->wq_watchdog); + destroy_workqueue(health->wq_cmd); } int mlx5_health_init(struct mlx5_core_dev *dev) @@ -691,15 +692,18 @@ int mlx5_health_init(struct mlx5_core_dev *dev) snprintf(name, sizeof(name), "%s-rec", dev_name(&dev->pdev->dev)); health->wq = create_singlethread_workqueue(name); if (!health->wq) - return -ENOMEM; + goto err_recovery; snprintf(name, sizeof(name), "%s-wdg", dev_name(&dev->pdev->dev)); health->wq_watchdog = create_singlethread_workqueue(name); - if (!health->wq_watchdog) { - destroy_workqueue(health->wq); - return -ENOMEM; - } + if (!health->wq_watchdog) + goto err_watchdog; + snprintf(name, sizeof(name), "%s-cmd", dev_name(&dev->pdev->dev)); + health->wq_cmd = create_singlethread_workqueue(name); + if (!health->wq_cmd) + goto err_cmd; + spin_lock_init(&health->wq_lock); INIT_WORK(&health->work, health_care); INIT_WORK(&health->work_watchdog, health_watchdog); @@ -707,4 +711,11 @@ int mlx5_health_init(struct mlx5_core_dev *dev) INIT_DELAYED_WORK(&health->recover_work, health_recover); return 0; + +err_cmd: + destroy_workqueue(health->wq_watchdog); +err_watchdog: + destroy_workqueue(health->wq); +err_recovery: + return -ENOMEM; } From owner-svn-src-all@freebsd.org Wed May 8 11:15:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DAB115A74F3; Wed, 8 May 2019 11:15:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D72826E70A; Wed, 8 May 2019 11:15:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1163510A; Wed, 8 May 2019 11:15:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48BF8al069321; Wed, 8 May 2019 11:15:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48BF760069312; Wed, 8 May 2019 11:15:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081115.x48BF760069312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 11:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347325 - in head/sys: dev/mlx4/mlx4_core dev/mlx4/mlx4_ib dev/mlx5/mlx5_core dev/mlx5/mlx5_en dev/mlx5/mlx5_ib sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: dev/mlx4/mlx4_core dev/mlx4/mlx4_ib dev/mlx5/mlx5_core dev/mlx5/mlx5_en dev/mlx5/mlx5_ib sys X-SVN-Commit-Revision: 347325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D72826E70A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 11:15:09 -0000 Author: hselasky Date: Wed May 8 11:15:07 2019 New Revision: 347325 URL: https://svnweb.freebsd.org/changeset/base/347325 Log: Bump the Mellanox driver version numbers and the FreeBSD version number. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_core/mlx4.h head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c head/sys/sys/param.h Modified: head/sys/dev/mlx4/mlx4_core/mlx4.h ============================================================================== --- head/sys/dev/mlx4/mlx4_core/mlx4.h Wed May 8 11:09:08 2019 (r347324) +++ head/sys/dev/mlx4/mlx4_core/mlx4.h Wed May 8 11:15:07 2019 (r347325) @@ -53,8 +53,8 @@ #define DRV_NAME "mlx4_core" #define PFX DRV_NAME ": " -#define DRV_VERSION "3.5.0" -#define DRV_RELDATE "November 2018" +#define DRV_VERSION "3.5.1" +#define DRV_RELDATE "April 2019" #define MLX4_FS_UDP_UC_EN (1 << 1) #define MLX4_FS_TCP_UC_EN (1 << 2) Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Wed May 8 11:09:08 2019 (r347324) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Wed May 8 11:15:07 2019 (r347325) @@ -64,9 +64,9 @@ #define DRV_NAME MLX4_IB_DRV_NAME #ifndef DRV_VERSION -#define DRV_VERSION "3.5.0" +#define DRV_VERSION "3.5.1" #endif -#define DRV_RELDATE "November 2018" +#define DRV_RELDATE "April 2019" #define MLX4_IB_FLOW_MAX_PRIO 0xFFF #define MLX4_IB_FLOW_QPN_MASK 0xFFFFFF Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 11:09:08 2019 (r347324) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Wed May 8 11:15:07 2019 (r347325) @@ -36,9 +36,9 @@ #define DRIVER_NAME "mlx5_core" #ifndef DRIVER_VERSION -#define DRIVER_VERSION "3.5.0" +#define DRIVER_VERSION "3.5.1" #endif -#define DRIVER_RELDATE "November 2018" +#define DRIVER_RELDATE "April 2019" extern int mlx5_core_debug_mask; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 11:09:08 2019 (r347324) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 11:15:07 2019 (r347325) @@ -31,9 +31,9 @@ #include #ifndef ETH_DRIVER_VERSION -#define ETH_DRIVER_VERSION "3.5.0" +#define ETH_DRIVER_VERSION "3.5.1" #endif -#define DRIVER_RELDATE "November 2018" +#define DRIVER_RELDATE "April 2019" static const char mlx5e_version[] = "mlx5en: Mellanox Ethernet driver " ETH_DRIVER_VERSION " (" DRIVER_RELDATE ")\n"; Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 11:09:08 2019 (r347324) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed May 8 11:15:07 2019 (r347325) @@ -52,9 +52,9 @@ #define DRIVER_NAME "mlx5ib" #ifndef DRIVER_VERSION -#define DRIVER_VERSION "3.5.0" +#define DRIVER_VERSION "3.5.1" #endif -#define DRIVER_RELDATE "November 2018" +#define DRIVER_RELDATE "April 2019" MODULE_DESCRIPTION("Mellanox Connect-IB HCA IB driver"); MODULE_LICENSE("Dual BSD/GPL"); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed May 8 11:09:08 2019 (r347324) +++ head/sys/sys/param.h Wed May 8 11:15:07 2019 (r347325) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300023 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300024 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Wed May 8 12:27:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6282F158341F; Wed, 8 May 2019 12:27:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0757270C54; Wed, 8 May 2019 12:27:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D41525CB3; Wed, 8 May 2019 12:27:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48CRGow006289; Wed, 8 May 2019 12:27:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48CRGqG006288; Wed, 8 May 2019 12:27:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081227.x48CRGqG006288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 12:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347326 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0757270C54 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 12:27:17 -0000 Author: hselasky Date: Wed May 8 12:27:16 2019 New Revision: 347326 URL: https://svnweb.freebsd.org/changeset/base/347326 Log: Fix LINT compilation issue. "mdev" is unused when building LINT targets. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed May 8 11:15:07 2019 (r347325) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed May 8 12:27:16 2019 (r347326) @@ -1141,7 +1141,6 @@ mlx5e_create_diagnostics(struct mlx5e_priv *priv) void mlx5e_create_ethtool(struct mlx5e_priv *priv) { - struct mlx5_core_dev *mdev = priv->mdev; struct sysctl_oid *node, *qos_node; const char *pnameunit; unsigned x; @@ -1289,7 +1288,7 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(qos_node), OID_AUTO, "trust_state", CTLTYPE_U8 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, priv, 0, mlx5e_trust_state_handler, "CU", - MLX5_CAP_QCAM_FEATURE(mdev, qpts_trust_both) ? + MLX5_CAP_QCAM_FEATURE(priv->mdev, qpts_trust_both) ? A B : A); #undef B #undef A From owner-svn-src-all@freebsd.org Wed May 8 12:28:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7642815834B4; Wed, 8 May 2019 12:28:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1906070DBC; Wed, 8 May 2019 12:28:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 049985CB4; Wed, 8 May 2019 12:28:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48CSBGS006367; Wed, 8 May 2019 12:28:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48CSBVD006366; Wed, 8 May 2019 12:28:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905081228.x48CSBVD006366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 May 2019 12:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347327 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 347327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1906070DBC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 12:28:12 -0000 Author: hselasky Date: Wed May 8 12:28:11 2019 New Revision: 347327 URL: https://svnweb.freebsd.org/changeset/base/347327 Log: Fix LINT linking issue. Add missing mlxfw symbols to LINT builds. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed May 8 12:27:16 2019 (r347326) +++ head/sys/conf/NOTES Wed May 8 12:28:11 2019 (r347327) @@ -1961,6 +1961,7 @@ device xmphy # XaQti XMAC II # Yukon II Gigabit controllers, including 88E8021, 88E8022, 88E8061, # 88E8062, 88E8035, 88E8036, 88E8038, 88E8050, 88E8052, 88E8053, # 88E8055, 88E8056 and D-Link 560T/550SX. +# mlxfw: Mellanox firmware update module. # mlx5: Mellanox ConnectX-4 and ConnectX-4 LX IB and Eth shared code module. # mlx5en:Mellanox ConnectX-4 and ConnectX-4 LX PCIe Ethernet adapters. # my: Myson Fast Ethernet (MTD80X, MTD89X) @@ -2074,6 +2075,7 @@ device gem # Apple GMAC/Sun ERI/Sun GEM device hme # Sun HME (Happy Meal Ethernet) device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet device lge # Level 1 LXT1001 gigabit Ethernet +device mlxfw # Mellanox firmware update module device mlx5 # Shared code module between IB and Ethernet device mlx5en # Mellanox ConnectX-4 and ConnectX-4 LX device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet From owner-svn-src-all@freebsd.org Wed May 8 13:35:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A42F15852F3; Wed, 8 May 2019 13:35:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D17E57333E; Wed, 8 May 2019 13:35:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7299686F; Wed, 8 May 2019 13:35:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48DZpsh043502; Wed, 8 May 2019 13:35:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48DZpXG043500; Wed, 8 May 2019 13:35:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905081335.x48DZpXG043500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 8 May 2019 13:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347328 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 347328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D17E57333E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 13:35:52 -0000 Author: emaste Date: Wed May 8 13:35:51 2019 New Revision: 347328 URL: https://svnweb.freebsd.org/changeset/base/347328 Log: Avoid literal @generated tag in file-generating scripts We don't want the generator itself tagged as a generated file. Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20182 Modified: head/sys/tools/makeobjops.awk head/sys/tools/vnode_if.awk Modified: head/sys/tools/makeobjops.awk ============================================================================== --- head/sys/tools/makeobjops.awk Wed May 8 12:28:11 2019 (r347327) +++ head/sys/tools/makeobjops.awk Wed May 8 13:35:51 2019 (r347328) @@ -422,9 +422,12 @@ for (file_i = 0; file_i < num_files; file_i++) { ctmpfilename = cfilename ".tmp"; htmpfilename = hfilename ".tmp"; + # Avoid a literal generated file tag here. + generated = "@" "generated"; + common_head = \ "/*\n" \ - " * This file is @generated automatically.\n" \ + " * This file is " generated " automatically.\n" \ " * Do not modify anything in here by hand.\n" \ " *\n" \ " * Created from source file\n" \ Modified: head/sys/tools/vnode_if.awk ============================================================================== --- head/sys/tools/vnode_if.awk Wed May 8 12:28:11 2019 (r347327) +++ head/sys/tools/vnode_if.awk Wed May 8 13:35:51 2019 (r347328) @@ -139,9 +139,12 @@ if (!cfile && !hfile && !pfile && !qfile) if (!srcfile) usage(); +# Avoid a literal generated file tag here. +generated = "@" "generated"; + common_head = \ "/*\n" \ - " * This file is @generated automatically.\n" \ + " * This file is " generated " automatically.\n" \ " * Do not modify anything in here by hand.\n" \ " *\n" \ " * Created from $FreeBSD$\n" \ From owner-svn-src-all@freebsd.org Wed May 8 13:55:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D335F1585D13; Wed, 8 May 2019 13:55:39 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f182.google.com (mail-it1-f182.google.com [209.85.166.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7009E74334; Wed, 8 May 2019 13:55:39 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f182.google.com with SMTP id a190so4158976ite.4; Wed, 08 May 2019 06:55:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=aBGC4+1cmF+9xw0Q35DM/+cxdTQ4JgNYAWr74NGLW+A=; b=TYpubbks7KJyztzAn101lYVPd6Dizj+xIffEcPgDd2xvbMIPvI3kj71Z3hKs5fGhNU VRgepsKLorN4+Em2HWH9Tx8sslz38bOrvCgTTmnKPTA+5+vGGVX8LDCrqZRkwJN/qTtI uLCBWZpK/dC0X1X6j3/JhORf2/Rr9pRb6bFlV8hxW6pn0TyGAjJ9Z3WwA4R0Y4d62D7s c5DmLch3YFmPQLzYw0nxTbYWLHps3kpCL8OWvVD3yP+ZyHqTwyQbEAyR7snCto7uitFu eNM2P87iAwJGE0TLCW4RZZolhyav6dyjn8bG+v8V7Jq8olxjUF/R0VFmlbRFwf875C9D dIXQ== X-Gm-Message-State: APjAAAUsVLuDfOTRro7uMwxlazOlciY9zthkvHXPfr4Itz5P39wTHI6U 9drY/E6s0elPGJGq0LSTBPaNDcHA X-Google-Smtp-Source: APXvYqwlNSFZNESSE64E/r/37TuK3E3FMUee8HlrBS+JEI+e1Zwz1kdMBy1qhQLAtSaZCYLqUUcBBQ== X-Received: by 2002:a02:c043:: with SMTP id u3mr27870350jam.35.1557323737902; Wed, 08 May 2019 06:55:37 -0700 (PDT) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com. [209.85.166.51]) by smtp.gmail.com with ESMTPSA id t191sm1290294itt.17.2019.05.08.06.55.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 May 2019 06:55:37 -0700 (PDT) Received: by mail-io1-f51.google.com with SMTP id b3so11459341iob.12; Wed, 08 May 2019 06:55:37 -0700 (PDT) X-Received: by 2002:a5d:84ce:: with SMTP id z14mr7548156ior.107.1557323737262; Wed, 08 May 2019 06:55:37 -0700 (PDT) MIME-Version: 1.0 References: <201905080045.x480jGpo032140@repo.freebsd.org> <21F2F871-42E2-4572-97ED-C50CD00F9FC0@freebsd.org> In-Reply-To: <21F2F871-42E2-4572-97ED-C50CD00F9FC0@freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 8 May 2019 06:55:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347239 - head/sys/dev/random To: Michael Tuexen Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 7009E74334 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 13:55:40 -0000 Unfortunately, no real knob for it. I have proposed disabling the warning in https://reviews.freebsd.org/D20195 . Sorry about the noise. Best, Conrad On Wed, May 8, 2019 at 2:08 AM Michael Tuexen wrote: > > On 8. May 2019, at 02:45, Conrad Meyer wrote: > > > > Author: cem > > Date: Wed May 8 00:45:16 2019 > > New Revision: 347239 > > URL: https://svnweb.freebsd.org/changeset/base/347239 > > > > Log: > > random: x86 driver: Prefer RDSEED over RDRAND when available > I get a lot of > random_sources_feed: rs_read for hardware device 'Intel Secure Key RNG' > returned no entropy. > entries in /var/log/messages now... > > Any idea how to turn them off? > > Best regards > Michael > > > > Per > > > https://software.intel.com/en-us/blogs/2012/11/17/the-difference-between-rdrand-and-rdseed > > , RDRAND is a PRNG seeded from the same source as RDSEED. The source is > > more suitable as PRNG seed material, so prefer it when the RDSEED > intrinsic > > is available (indicated in CPU feature bits). > > > > Reviewed by: delphij, jhb, imp (earlier version) > > Approved by: secteam(delphij) > > Security: yes > > Sponsored by: Dell EMC Isilon > > Differential Revision: https://reviews.freebsd.org/D20192 > > > > Modified: > > head/sys/dev/random/ivy.c > > > > Modified: head/sys/dev/random/ivy.c > > > ============================================================================== > > --- head/sys/dev/random/ivy.c Wed May 8 00:40:08 2019 (r347238) > > +++ head/sys/dev/random/ivy.c Wed May 8 00:45:16 2019 (r347239) > > @@ -44,11 +44,13 @@ __FBSDID("$FreeBSD$"); > > > > #include > > #include > > +#include > > > > #include > > > > #define RETRY_COUNT 10 > > > > +static bool has_rdrand, has_rdseed; > > static u_int random_ivy_read(void *, u_int); > > > > static struct random_source random_ivy = { > > @@ -57,10 +59,9 @@ static struct random_source random_ivy = { > > .rs_read = random_ivy_read > > }; > > > > -static inline int > > -ivy_rng_store(u_long *buf) > > +static int > > +x86_rdrand_store(u_long *buf) > > { > > -#ifdef __GNUCLIKE_ASM > > u_long rndval; > > int retry; > > > > @@ -75,11 +76,40 @@ ivy_rng_store(u_long *buf) > > : "+r" (retry), "=r" (rndval) : : "cc"); > > *buf = rndval; > > return (retry); > > -#else /* __GNUCLIKE_ASM */ > > - return (0); > > -#endif > > } > > > > +static int > > +x86_rdseed_store(u_long *buf) > > +{ > > + u_long rndval; > > + int retry; > > + > > + retry = RETRY_COUNT; > > + __asm __volatile( > > + "1:\n\t" > > + "rdseed %1\n\t" /* read randomness into rndval */ > > + "jc 2f\n\t" /* CF is set on success, exit retry loop */ > > + "dec %0\n\t" /* otherwise, retry-- */ > > + "jne 1b\n\t" /* and loop if retries are not exhausted */ > > + "2:" > > + : "+r" (retry), "=r" (rndval) : : "cc"); > > + *buf = rndval; > > + return (retry); > > +} > > + > > +DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static) > > +{ > > + has_rdrand = (cpu_feature2 & CPUID2_RDRAND); > > + has_rdseed = (cpu_stdext_feature & CPUID_STDEXT_RDSEED); > > + > > + if (has_rdseed) > > + return (x86_rdseed_store); > > + else if (has_rdrand) > > + return (x86_rdrand_store); > > + else > > + return (NULL); > > +} > > + > > /* It is required that buf length is a multiple of sizeof(u_long). */ > > static u_int > > random_ivy_read(void *buf, u_int c) > > @@ -90,7 +120,7 @@ random_ivy_read(void *buf, u_int c) > > KASSERT(c % sizeof(*b) == 0, ("partial read %d", c)); > > b = buf; > > for (count = c; count > 0; count -= sizeof(*b)) { > > - if (ivy_rng_store(&rndval) == 0) > > + if (x86_rng_store(&rndval) == 0) > > break; > > *b++ = rndval; > > } > > @@ -104,14 +134,14 @@ rdrand_modevent(module_t mod, int type, void > *unused) > > > > switch (type) { > > case MOD_LOAD: > > - if (cpu_feature2 & CPUID2_RDRAND) { > > + if (has_rdrand || has_rdseed) { > > random_source_register(&random_ivy); > > printf("random: fast provider: \"%s\"\n", > random_ivy.rs_ident); > > } > > break; > > > > case MOD_UNLOAD: > > - if (cpu_feature2 & CPUID2_RDRAND) > > + if (has_rdrand || has_rdseed) > > random_source_deregister(&random_ivy); > > break; > > > > > > From owner-svn-src-all@freebsd.org Wed May 8 14:54:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C63AD1589534; Wed, 8 May 2019 14:54:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C99D76304; Wed, 8 May 2019 14:54:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CF5B75C0; Wed, 8 May 2019 14:54:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48EsXD4085818; Wed, 8 May 2019 14:54:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48EsXYD085817; Wed, 8 May 2019 14:54:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905081454.x48EsXYD085817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 8 May 2019 14:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347329 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 347329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C99D76304 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 14:54:34 -0000 Author: cem Date: Wed May 8 14:54:32 2019 New Revision: 347329 URL: https://svnweb.freebsd.org/changeset/base/347329 Log: random(4): Don't complain noisily when an entropy source is slow Mjg@ reports that RDSEED (r347239) causes a lot of logspam from this printf, and I don't feel that it is especially useful (even ratelimited). There are many other quality/quantity checks we're not performing on entropy sources; lack of high frequency availability does not disqualify a good entropy source. There is some discussion in the linked Differential about what logging might be appropriate and/or polling policy for slower TRNG sources. Please feel free to chime in if you have opinions. Reported by: mjg Reviewed by: markm, delphij Approved by: secteam(delphij) X-MFC-With: r347239 Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20195 Modified: head/sys/dev/random/random_harvestq.c Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Wed May 8 13:35:51 2019 (r347328) +++ head/sys/dev/random/random_harvestq.c Wed May 8 14:54:32 2019 (r347329) @@ -235,15 +235,19 @@ random_sources_feed(void) for (i = 0; i < p_random_alg_context->ra_poolcount*local_read_rate; i++) { n = rrs->rrs_source->rs_read(entropy, sizeof(entropy)); KASSERT((n <= sizeof(entropy)), ("%s: rs_read returned too much data (%u > %zu)", __func__, n, sizeof(entropy))); - /* It would appear that in some circumstances (e.g. virtualisation), - * the underlying hardware entropy source might not always return - * random numbers. Accept this but make a noise. If too much happens, - * can that source be trusted? + /* + * Sometimes the HW entropy source doesn't have anything + * ready for us. This isn't necessarily untrustworthy. + * We don't perform any other verification of an entropy + * source (i.e., length is allowed to be anywhere from 1 + * to sizeof(entropy), quality is unchecked, etc), so + * don't balk verbosely at slow random sources either. + * There are reports that RDSEED on x86 metal falls + * behind the rate at which we query it, for example. + * But it's still a better entropy source than RDRAND. */ - if (n == 0) { - printf("%s: rs_read for hardware device '%s' returned no entropy.\n", __func__, rrs->rrs_source->rs_ident); + if (n == 0) continue; - } random_harvest_direct(entropy, n, rrs->rrs_source->rs_source); } } From owner-svn-src-all@freebsd.org Wed May 8 15:14:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B5A41589B03; Wed, 8 May 2019 15:14:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9090276D4F; Wed, 8 May 2019 15:14:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69CD17925; Wed, 8 May 2019 15:14:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FE0fr096501; Wed, 8 May 2019 15:14:00 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FE0PJ096500; Wed, 8 May 2019 15:14:00 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905081514.x48FE0PJ096500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 8 May 2019 15:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347330 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 347330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9090276D4F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:14:01 -0000 Author: ae Date: Wed May 8 15:13:59 2019 New Revision: 347330 URL: https://svnweb.freebsd.org/changeset/base/347330 Log: MFC r346884: Add IPv6 support for O_IPLEN opcode. Obtained from: Yandex LLC Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw2.c Wed May 8 14:54:32 2019 (r347329) +++ stable/12/sys/netpfil/ipfw/ip_fw2.c Wed May 8 15:13:59 2019 (r347330) @@ -2150,9 +2150,11 @@ do { \ break; case O_IPID: - case O_IPLEN: case O_IPTTL: - if (is_ipv4) { /* only for IP packets */ + if (!is_ipv4) + break; + case O_IPLEN: + { /* only for IP packets */ uint16_t x; uint16_t *p; int i; From owner-svn-src-all@freebsd.org Wed May 8 15:16:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 058F31589C7E; Wed, 8 May 2019 15:16:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D2C476F74; Wed, 8 May 2019 15:16:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 434457928; Wed, 8 May 2019 15:16:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FGkDP096708; Wed, 8 May 2019 15:16:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FGktn096707; Wed, 8 May 2019 15:16:46 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905081516.x48FGktn096707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 8 May 2019 15:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347331 - in stable: 11/release/tools 12/release/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/release/tools 12/release/tools X-SVN-Commit-Revision: 347331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D2C476F74 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:16:47 -0000 Author: gjb Date: Wed May 8 15:16:45 2019 New Revision: 347331 URL: https://svnweb.freebsd.org/changeset/base/347331 Log: MFC r347056: Increase the default size of the GCE disk image from 3GB to 20GB, as 3GB is too small as discovered in last week's snapshot builds. Sponsored by: The FreeBSD Foundation Modified: stable/12/release/tools/gce.conf Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/tools/gce.conf Directory Properties: stable/11/ (props changed) Modified: stable/12/release/tools/gce.conf ============================================================================== --- stable/12/release/tools/gce.conf Wed May 8 15:13:59 2019 (r347330) +++ stable/12/release/tools/gce.conf Wed May 8 15:16:45 2019 (r347331) @@ -3,6 +3,9 @@ # $FreeBSD$ # +# The default of 3GB is too small for GCE, so override the size here. +export VMSIZE=20G + # 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 \ From owner-svn-src-all@freebsd.org Wed May 8 15:16:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 909361589C78; Wed, 8 May 2019 15:16:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 350F176F72; Wed, 8 May 2019 15:16:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E1267927; Wed, 8 May 2019 15:16:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FGjad096702; Wed, 8 May 2019 15:16:45 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FGjQH096701; Wed, 8 May 2019 15:16:45 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905081516.x48FGjQH096701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 8 May 2019 15:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347331 - in stable: 11/release/tools 12/release/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/release/tools 12/release/tools X-SVN-Commit-Revision: 347331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 350F176F72 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:16:46 -0000 Author: gjb Date: Wed May 8 15:16:45 2019 New Revision: 347331 URL: https://svnweb.freebsd.org/changeset/base/347331 Log: MFC r347056: Increase the default size of the GCE disk image from 3GB to 20GB, as 3GB is too small as discovered in last week's snapshot builds. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/tools/gce.conf Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/release/tools/gce.conf Directory Properties: stable/12/ (props changed) Modified: stable/11/release/tools/gce.conf ============================================================================== --- stable/11/release/tools/gce.conf Wed May 8 15:13:59 2019 (r347330) +++ stable/11/release/tools/gce.conf Wed May 8 15:16:45 2019 (r347331) @@ -3,6 +3,9 @@ # $FreeBSD$ # +# The default of 3GB is too small for GCE, so override the size here. +export VMSIZE=20G + # 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 \ From owner-svn-src-all@freebsd.org Wed May 8 15:17:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AC421589D00; Wed, 8 May 2019 15:17:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76C8277156; Wed, 8 May 2019 15:17:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51EF97929; Wed, 8 May 2019 15:17:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FH5Oj096793; Wed, 8 May 2019 15:17:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FH4r5096791; Wed, 8 May 2019 15:17:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905081517.x48FH4r5096791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 8 May 2019 15:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347332 - stable/12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/scsi X-SVN-Commit-Revision: 347332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76C8277156 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:17:07 -0000 Author: mav Date: Wed May 8 15:17:04 2019 New Revision: 347332 URL: https://svnweb.freebsd.org/changeset/base/347332 Log: MFC r346491: Polish SCSI sense data validity checks. According to specs and common sense, all sense data reported in descriptor format should be valid. But practice shows different, some devices return descriptors with invalid data, resulting in error messages looking worse. Decouple block/stream commands sense data and information field printing. Looking on present specs, there are much more cases when those fields are not related, and incomplete old code was not printing valid sense data and leaving empty lines for invalid. Modified: stable/12/sys/cam/scsi/scsi_all.c stable/12/sys/cam/scsi/scsi_all.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.c Wed May 8 15:16:45 2019 (r347331) +++ stable/12/sys/cam/scsi/scsi_all.c Wed May 8 15:17:04 2019 (r347332) @@ -4061,6 +4061,10 @@ scsi_get_sense_info(struct scsi_sense_data *sense_data struct scsi_sense_info *info_desc; info_desc = (struct scsi_sense_info *)desc; + + if ((info_desc->byte2 & SSD_INFO_VALID) == 0) + goto bailout; + *info = scsi_8btou64(info_desc->info); if (signed_info != NULL) *signed_info = *info; @@ -4081,6 +4085,9 @@ scsi_get_sense_info(struct scsi_sense_data *sense_data fru_desc = (struct scsi_sense_fru *)desc; + if (fru_desc->fru == 0) + goto bailout; + *info = fru_desc->fru; if (signed_info != NULL) *signed_info = (int8_t)fru_desc->fru; @@ -4181,10 +4188,9 @@ scsi_get_sks(struct scsi_sense_data *sense_data, u_int if (desc == NULL) goto bailout; - /* - * No need to check the SKS valid bit for descriptor sense. - * If the descriptor is present, it is valid. - */ + if ((desc->sense_key_spec[0] & SSD_SKS_VALID) == 0) + goto bailout; + bcopy(desc->sense_key_spec, sks, sizeof(desc->sense_key_spec)); break; } @@ -4261,9 +4267,6 @@ scsi_get_block_info(struct scsi_sense_data *sense_data if (SSD_FIXED_IS_PRESENT(sense, sense_len, flags) == 0) goto bailout; - if ((sense->flags & SSD_ILI) == 0) - goto bailout; - *block_bits = sense->flags & SSD_ILI; break; } @@ -4317,9 +4320,6 @@ scsi_get_stream_info(struct scsi_sense_data *sense_dat if (SSD_FIXED_IS_PRESENT(sense, sense_len, flags) == 0) goto bailout; - if ((sense->flags & (SSD_ILI|SSD_EOM|SSD_FILEMARK)) == 0) - goto bailout; - *stream_bits = sense->flags & (SSD_ILI|SSD_EOM|SSD_FILEMARK); break; } @@ -4361,8 +4361,6 @@ scsi_progress_sbuf(struct sbuf *sb, uint16_t progress) int scsi_sks_sbuf(struct sbuf *sb, int sense_key, uint8_t *sks) { - if ((sks[0] & SSD_SKS_VALID) == 0) - return (1); switch (sense_key) { case SSD_KEY_ILLEGAL_REQUEST: { @@ -4459,7 +4457,7 @@ scsi_fru_sbuf(struct sbuf *sb, uint64_t fru) } void -scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, uint64_t info) +scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits) { int need_comma; @@ -4467,6 +4465,7 @@ scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, /* * XXX KDM this needs more descriptive decoding. */ + sbuf_printf(sb, "Stream Command Sense Data: "); if (stream_bits & SSD_DESC_STREAM_FM) { sbuf_printf(sb, "Filemark"); need_comma = 1; @@ -4479,15 +4478,15 @@ scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, if (stream_bits & SSD_DESC_STREAM_ILI) sbuf_printf(sb, "%sILI", (need_comma) ? "," : ""); - - sbuf_printf(sb, ": Info: %#jx", (uintmax_t) info); } void -scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits, uint64_t info) +scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits) { + + sbuf_printf(sb, "Block Command Sense Data: "); if (block_bits & SSD_DESC_BLOCK_ILI) - sbuf_printf(sb, "ILI: residue %#jx", (uintmax_t) info); + sbuf_printf(sb, "ILI"); } void @@ -4500,6 +4499,9 @@ scsi_sense_info_sbuf(struct sbuf *sb, struct scsi_sens info = (struct scsi_sense_info *)header; + if ((info->byte2 & SSD_INFO_VALID) == 0) + return; + scsi_info_sbuf(sb, cdb, cdb_len, inq_data, scsi_8btou64(info->info)); } @@ -4528,6 +4530,9 @@ scsi_sense_sks_sbuf(struct sbuf *sb, struct scsi_sense sks = (struct scsi_sense_sks *)header; + if ((sks->sense_key_spec[0] & SSD_SKS_VALID) == 0) + return; + scsi_extract_sense_len(sense, sense_len, &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1); @@ -4544,6 +4549,9 @@ scsi_sense_fru_sbuf(struct sbuf *sb, struct scsi_sense fru = (struct scsi_sense_fru *)header; + if (fru->fru == 0) + return; + scsi_fru_sbuf(sb, (uint64_t)fru->fru); } @@ -4554,14 +4562,9 @@ scsi_sense_stream_sbuf(struct sbuf *sb, struct scsi_se struct scsi_sense_desc_header *header) { struct scsi_sense_stream *stream; - uint64_t info; stream = (struct scsi_sense_stream *)header; - info = 0; - - scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, &info, NULL); - - scsi_stream_sbuf(sb, stream->byte3, info); + scsi_stream_sbuf(sb, stream->byte3); } void @@ -4571,14 +4574,9 @@ scsi_sense_block_sbuf(struct sbuf *sb, struct scsi_sen struct scsi_sense_desc_header *header) { struct scsi_sense_block *block; - uint64_t info; block = (struct scsi_sense_block *)header; - info = 0; - - scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, &info, NULL); - - scsi_block_sbuf(sb, block->byte3, info); + scsi_block_sbuf(sb, block->byte3); } void @@ -4863,7 +4861,7 @@ scsi_sense_only_sbuf(struct scsi_sense_data *sense, u_ const char *asc_desc; uint8_t sks[3]; uint64_t val; - int info_valid; + uint8_t bits; /* * Get descriptions for the sense key, ASC, and ASCQ. If @@ -4882,42 +4880,28 @@ scsi_sense_only_sbuf(struct scsi_sense_data *sense, u_ sbuf_printf(sb, " asc:%x,%x (%s)\n", asc, ascq, asc_desc); /* - * Get the info field if it is valid. + * Print any block or stream device-specific information. */ - if (scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, - &val, NULL) == 0) - info_valid = 1; - else - info_valid = 0; + if (scsi_get_block_info(sense, sense_len, inq_data, + &bits) == 0 && bits != 0) { + sbuf_cat(sb, path_str); + scsi_block_sbuf(sb, bits); + sbuf_printf(sb, "\n"); + } else if (scsi_get_stream_info(sense, sense_len, inq_data, + &bits) == 0 && bits != 0) { + sbuf_cat(sb, path_str); + scsi_stream_sbuf(sb, bits); + sbuf_printf(sb, "\n"); + } - if (info_valid != 0) { - uint8_t bits; - - /* - * Determine whether we have any block or stream - * device-specific information. - */ - if (scsi_get_block_info(sense, sense_len, inq_data, - &bits) == 0) { - sbuf_cat(sb, path_str); - scsi_block_sbuf(sb, bits, val); - sbuf_printf(sb, "\n"); - } else if (scsi_get_stream_info(sense, sense_len, - inq_data, &bits) == 0) { - sbuf_cat(sb, path_str); - scsi_stream_sbuf(sb, bits, val); - sbuf_printf(sb, "\n"); - } else if (val != 0) { - /* - * The information field can be valid but 0. - * If the block or stream bits aren't set, - * and this is 0, it isn't terribly useful - * to print it out. - */ - sbuf_cat(sb, path_str); - scsi_info_sbuf(sb, cdb, cdb_len, inq_data, val); - sbuf_printf(sb, "\n"); - } + /* + * Print the info field. + */ + if (scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, + &val, NULL) == 0) { + sbuf_cat(sb, path_str); + scsi_info_sbuf(sb, cdb, cdb_len, inq_data, val); + sbuf_printf(sb, "\n"); } /* Modified: stable/12/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.h Wed May 8 15:16:45 2019 (r347331) +++ stable/12/sys/cam/scsi/scsi_all.h Wed May 8 15:17:04 2019 (r347332) @@ -3749,8 +3749,8 @@ void scsi_command_sbuf(struct sbuf *sb, uint8_t *cdb, void scsi_progress_sbuf(struct sbuf *sb, uint16_t progress); int scsi_sks_sbuf(struct sbuf *sb, int sense_key, uint8_t *sks); void scsi_fru_sbuf(struct sbuf *sb, uint64_t fru); -void scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, uint64_t info); -void scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits, uint64_t info); +void scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits); +void scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits); void scsi_sense_info_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, From owner-svn-src-all@freebsd.org Wed May 8 15:17:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 485D31589D43; Wed, 8 May 2019 15:17:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE8AF7721A; Wed, 8 May 2019 15:17:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C351792A; Wed, 8 May 2019 15:17:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FHH6b096858; Wed, 8 May 2019 15:17:17 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FHHqT096857; Wed, 8 May 2019 15:17:17 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905081517.x48FHHqT096857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 8 May 2019 15:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347333 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw X-SVN-Commit-Revision: 347333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE8AF7721A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:17:18 -0000 Author: ae Date: Wed May 8 15:17:16 2019 New Revision: 347333 URL: https://svnweb.freebsd.org/changeset/base/347333 Log: MFC r346884: Add IPv6 support for O_IPLEN opcode. Obtained from: Yandex LLC Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Wed May 8 15:17:04 2019 (r347332) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Wed May 8 15:17:16 2019 (r347333) @@ -2148,9 +2148,11 @@ do { \ break; case O_IPID: - case O_IPLEN: case O_IPTTL: - if (is_ipv4) { /* only for IP packets */ + if (!is_ipv4) + break; + case O_IPLEN: + { /* only for IP packets */ uint16_t x; uint16_t *p; int i; From owner-svn-src-all@freebsd.org Wed May 8 15:17:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EA8C1589DC4; Wed, 8 May 2019 15:17:37 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20CF577348; Wed, 8 May 2019 15:17:37 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC9E1792B; Wed, 8 May 2019 15:17:36 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FHawM096922; Wed, 8 May 2019 15:17:36 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FHaeV096921; Wed, 8 May 2019 15:17:36 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201905081517.x48FHaeV096921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Wed, 8 May 2019 15:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347334 - head X-SVN-Group: head X-SVN-Commit-Author: antoine X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 347334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 20CF577348 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:17:37 -0000 Author: antoine Date: Wed May 8 15:17:36 2019 New Revision: 347334 URL: https://svnweb.freebsd.org/changeset/base/347334 Log: Add wc(1) to native-xtools so that it can be used in qemu-user jails Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 8 15:17:16 2019 (r347333) +++ head/Makefile.inc1 Wed May 8 15:17:36 2019 (r347334) @@ -2570,6 +2570,7 @@ NXBDIRS+= \ usr.bin/true \ usr.bin/uniq \ usr.bin/unzip \ + usr.bin/wc \ usr.bin/xargs \ usr.bin/xinstall \ usr.bin/xz \ @@ -2601,6 +2602,7 @@ NXBMAKEARGS+= \ -DNO_CPU_CFLAGS \ -DNO_PIC \ SSP_CFLAGS= \ + MK_CASPER=no \ MK_CLANG_EXTRAS=no \ MK_CLANG_FULL=no \ MK_CTF=no \ From owner-svn-src-all@freebsd.org Wed May 8 15:17:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F82C1589E03; Wed, 8 May 2019 15:17:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C65CC7744F; Wed, 8 May 2019 15:17:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95E33792C; Wed, 8 May 2019 15:17:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FHkhR096976; Wed, 8 May 2019 15:17:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FHkkO096975; Wed, 8 May 2019 15:17:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905081517.x48FHkkO096975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 8 May 2019 15:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347335 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 347335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C65CC7744F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:17:50 -0000 Author: mav Date: Wed May 8 15:17:45 2019 New Revision: 347335 URL: https://svnweb.freebsd.org/changeset/base/347335 Log: MFC r346491: Polish SCSI sense data validity checks. According to specs and common sense, all sense data reported in descriptor format should be valid. But practice shows different, some devices return descriptors with invalid data, resulting in error messages looking worse. Decouple block/stream commands sense data and information field printing. Looking on present specs, there are much more cases when those fields are not related, and incomplete old code was not printing valid sense data and leaving empty lines for invalid. Modified: stable/11/sys/cam/scsi/scsi_all.c stable/11/sys/cam/scsi/scsi_all.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Wed May 8 15:17:36 2019 (r347334) +++ stable/11/sys/cam/scsi/scsi_all.c Wed May 8 15:17:45 2019 (r347335) @@ -4059,6 +4059,10 @@ scsi_get_sense_info(struct scsi_sense_data *sense_data struct scsi_sense_info *info_desc; info_desc = (struct scsi_sense_info *)desc; + + if ((info_desc->byte2 & SSD_INFO_VALID) == 0) + goto bailout; + *info = scsi_8btou64(info_desc->info); if (signed_info != NULL) *signed_info = *info; @@ -4079,6 +4083,9 @@ scsi_get_sense_info(struct scsi_sense_data *sense_data fru_desc = (struct scsi_sense_fru *)desc; + if (fru_desc->fru == 0) + goto bailout; + *info = fru_desc->fru; if (signed_info != NULL) *signed_info = (int8_t)fru_desc->fru; @@ -4179,10 +4186,9 @@ scsi_get_sks(struct scsi_sense_data *sense_data, u_int if (desc == NULL) goto bailout; - /* - * No need to check the SKS valid bit for descriptor sense. - * If the descriptor is present, it is valid. - */ + if ((desc->sense_key_spec[0] & SSD_SKS_VALID) == 0) + goto bailout; + bcopy(desc->sense_key_spec, sks, sizeof(desc->sense_key_spec)); break; } @@ -4259,9 +4265,6 @@ scsi_get_block_info(struct scsi_sense_data *sense_data if (SSD_FIXED_IS_PRESENT(sense, sense_len, flags) == 0) goto bailout; - if ((sense->flags & SSD_ILI) == 0) - goto bailout; - *block_bits = sense->flags & SSD_ILI; break; } @@ -4315,9 +4318,6 @@ scsi_get_stream_info(struct scsi_sense_data *sense_dat if (SSD_FIXED_IS_PRESENT(sense, sense_len, flags) == 0) goto bailout; - if ((sense->flags & (SSD_ILI|SSD_EOM|SSD_FILEMARK)) == 0) - goto bailout; - *stream_bits = sense->flags & (SSD_ILI|SSD_EOM|SSD_FILEMARK); break; } @@ -4359,8 +4359,6 @@ scsi_progress_sbuf(struct sbuf *sb, uint16_t progress) int scsi_sks_sbuf(struct sbuf *sb, int sense_key, uint8_t *sks) { - if ((sks[0] & SSD_SKS_VALID) == 0) - return (1); switch (sense_key) { case SSD_KEY_ILLEGAL_REQUEST: { @@ -4457,7 +4455,7 @@ scsi_fru_sbuf(struct sbuf *sb, uint64_t fru) } void -scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, uint64_t info) +scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits) { int need_comma; @@ -4465,6 +4463,7 @@ scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, /* * XXX KDM this needs more descriptive decoding. */ + sbuf_printf(sb, "Stream Command Sense Data: "); if (stream_bits & SSD_DESC_STREAM_FM) { sbuf_printf(sb, "Filemark"); need_comma = 1; @@ -4477,15 +4476,15 @@ scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, if (stream_bits & SSD_DESC_STREAM_ILI) sbuf_printf(sb, "%sILI", (need_comma) ? "," : ""); - - sbuf_printf(sb, ": Info: %#jx", (uintmax_t) info); } void -scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits, uint64_t info) +scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits) { + + sbuf_printf(sb, "Block Command Sense Data: "); if (block_bits & SSD_DESC_BLOCK_ILI) - sbuf_printf(sb, "ILI: residue %#jx", (uintmax_t) info); + sbuf_printf(sb, "ILI"); } void @@ -4498,6 +4497,9 @@ scsi_sense_info_sbuf(struct sbuf *sb, struct scsi_sens info = (struct scsi_sense_info *)header; + if ((info->byte2 & SSD_INFO_VALID) == 0) + return; + scsi_info_sbuf(sb, cdb, cdb_len, inq_data, scsi_8btou64(info->info)); } @@ -4526,6 +4528,9 @@ scsi_sense_sks_sbuf(struct sbuf *sb, struct scsi_sense sks = (struct scsi_sense_sks *)header; + if ((sks->sense_key_spec[0] & SSD_SKS_VALID) == 0) + return; + scsi_extract_sense_len(sense, sense_len, &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1); @@ -4542,6 +4547,9 @@ scsi_sense_fru_sbuf(struct sbuf *sb, struct scsi_sense fru = (struct scsi_sense_fru *)header; + if (fru->fru == 0) + return; + scsi_fru_sbuf(sb, (uint64_t)fru->fru); } @@ -4552,14 +4560,9 @@ scsi_sense_stream_sbuf(struct sbuf *sb, struct scsi_se struct scsi_sense_desc_header *header) { struct scsi_sense_stream *stream; - uint64_t info; stream = (struct scsi_sense_stream *)header; - info = 0; - - scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, &info, NULL); - - scsi_stream_sbuf(sb, stream->byte3, info); + scsi_stream_sbuf(sb, stream->byte3); } void @@ -4569,14 +4572,9 @@ scsi_sense_block_sbuf(struct sbuf *sb, struct scsi_sen struct scsi_sense_desc_header *header) { struct scsi_sense_block *block; - uint64_t info; block = (struct scsi_sense_block *)header; - info = 0; - - scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, &info, NULL); - - scsi_block_sbuf(sb, block->byte3, info); + scsi_block_sbuf(sb, block->byte3); } void @@ -4861,7 +4859,7 @@ scsi_sense_only_sbuf(struct scsi_sense_data *sense, u_ const char *asc_desc; uint8_t sks[3]; uint64_t val; - int info_valid; + uint8_t bits; /* * Get descriptions for the sense key, ASC, and ASCQ. If @@ -4880,42 +4878,28 @@ scsi_sense_only_sbuf(struct scsi_sense_data *sense, u_ sbuf_printf(sb, " asc:%x,%x (%s)\n", asc, ascq, asc_desc); /* - * Get the info field if it is valid. + * Print any block or stream device-specific information. */ - if (scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, - &val, NULL) == 0) - info_valid = 1; - else - info_valid = 0; + if (scsi_get_block_info(sense, sense_len, inq_data, + &bits) == 0 && bits != 0) { + sbuf_cat(sb, path_str); + scsi_block_sbuf(sb, bits); + sbuf_printf(sb, "\n"); + } else if (scsi_get_stream_info(sense, sense_len, inq_data, + &bits) == 0 && bits != 0) { + sbuf_cat(sb, path_str); + scsi_stream_sbuf(sb, bits); + sbuf_printf(sb, "\n"); + } - if (info_valid != 0) { - uint8_t bits; - - /* - * Determine whether we have any block or stream - * device-specific information. - */ - if (scsi_get_block_info(sense, sense_len, inq_data, - &bits) == 0) { - sbuf_cat(sb, path_str); - scsi_block_sbuf(sb, bits, val); - sbuf_printf(sb, "\n"); - } else if (scsi_get_stream_info(sense, sense_len, - inq_data, &bits) == 0) { - sbuf_cat(sb, path_str); - scsi_stream_sbuf(sb, bits, val); - sbuf_printf(sb, "\n"); - } else if (val != 0) { - /* - * The information field can be valid but 0. - * If the block or stream bits aren't set, - * and this is 0, it isn't terribly useful - * to print it out. - */ - sbuf_cat(sb, path_str); - scsi_info_sbuf(sb, cdb, cdb_len, inq_data, val); - sbuf_printf(sb, "\n"); - } + /* + * Print the info field. + */ + if (scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, + &val, NULL) == 0) { + sbuf_cat(sb, path_str); + scsi_info_sbuf(sb, cdb, cdb_len, inq_data, val); + sbuf_printf(sb, "\n"); } /* Modified: stable/11/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.h Wed May 8 15:17:36 2019 (r347334) +++ stable/11/sys/cam/scsi/scsi_all.h Wed May 8 15:17:45 2019 (r347335) @@ -3745,8 +3745,8 @@ void scsi_command_sbuf(struct sbuf *sb, uint8_t *cdb, void scsi_progress_sbuf(struct sbuf *sb, uint16_t progress); int scsi_sks_sbuf(struct sbuf *sb, int sense_key, uint8_t *sks); void scsi_fru_sbuf(struct sbuf *sb, uint64_t fru); -void scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits, uint64_t info); -void scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits, uint64_t info); +void scsi_stream_sbuf(struct sbuf *sb, uint8_t stream_bits); +void scsi_block_sbuf(struct sbuf *sb, uint8_t block_bits); void scsi_sense_info_sbuf(struct sbuf *sb, struct scsi_sense_data *sense, u_int sense_len, uint8_t *cdb, int cdb_len, struct scsi_inquiry_data *inq_data, From owner-svn-src-all@freebsd.org Wed May 8 15:20:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42726158A033; Wed, 8 May 2019 15:20:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE48B778E5; Wed, 8 May 2019 15:20:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8ECD07930; Wed, 8 May 2019 15:20:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FKHPL097166; Wed, 8 May 2019 15:20:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FKHs8097163; Wed, 8 May 2019 15:20:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905081520.x48FKHs8097163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 8 May 2019 15:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347336 - stable/12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/scsi X-SVN-Commit-Revision: 347336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE48B778E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:20:18 -0000 Author: mav Date: Wed May 8 15:20:16 2019 New Revision: 347336 URL: https://svnweb.freebsd.org/changeset/base/347336 Log: MFC r346511: Report DIF protection type the disk is formatted with. Some disks formatted with protection report errors if written without protection used. This should help to diagnose the problem. Modified: stable/12/sys/cam/scsi/scsi_all.h stable/12/sys/cam/scsi/scsi_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.h Wed May 8 15:17:45 2019 (r347335) +++ stable/12/sys/cam/scsi/scsi_all.h Wed May 8 15:20:16 2019 (r347336) @@ -2931,6 +2931,7 @@ struct scsi_read_capacity_data_long uint8_t length[4]; #define SRC16_PROT_EN 0x01 #define SRC16_P_TYPE 0x0e +#define SRC16_P_TYPE_SHIFT 1 #define SRC16_PTYPE_1 0x00 #define SRC16_PTYPE_2 0x02 #define SRC16_PTYPE_3 0x04 Modified: stable/12/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_da.c Wed May 8 15:17:45 2019 (r347335) +++ stable/12/sys/cam/scsi/scsi_da.c Wed May 8 15:20:16 2019 (r347336) @@ -339,6 +339,7 @@ struct da_softc { da_delete_func_t *delete_func; int unmappedio; int rotating; + int p_type; struct disk_params params; struct disk *disk; union ccb saved_ccb; @@ -2262,7 +2263,7 @@ dasysctlinit(void *context, int pending) CTLFLAG_RD, &softc->unmappedio, 0, - "Unmapped I/O leaf"); + "Unmapped I/O support"); SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), @@ -2273,6 +2274,15 @@ dasysctlinit(void *context, int pending) 0, "Rotating media"); + SYSCTL_ADD_INT(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, + "p_type", + CTLFLAG_RD, + &softc->p_type, + 0, + "DIF protection type"); + #ifdef CAM_TEST_FAILURE SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "invalidate", CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, @@ -4613,7 +4623,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *d da_ccb_state state; char *announce_buf; u_int32_t priority; - int lbp; + int lbp, n; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone_proberc\n")); @@ -4695,11 +4705,17 @@ dadone_proberc(struct cam_periph *periph, union ccb *d rcaplong, sizeof(*rcaplong)); lbp = (lalba & SRC16_LBPME_A); dp = &softc->params; - snprintf(announce_buf, DA_ANNOUNCETMP_SZ, - "%juMB (%ju %u byte sectors)", + n = snprintf(announce_buf, DA_ANNOUNCETMP_SZ, + "%juMB (%ju %u byte sectors", ((uintmax_t)dp->secsize * dp->sectors) / (1024 * 1024), (uintmax_t)dp->sectors, dp->secsize); + if (softc->p_type != 0) { + n += snprintf(announce_buf + n, + DA_ANNOUNCETMP_SZ - n, + ", DIF type %d", softc->p_type); + } + snprintf(announce_buf + n, DA_ANNOUNCETMP_SZ - n, ")"); } } else { int error; @@ -5948,9 +5964,15 @@ dasetgeom(struct cam_periph *periph, uint32_t block_le lbppbe = rcaplong->prot_lbppbe & SRC16_LBPPBE; lalba = scsi_2btoul(rcaplong->lalba_lbp); lalba &= SRC16_LALBA_A; + if (rcaplong->prot & SRC16_PROT_EN) + softc->p_type = ((rcaplong->prot & SRC16_P_TYPE) >> + SRC16_P_TYPE_SHIFT) + 1; + else + softc->p_type = 0; } else { lbppbe = 0; lalba = 0; + softc->p_type = 0; } if (lbppbe > 0) { From owner-svn-src-all@freebsd.org Wed May 8 15:21:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFA80158A11B; Wed, 8 May 2019 15:21:53 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F99F77C60; Wed, 8 May 2019 15:21:53 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x534.google.com with SMTP id w22so8954283pgi.6; Wed, 08 May 2019 08:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xkYRW8X5MOkkgT3EN2EMAgs/tJtaYs4LqdTCk98MxOI=; b=UJUUKlTyKMx7B8P9Z9mCqbfjHRBRQPiWpvAlP09OJ8W7ept1O2o2GLOGpRHw2qMBuj cTEyxI1PW1Bhj4n7+xeDHHmEcO2E+nJT/GXgjCJaKZZjOR7gCnHWqdPR1f77ymh403Yq MrRB9fGlgFHHLgnS1X+oq7+Kqc3ixSB/ZQd26RW6oX6IsGq6PUycc/KdLebBsmUb4L67 BOEhKaYgYp/+Z56ux+zwV4x2aD8Q+n9ibfTcGYTyl+6bfNgfJl4nS3lrN7G+aWPhySXX RXrkxaMPGJlNdQMRGjmjUgCtggkAoKGIU89Ox48HpN4dBQgygRJYq8ME9hD0ESOPknt3 fV2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xkYRW8X5MOkkgT3EN2EMAgs/tJtaYs4LqdTCk98MxOI=; b=tDnnncsoFFv3D2jF+umw377yWiJiFrpd35txtlKe1iwp0VAUImKwqa2/7DhlUp+lT4 znCXR3CS+nwaSqHWhFkb9cLgtPwZAn/FfIwVJ+Z2B/UWrGdwPuzSiiyDIGHajhKqzmBI 1aqKHTZUZnHbqZOd/MhWigZiwk9+9TMKbUqdQ+LSCRc/jPaMDVu/Ic4kzyxN2BD6ADje Z9eamNS5VVOKGgkE88T10yLT8LeAqmRo+J98hLXYy9AjhCUgRIjv42llH6YqWTenyAA/ aVutMggYLEFRSTd8vFA9PiBTWXZW59HBiH78heQxAPGcjEvTNf+fQRvqTOgoPg4Zd+3x UBxA== X-Gm-Message-State: APjAAAXKamiEEX6U5eJUqo3YjRgqhM+l1yUu5AVSzkq77ubLGP/hnvW6 V6ZsZy793StfDYcdKxWOEHUpMF06 X-Google-Smtp-Source: APXvYqzKUE7QbsHLV2X9lWNFZWFODgZEKAtRrtdqZtXoR/NomLLl9eDH5253dpnDqpcdVKzuFMK2eQ== X-Received: by 2002:a65:50c2:: with SMTP id s2mr48050194pgp.112.1557328911704; Wed, 08 May 2019 08:21:51 -0700 (PDT) Received: from ?IPv6:2607:fb90:815c:89f2:7b:f37d:aba1:7203? ([2607:fb90:815c:89f2:7b:f37d:aba1:7203]) by smtp.gmail.com with ESMTPSA id o5sm43680529pfa.135.2019.05.08.08.21.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 May 2019 08:21:51 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r347334 - head From: Enji Cooper X-Mailer: iPhone Mail (16E227) In-Reply-To: <201905081517.x48FHaeV096921@repo.freebsd.org> Date: Wed, 8 May 2019 08:21:49 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201905081517.x48FHaeV096921@repo.freebsd.org> To: Antoine Brodin X-Rspamd-Queue-Id: 2F99F77C60 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:21:53 -0000 > On May 8, 2019, at 08:17, Antoine Brodin wrote: >=20 > Author: antoine > Date: Wed May 8 15:17:36 2019 > New Revision: 347334 > URL: https://svnweb.freebsd.org/changeset/base/347334 >=20 > Log: > Add wc(1) to native-xtools so that it can be used in qemu-user jails >=20 > Modified: > head/Makefile.inc1 Hi Antoine, Quick question: doesn=E2=80=99t wc(1) require libxo in order to function= today? Was that expressed in the dependencies? Thank you, -Enji= From owner-svn-src-all@freebsd.org Wed May 8 15:22:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39C9D158A2E2; Wed, 8 May 2019 15:22:29 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E19EB77E22; Wed, 8 May 2019 15:22:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB4FC7AC5; Wed, 8 May 2019 15:22:28 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FMSip002429; Wed, 8 May 2019 15:22:28 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FMRWm002422; Wed, 8 May 2019 15:22:27 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905081522.x48FMRWm002422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 8 May 2019 15:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347337 - head/sys/dev/xdma X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/xdma X-SVN-Commit-Revision: 347337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E19EB77E22 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:22:29 -0000 Author: br Date: Wed May 8 15:22:27 2019 New Revision: 347337 URL: https://svnweb.freebsd.org/changeset/base/347337 Log: o Implement a bounce buffer based on device reserved memory. Grab device reserved physical memory regions from FDT using standard "memory-region" property and use vmem(9) to allocate buffers from it. The same vmem could be used by DMA engine drivers to allocate memory for DMA descriptors. This is required for platforms that provide uncached memory region reserved exclusively for DMA operations. o Change sleepable sx(9) lock type to non-sleepable mutex(9) since network drivers usually hold mutex during DMA operations. So we don't take sleepable lock after non-sleepable. Tested on U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores. Sponsored by: DARPA, AFRL Modified: head/sys/dev/xdma/xdma.c head/sys/dev/xdma/xdma.h head/sys/dev/xdma/xdma_bank.c head/sys/dev/xdma/xdma_bio.c head/sys/dev/xdma/xdma_mbuf.c head/sys/dev/xdma/xdma_queue.c head/sys/dev/xdma/xdma_sg.c Modified: head/sys/dev/xdma/xdma.c ============================================================================== --- head/sys/dev/xdma/xdma.c Wed May 8 15:20:16 2019 (r347336) +++ head/sys/dev/xdma/xdma.c Wed May 8 15:22:27 2019 (r347337) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2016-2018 Ruslan Bukin - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2016-2019 Ruslan Bukin + * * This software was developed by SRI International and the University of * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 * ("CTSRD"), as part of the DARPA CRASH research programme. @@ -43,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -61,12 +61,14 @@ __FBSDID("$FreeBSD$"); * Multiple xDMA controllers may work with single DMA device, * so we have global lock for physical channel management. */ -static struct sx xdma_sx; +static struct mtx xdma_mtx; -#define XDMA_LOCK() sx_xlock(&xdma_sx) -#define XDMA_UNLOCK() sx_xunlock(&xdma_sx) -#define XDMA_ASSERT_LOCKED() sx_xassert(&xdma_sx, MA_OWNED) +#define XDMA_LOCK() mtx_lock(&xdma_mtx) +#define XDMA_UNLOCK() mtx_unlock(&xdma_mtx) +#define XDMA_ASSERT_LOCKED() mtx_assert(&xdma_mtx, MA_OWNED) +#define FDT_REG_CELLS 4 + /* * Allocate virtual xDMA channel. */ @@ -95,11 +97,11 @@ xdma_channel_alloc(xdma_controller_t *xdma, uint32_t c TAILQ_INIT(&xchan->ie_handlers); - sx_init(&xchan->sx_lock, "xDMA chan"); - sx_init(&xchan->sx_qin_lock, "xDMA qin"); - sx_init(&xchan->sx_qout_lock, "xDMA qout"); - sx_init(&xchan->sx_bank_lock, "xDMA bank"); - sx_init(&xchan->sx_proc_lock, "xDMA proc"); + mtx_init(&xchan->mtx_lock, "xDMA chan", NULL, MTX_DEF); + mtx_init(&xchan->mtx_qin_lock, "xDMA qin", NULL, MTX_DEF); + mtx_init(&xchan->mtx_qout_lock, "xDMA qout", NULL, MTX_DEF); + mtx_init(&xchan->mtx_bank_lock, "xDMA bank", NULL, MTX_DEF); + mtx_init(&xchan->mtx_proc_lock, "xDMA proc", NULL, MTX_DEF); TAILQ_INIT(&xchan->bank); TAILQ_INIT(&xchan->queue_in); @@ -138,11 +140,11 @@ xdma_channel_free(xdma_channel_t *xchan) xdma_teardown_all_intr(xchan); - sx_destroy(&xchan->sx_lock); - sx_destroy(&xchan->sx_qin_lock); - sx_destroy(&xchan->sx_qout_lock); - sx_destroy(&xchan->sx_bank_lock); - sx_destroy(&xchan->sx_proc_lock); + mtx_destroy(&xchan->mtx_lock); + mtx_destroy(&xchan->mtx_qin_lock); + mtx_destroy(&xchan->mtx_qout_lock); + mtx_destroy(&xchan->mtx_bank_lock); + mtx_destroy(&xchan->mtx_proc_lock); TAILQ_REMOVE(&xdma->channels, xchan, xchan_next); @@ -303,6 +305,95 @@ xdma_ofw_md_data(xdma_controller_t *xdma, pcell_t *cel return (ret); } +static int +xdma_handle_mem_node(vmem_t *vmem, phandle_t memory) +{ + pcell_t reg[FDT_REG_CELLS * FDT_MEM_REGIONS]; + pcell_t *regp; + int addr_cells, size_cells; + int i, reg_len, ret, tuple_size, tuples; + vmem_addr_t mem_start; + vmem_size_t mem_size; + + if ((ret = fdt_addrsize_cells(OF_parent(memory), &addr_cells, + &size_cells)) != 0) + return (ret); + + if (addr_cells > 2) + return (ERANGE); + + tuple_size = sizeof(pcell_t) * (addr_cells + size_cells); + reg_len = OF_getproplen(memory, "reg"); + if (reg_len <= 0 || reg_len > sizeof(reg)) + return (ERANGE); + + if (OF_getprop(memory, "reg", reg, reg_len) <= 0) + return (ENXIO); + + tuples = reg_len / tuple_size; + regp = (pcell_t *)® + for (i = 0; i < tuples; i++) { + ret = fdt_data_to_res(regp, addr_cells, size_cells, + &mem_start, &mem_size); + if (ret != 0) + return (ret); + + vmem_add(vmem, mem_start, mem_size, 0); + regp += addr_cells + size_cells; + } + + return (0); +} + +vmem_t * +xdma_get_memory(device_t dev) +{ + phandle_t mem_node, node; + pcell_t mem_handle; + vmem_t *vmem; + + node = ofw_bus_get_node(dev); + if (node <= 0) { + device_printf(dev, + "%s called on not ofw based device.\n", __func__); + return (NULL); + } + + if (!OF_hasprop(node, "memory-region")) + return (NULL); + + if (OF_getencprop(node, "memory-region", (void *)&mem_handle, + sizeof(mem_handle)) <= 0) + return (NULL); + + vmem = vmem_create("xDMA vmem", 0, 0, PAGE_SIZE, + PAGE_SIZE, M_BESTFIT | M_WAITOK); + if (vmem == NULL) + return (NULL); + + mem_node = OF_node_from_xref(mem_handle); + if (xdma_handle_mem_node(vmem, mem_node) != 0) { + vmem_destroy(vmem); + return (NULL); + } + + return (vmem); +} + +void +xdma_put_memory(vmem_t *vmem) +{ + + vmem_destroy(vmem); +} + +void +xchan_set_memory(xdma_channel_t *xchan, vmem_t *vmem) +{ + + xchan->vmem = vmem; +} + /* * Allocate xdma controller. */ @@ -400,7 +491,7 @@ static void xdma_init(void) { - sx_init(&xdma_sx, "xDMA"); + mtx_init(&xdma_mtx, "xDMA", NULL, MTX_DEF); } SYSINIT(xdma, SI_SUB_DRIVERS, SI_ORDER_FIRST, xdma_init, NULL); Modified: head/sys/dev/xdma/xdma.h ============================================================================== --- head/sys/dev/xdma/xdma.h Wed May 8 15:20:16 2019 (r347336) +++ head/sys/dev/xdma/xdma.h Wed May 8 15:22:27 2019 (r347337) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2016-2018 Ruslan Bukin - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2016-2019 Ruslan Bukin + * * This software was developed by SRI International and the University of * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 * ("CTSRD"), as part of the DARPA CRASH research programme. @@ -34,6 +35,7 @@ #define _DEV_XDMA_XDMA_H_ #include +#include enum xdma_direction { XDMA_MEM_TO_MEM, @@ -73,6 +75,7 @@ struct xdma_controller { device_t dev; /* DMA consumer device_t. */ device_t dma_dev; /* A real DMA device_t. */ void *data; /* OFW MD part. */ + vmem_t *vmem; /* Bounce memory. */ /* List of virtual channels allocated. */ TAILQ_HEAD(xdma_channel_list, xdma_channel) channels; @@ -84,6 +87,9 @@ struct xchan_buf { bus_dmamap_t map; uint32_t nsegs; uint32_t nsegs_left; + vm_offset_t vaddr; + vm_offset_t paddr; + vm_size_t size; }; struct xdma_request { @@ -117,6 +123,7 @@ struct xdma_sglist { struct xdma_channel { xdma_controller_t *xdma; + vmem_t *vmem; uint32_t flags; #define XCHAN_BUFS_ALLOCATED (1 << 0) @@ -139,11 +146,11 @@ struct xdma_channel { TAILQ_HEAD(, xdma_intr_handler) ie_handlers; TAILQ_ENTRY(xdma_channel) xchan_next; - struct sx sx_lock; - struct sx sx_qin_lock; - struct sx sx_qout_lock; - struct sx sx_bank_lock; - struct sx sx_proc_lock; + struct mtx mtx_lock; + struct mtx mtx_qin_lock; + struct mtx mtx_qout_lock; + struct mtx mtx_bank_lock; + struct mtx mtx_proc_lock; /* Request queue. */ bus_dma_tag_t dma_tag_bufs; @@ -176,30 +183,30 @@ struct xdma_intr_handler { static MALLOC_DEFINE(M_XDMA, "xdma", "xDMA framework"); -#define XCHAN_LOCK(xchan) sx_xlock(&(xchan)->sx_lock) -#define XCHAN_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_lock) +#define XCHAN_LOCK(xchan) mtx_lock(&(xchan)->mtx_lock) +#define XCHAN_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_lock) #define XCHAN_ASSERT_LOCKED(xchan) \ - sx_assert(&(xchan)->sx_lock, SX_XLOCKED) + mtx_assert(&(xchan)->mtx_lock, MA_OWNED) -#define QUEUE_IN_LOCK(xchan) sx_xlock(&(xchan)->sx_qin_lock) -#define QUEUE_IN_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_qin_lock) +#define QUEUE_IN_LOCK(xchan) mtx_lock(&(xchan)->mtx_qin_lock) +#define QUEUE_IN_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_qin_lock) #define QUEUE_IN_ASSERT_LOCKED(xchan) \ - sx_assert(&(xchan)->sx_qin_lock, SX_XLOCKED) + mtx_assert(&(xchan)->mtx_qin_lock, MA_OWNED) -#define QUEUE_OUT_LOCK(xchan) sx_xlock(&(xchan)->sx_qout_lock) -#define QUEUE_OUT_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_qout_lock) +#define QUEUE_OUT_LOCK(xchan) mtx_lock(&(xchan)->mtx_qout_lock) +#define QUEUE_OUT_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_qout_lock) #define QUEUE_OUT_ASSERT_LOCKED(xchan) \ - sx_assert(&(xchan)->sx_qout_lock, SX_XLOCKED) + mtx_assert(&(xchan)->mtx_qout_lock, MA_OWNED) -#define QUEUE_BANK_LOCK(xchan) sx_xlock(&(xchan)->sx_bank_lock) -#define QUEUE_BANK_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_bank_lock) +#define QUEUE_BANK_LOCK(xchan) mtx_lock(&(xchan)->mtx_bank_lock) +#define QUEUE_BANK_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_bank_lock) #define QUEUE_BANK_ASSERT_LOCKED(xchan) \ - sx_assert(&(xchan)->sx_bank_lock, SX_XLOCKED) + mtx_assert(&(xchan)->mtx_bank_lock, MA_OWNED) -#define QUEUE_PROC_LOCK(xchan) sx_xlock(&(xchan)->sx_proc_lock) -#define QUEUE_PROC_UNLOCK(xchan) sx_xunlock(&(xchan)->sx_proc_lock) +#define QUEUE_PROC_LOCK(xchan) mtx_lock(&(xchan)->mtx_proc_lock) +#define QUEUE_PROC_UNLOCK(xchan) mtx_unlock(&(xchan)->mtx_proc_lock) #define QUEUE_PROC_ASSERT_LOCKED(xchan) \ - sx_assert(&(xchan)->sx_proc_lock, SX_XLOCKED) + mtx_assert(&(xchan)->mtx_proc_lock, MA_OWNED) #define XDMA_SGLIST_MAXLEN 2048 #define XDMA_MAX_SEG 128 @@ -207,11 +214,14 @@ static MALLOC_DEFINE(M_XDMA, "xdma", "xDMA framework") /* xDMA controller ops */ xdma_controller_t *xdma_ofw_get(device_t dev, const char *prop); int xdma_put(xdma_controller_t *xdma); +vmem_t * xdma_get_memory(device_t dev); +void xdma_put_memory(vmem_t *vmem); /* xDMA channel ops */ xdma_channel_t * xdma_channel_alloc(xdma_controller_t *, uint32_t caps); int xdma_channel_free(xdma_channel_t *); int xdma_request(xdma_channel_t *xchan, struct xdma_request *r); +void xchan_set_memory(xdma_channel_t *xchan, vmem_t *vmem); /* SG interface */ int xdma_prep_sg(xdma_channel_t *, uint32_t, Modified: head/sys/dev/xdma/xdma_bank.c ============================================================================== --- head/sys/dev/xdma/xdma_bank.c Wed May 8 15:20:16 2019 (r347336) +++ head/sys/dev/xdma/xdma_bank.c Wed May 8 15:22:27 2019 (r347337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 Ruslan Bukin + * Copyright (c) 2018-2019 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include Modified: head/sys/dev/xdma/xdma_bio.c ============================================================================== --- head/sys/dev/xdma/xdma_bio.c Wed May 8 15:20:16 2019 (r347336) +++ head/sys/dev/xdma/xdma_bio.c Wed May 8 15:22:27 2019 (r347337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017-2018 Ruslan Bukin + * Copyright (c) 2017-2019 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include Modified: head/sys/dev/xdma/xdma_mbuf.c ============================================================================== --- head/sys/dev/xdma/xdma_mbuf.c Wed May 8 15:20:16 2019 (r347336) +++ head/sys/dev/xdma/xdma_mbuf.c Wed May 8 15:22:27 2019 (r347337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017-2018 Ruslan Bukin + * Copyright (c) 2017-2019 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/dev/xdma/xdma_queue.c ============================================================================== --- head/sys/dev/xdma/xdma_queue.c Wed May 8 15:20:16 2019 (r347336) +++ head/sys/dev/xdma/xdma_queue.c Wed May 8 15:22:27 2019 (r347337) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018 Ruslan Bukin + * Copyright (c) 2018-2019 Ruslan Bukin * All rights reserved. * * This software was developed by SRI International and the University of @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include Modified: head/sys/dev/xdma/xdma_sg.c ============================================================================== --- head/sys/dev/xdma/xdma_sg.c Wed May 8 15:20:16 2019 (r347336) +++ head/sys/dev/xdma/xdma_sg.c Wed May 8 15:22:27 2019 (r347337) @@ -1,7 +1,8 @@ /*- - * Copyright (c) 2018 Ruslan Bukin - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause * + * Copyright (c) 2018-2019 Ruslan Bukin + * * This software was developed by SRI International and the University of * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 * ("CTSRD"), as part of the DARPA CRASH research programme. @@ -38,10 +39,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include +#include +#include +#include + #ifdef FDT #include #include @@ -58,25 +63,71 @@ struct seg_load_request { uint32_t error; }; +static void +xchan_bufs_free_reserved(xdma_channel_t *xchan) +{ + struct xdma_request *xr; + vm_size_t size; + int i; + + for (i = 0; i < xchan->xr_num; i++) { + xr = &xchan->xr_mem[i]; + size = xr->buf.size; + if (xr->buf.vaddr) { + pmap_kremove_device(xr->buf.vaddr, size); + kva_free(xr->buf.vaddr, size); + xr->buf.vaddr = 0; + } + if (xr->buf.paddr) { + vmem_free(xchan->vmem, xr->buf.paddr, size); + xr->buf.paddr = 0; + } + xr->buf.size = 0; + } +} + static int -_xchan_bufs_alloc(xdma_channel_t *xchan) +xchan_bufs_alloc_reserved(xdma_channel_t *xchan) { xdma_controller_t *xdma; struct xdma_request *xr; + vmem_addr_t addr; + vm_size_t size; int i; xdma = xchan->xdma; + if (xchan->vmem == NULL) + return (ENOBUFS); + for (i = 0; i < xchan->xr_num; i++) { xr = &xchan->xr_mem[i]; - /* TODO: bounce buffer */ + size = round_page(xchan->maxsegsize); + if (vmem_alloc(xchan->vmem, size, + M_BESTFIT | M_NOWAIT, &addr)) { + device_printf(xdma->dev, + "%s: Can't allocate memory\n", __func__); + xchan_bufs_free_reserved(xchan); + return (ENOMEM); + } + + xr->buf.size = size; + xr->buf.paddr = addr; + xr->buf.vaddr = kva_alloc(size); + if (xr->buf.vaddr == 0) { + device_printf(xdma->dev, + "%s: Can't allocate KVA\n", __func__); + xchan_bufs_free_reserved(xchan); + return (ENOMEM); + } + pmap_kenter_device(xr->buf.vaddr, size, addr); } return (0); } static int -_xchan_bufs_alloc_busdma(xdma_channel_t *xchan) +xchan_bufs_alloc_busdma(xdma_channel_t *xchan) { xdma_controller_t *xdma; struct xdma_request *xr; @@ -138,9 +189,10 @@ xchan_bufs_alloc(xdma_channel_t *xchan) } if (xchan->caps & XCHAN_CAP_BUSDMA) - ret = _xchan_bufs_alloc_busdma(xchan); - else - ret = _xchan_bufs_alloc(xchan); + ret = xchan_bufs_alloc_busdma(xchan); + else { + ret = xchan_bufs_alloc_reserved(xchan); + } if (ret != 0) { device_printf(xdma->dev, "%s: Can't allocate bufs.\n", __func__); @@ -169,12 +221,8 @@ xchan_bufs_free(xdma_channel_t *xchan) bus_dmamap_destroy(xchan->dma_tag_bufs, b->map); } bus_dma_tag_destroy(xchan->dma_tag_bufs); - } else { - for (i = 0; i < xchan->xr_num; i++) { - xr = &xchan->xr_mem[i]; - /* TODO: bounce buffer */ - } - } + } else + xchan_bufs_free_reserved(xchan); xchan->flags &= ~XCHAN_BUFS_ALLOCATED; @@ -296,6 +344,11 @@ xchan_seg_done(xdma_channel_t *xchan, bus_dmamap_sync(xchan->dma_tag_bufs, b->map, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(xchan->dma_tag_bufs, b->map); + } else { + if (xr->req_type == XR_TYPE_MBUF && + xr->direction == XDMA_DEV_TO_MEM) + m_copyback(xr->m, 0, st->transferred, + (void *)xr->buf.vaddr); } xr->status.error = st->error; xr->status.transferred = st->transferred; @@ -437,7 +490,13 @@ _xdma_load_data(xdma_channel_t *xchan, struct xdma_req switch (xr->req_type) { case XR_TYPE_MBUF: - seg[0].ds_addr = mtod(m, bus_addr_t); + if ((xchan->caps & XCHAN_CAP_NOBUFS) == 0) { + if (xr->direction == XDMA_MEM_TO_DEV) + m_copydata(m, 0, m->m_pkthdr.len, + (void *)xr->buf.vaddr); + seg[0].ds_addr = (bus_addr_t)xr->buf.paddr; + } else + seg[0].ds_addr = mtod(m, bus_addr_t); seg[0].ds_len = m->m_pkthdr.len; break; case XR_TYPE_BIO: @@ -494,6 +553,7 @@ xdma_process(xdma_channel_t *xchan, xdma = xchan->xdma; n = 0; + c = 0; ret = XDMA_CHANNEL_CAPACITY(xdma->dma_dev, xchan, &capacity); if (ret != 0) { From owner-svn-src-all@freebsd.org Wed May 8 15:23:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C4EC158A3F4; Wed, 8 May 2019 15:23:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 102238001E; Wed, 8 May 2019 15:23:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8A3F7ACB; Wed, 8 May 2019 15:23:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FNj8n002535; Wed, 8 May 2019 15:23:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FNj5E002534; Wed, 8 May 2019 15:23:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905081523.x48FNj5E002534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 8 May 2019 15:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347338 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 102238001E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:23:46 -0000 Author: mav Date: Wed May 8 15:23:45 2019 New Revision: 347338 URL: https://svnweb.freebsd.org/changeset/base/347338 Log: MFC r346898: ip multicast debug: fix strings vs defines Turning on multicast debug made multicast failure worse because the strings and #define values no longer matched up. Fix them, and make sure they stay matched-up. Modified: stable/12/sys/netinet/in_mcast.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in_mcast.c ============================================================================== --- stable/12/sys/netinet/in_mcast.c Wed May 8 15:22:27 2019 (r347337) +++ stable/12/sys/netinet/in_mcast.c Wed May 8 15:23:45 2019 (r347338) @@ -3054,7 +3054,14 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_ARGS) #if defined(KTR) && (KTR_COMPILE & KTR_IGMPV3) -static const char *inm_modestrs[] = { "un", "in", "ex" }; +static const char *inm_modestrs[] = { + [MCAST_UNDEFINED] = "un", + [MCAST_INCLUDE] = "in", + [MCAST_EXCLUDE] = "ex", +}; +_Static_assert(MCAST_UNDEFINED == 0 && + MCAST_EXCLUDE + 1 == nitems(inm_modestrs), + "inm_modestrs: no longer matches #defines"); static const char * inm_mode_str(const int mode) @@ -3066,16 +3073,20 @@ inm_mode_str(const int mode) } static const char *inm_statestrs[] = { - "not-member", - "silent", - "idle", - "lazy", - "sleeping", - "awakening", - "query-pending", - "sg-query-pending", - "leaving" + [IGMP_NOT_MEMBER] = "not-member", + [IGMP_SILENT_MEMBER] = "silent", + [IGMP_REPORTING_MEMBER] = "reporting", + [IGMP_IDLE_MEMBER] = "idle", + [IGMP_LAZY_MEMBER] = "lazy", + [IGMP_SLEEPING_MEMBER] = "sleeping", + [IGMP_AWAKENING_MEMBER] = "awakening", + [IGMP_G_QUERY_PENDING_MEMBER] = "query-pending", + [IGMP_SG_QUERY_PENDING_MEMBER] = "sg-query-pending", + [IGMP_LEAVING_MEMBER] = "leaving", }; +_Static_assert(IGMP_NOT_MEMBER == 0 && + IGMP_LEAVING_MEMBER + 1 == nitems(inm_statestrs), + "inm_statetrs: no longer matches #defines"); static const char * inm_state_str(const int state) From owner-svn-src-all@freebsd.org Wed May 8 15:24:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1F4D158A441; Wed, 8 May 2019 15:24:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 981A780139; Wed, 8 May 2019 15:24:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B4327ACC; Wed, 8 May 2019 15:24:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FO6H9002610; Wed, 8 May 2019 15:24:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FO6FK002609; Wed, 8 May 2019 15:24:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905081524.x48FO6FK002609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 8 May 2019 15:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347339 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 347339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 981A780139 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:24:07 -0000 Author: mav Date: Wed May 8 15:24:05 2019 New Revision: 347339 URL: https://svnweb.freebsd.org/changeset/base/347339 Log: MFC r346898: ip multicast debug: fix strings vs defines Turning on multicast debug made multicast failure worse because the strings and #define values no longer matched up. Fix them, and make sure they stay matched-up. Modified: stable/11/sys/netinet/in_mcast.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/in_mcast.c ============================================================================== --- stable/11/sys/netinet/in_mcast.c Wed May 8 15:23:45 2019 (r347338) +++ stable/11/sys/netinet/in_mcast.c Wed May 8 15:24:05 2019 (r347339) @@ -2935,7 +2935,14 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_ARGS) #if defined(KTR) && (KTR_COMPILE & KTR_IGMPV3) -static const char *inm_modestrs[] = { "un", "in", "ex" }; +static const char *inm_modestrs[] = { + [MCAST_UNDEFINED] = "un", + [MCAST_INCLUDE] = "in", + [MCAST_EXCLUDE] = "ex", +}; +_Static_assert(MCAST_UNDEFINED == 0 && + MCAST_EXCLUDE + 1 == nitems(inm_modestrs), + "inm_modestrs: no longer matches #defines"); static const char * inm_mode_str(const int mode) @@ -2947,16 +2954,20 @@ inm_mode_str(const int mode) } static const char *inm_statestrs[] = { - "not-member", - "silent", - "idle", - "lazy", - "sleeping", - "awakening", - "query-pending", - "sg-query-pending", - "leaving" + [IGMP_NOT_MEMBER] = "not-member", + [IGMP_SILENT_MEMBER] = "silent", + [IGMP_REPORTING_MEMBER] = "reporting", + [IGMP_IDLE_MEMBER] = "idle", + [IGMP_LAZY_MEMBER] = "lazy", + [IGMP_SLEEPING_MEMBER] = "sleeping", + [IGMP_AWAKENING_MEMBER] = "awakening", + [IGMP_G_QUERY_PENDING_MEMBER] = "query-pending", + [IGMP_SG_QUERY_PENDING_MEMBER] = "sg-query-pending", + [IGMP_LEAVING_MEMBER] = "leaving", }; +_Static_assert(IGMP_NOT_MEMBER == 0 && + IGMP_LEAVING_MEMBER + 1 == nitems(inm_statestrs), + "inm_statetrs: no longer matches #defines"); static const char * inm_state_str(const int state) From owner-svn-src-all@freebsd.org Wed May 8 15:25:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D75D158A4F5; Wed, 8 May 2019 15:25:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6A07802A9; Wed, 8 May 2019 15:25:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0B7C7ACD; Wed, 8 May 2019 15:25:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FP7uv002721; Wed, 8 May 2019 15:25:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FP7Ll002720; Wed, 8 May 2019 15:25:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905081525.x48FP7Ll002720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 8 May 2019 15:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347340 - stable/12/usr.sbin/mountd X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/usr.sbin/mountd X-SVN-Commit-Revision: 347340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E6A07802A9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:25:08 -0000 Author: mav Date: Wed May 8 15:25:07 2019 New Revision: 347340 URL: https://svnweb.freebsd.org/changeset/base/347340 Log: MFC r346976: Respect quotes and escapes when splitting exports fields. Without this r293305 was still unable to handle names with spaces. Modified: stable/12/usr.sbin/mountd/mountd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mountd/mountd.c ============================================================================== --- stable/12/usr.sbin/mountd/mountd.c Wed May 8 15:24:05 2019 (r347339) +++ stable/12/usr.sbin/mountd/mountd.c Wed May 8 15:25:07 2019 (r347340) @@ -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(&namelist, " \t\n"); - name = strsep(&names, ":"); + names = namelist; + name = strsep_quote(&names, ":"); /* 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(&names, ":"); + name = strsep_quote(&names, ":"); if (isdigit(*name) || *name == '-') { cr->cr_groups[cr->cr_ngroups++] = atoi(name); } else { From owner-svn-src-all@freebsd.org Wed May 8 15:25:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68340158A54D; Wed, 8 May 2019 15:25:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C540803A6; Wed, 8 May 2019 15:25:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8AA27ACE; Wed, 8 May 2019 15:25:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FPRv9002791; Wed, 8 May 2019 15:25:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FPR1n002790; Wed, 8 May 2019 15:25:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905081525.x48FPR1n002790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 8 May 2019 15:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347341 - stable/11/usr.sbin/mountd X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/usr.sbin/mountd X-SVN-Commit-Revision: 347341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C540803A6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:25:28 -0000 Author: mav Date: Wed May 8 15:25:27 2019 New Revision: 347341 URL: https://svnweb.freebsd.org/changeset/base/347341 Log: MFC r346976: Respect quotes and escapes when splitting exports fields. Without this r293305 was still unable to handle names with spaces. Modified: stable/11/usr.sbin/mountd/mountd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/mountd/mountd.c ============================================================================== --- stable/11/usr.sbin/mountd/mountd.c Wed May 8 15:25:07 2019 (r347340) +++ stable/11/usr.sbin/mountd/mountd.c Wed May 8 15:25:27 2019 (r347341) @@ -2822,18 +2822,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; } /* @@ -2905,8 +2914,8 @@ parsecred(char *namelist, struct xucred *cr) /* * Get the user's password table entry. */ - names = strsep_quote(&namelist, " \t\n"); - name = strsep(&names, ":"); + names = namelist; + name = strsep_quote(&names, ":"); /* Bug? name could be NULL here */ if (isdigit(*name) || *name == '-') pw = getpwuid(atoi(name)); @@ -2950,7 +2959,7 @@ parsecred(char *namelist, struct xucred *cr) } cr->cr_ngroups = 0; while (names != NULL && *names != '\0' && cr->cr_ngroups < XU_NGROUPS) { - name = strsep(&names, ":"); + name = strsep_quote(&names, ":"); if (isdigit(*name) || *name == '-') { cr->cr_groups[cr->cr_ngroups++] = atoi(name); } else { From owner-svn-src-all@freebsd.org Wed May 8 15:36:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3ED0158A8B1; Wed, 8 May 2019 15:36:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 401CF80933; Wed, 8 May 2019 15:36:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B2DF7C6F; Wed, 8 May 2019 15:36:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Favwq007972; Wed, 8 May 2019 15:36:57 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Fav3I007969; Wed, 8 May 2019 15:36:57 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905081536.x48Fav3I007969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 8 May 2019 15:36:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347342 - in head/sys/dev: mii xilinx X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/dev: mii xilinx X-SVN-Commit-Revision: 347342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 401CF80933 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:36:58 -0000 Author: br Date: Wed May 8 15:36:57 2019 New Revision: 347342 URL: https://svnweb.freebsd.org/changeset/base/347342 Log: Add driver for Xilinx AXI Ethernet tri-mode (10/100/1000 Mb/s) MAC found in the U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores. Sponsored by: DARPA, AFRL Added: head/sys/dev/mii/tiphy.h (contents, props changed) head/sys/dev/xilinx/if_xae.c (contents, props changed) head/sys/dev/xilinx/if_xaereg.h (contents, props changed) head/sys/dev/xilinx/if_xaevar.h (contents, props changed) Added: head/sys/dev/mii/tiphy.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mii/tiphy.h Wed May 8 15:36:57 2019 (r347342) @@ -0,0 +1,57 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Texas Instruments DP83867IR/CR Robust, High Immunity + * 10/100/1000 Ethernet Physical Layer Transceiver. + */ + +#ifndef _DEV_MII_TIPHY_H_ +#define _DEV_MII_TIPHY_H_ + +#define DP83867_PHYCR 0x10 /* PHY Control Register */ +#define PHYCR_SGMII_EN (1 << 11) +#define DP83867_CFG2 0x14 /* Configuration Register 2 */ +#define CFG2_SPEED_OPT_10M_EN (1 << 6) /* Speed Optimization */ +#define CFG2_SPEED_OPT_ENHANCED_EN (1 << 8) +#define CFG2_SPEED_OPT_ATTEMPT_CNT_S 10 +#define CFG2_SPEED_OPT_ATTEMPT_CNT_M (0x3 << CFG2_SPEED_OPT_ATTEMPT_CNT_S) +#define CFG2_SPEED_OPT_ATTEMPT_CNT_1 (0 << CFG2_SPEED_OPT_ATTEMPT_CNT_S) +#define CFG2_SPEED_OPT_ATTEMPT_CNT_2 (1 << CFG2_SPEED_OPT_ATTEMPT_CNT_S) +#define CFG2_SPEED_OPT_ATTEMPT_CNT_4 (2 << CFG2_SPEED_OPT_ATTEMPT_CNT_S) +#define CFG2_SPEED_OPT_ATTEMPT_CNT_8 (3 << CFG2_SPEED_OPT_ATTEMPT_CNT_S) +#define CFG2_INTERRUPT_POLARITY (1 << 13) /* Int pin is active low. */ +#define DP83867_CFG4 0x31 /* Configuration Register 4 */ + +#endif /* !_DEV_MII_TIPHY_H_ */ Added: head/sys/dev/xilinx/if_xae.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xilinx/if_xae.c Wed May 8 15:36:57 2019 (r347342) @@ -0,0 +1,1097 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "miibus_if.h" + +#define READ4(_sc, _reg) \ + bus_read_4((_sc)->res[0], _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_write_4((_sc)->res[0], _reg, _val) + +#define READ8(_sc, _reg) \ + bus_read_8((_sc)->res[0], _reg) +#define WRITE8(_sc, _reg, _val) \ + bus_write_8((_sc)->res[0], _reg, _val) + +#define XAE_LOCK(sc) mtx_lock(&(sc)->mtx) +#define XAE_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define XAE_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED) +#define XAE_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED) + +#define XAE_DEBUG +#undef XAE_DEBUG + +#ifdef XAE_DEBUG +#define dprintf(fmt, ...) printf(fmt, ##__VA_ARGS__) +#else +#define dprintf(fmt, ...) +#endif + +#define RX_QUEUE_SIZE 64 +#define TX_QUEUE_SIZE 64 +#define NUM_RX_MBUF 16 +#define BUFRING_SIZE 8192 +#define MDIO_CLK_DIV_DEFAULT 29 + +#define PHY1_RD(sc, _r) \ + xae_miibus_read_reg(sc->dev, 1, _r) +#define PHY1_WR(sc, _r, _v) \ + xae_miibus_write_reg(sc->dev, 1, _r, _v) + +#define PHY_RD(sc, _r) \ + xae_miibus_read_reg(sc->dev, sc->phy_addr, _r) +#define PHY_WR(sc, _r, _v) \ + xae_miibus_write_reg(sc->dev, sc->phy_addr, _r, _v) + +/* Use this macro to access regs > 0x1f */ +#define WRITE_TI_EREG(sc, reg, data) { \ + PHY_WR(sc, MII_MMDACR, MMDACR_DADDRMASK); \ + PHY_WR(sc, MII_MMDAADR, reg); \ + PHY_WR(sc, MII_MMDACR, MMDACR_DADDRMASK | MMDACR_FN_DATANPI); \ + PHY_WR(sc, MII_MMDAADR, data); \ +} + +/* Not documented, Xilinx VCU118 workaround */ +#define CFG4_SGMII_TMR 0x160 /* bits 8:7 MUST be '10' */ +#define DP83867_SGMIICTL1 0xD3 /* not documented register */ +#define SGMIICTL1_SGMII_6W (1 << 14) /* no idea what it is */ + +static struct resource_spec xae_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static void xae_stop_locked(struct xae_softc *sc); +static void xae_setup_rxfilter(struct xae_softc *sc); + +static int +xae_rx_enqueue(struct xae_softc *sc, uint32_t n) +{ + struct mbuf *m; + int i; + + for (i = 0; i < n; i++) { + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) { + device_printf(sc->dev, + "%s: Can't alloc rx mbuf\n", __func__); + return (-1); + } + + m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; + xdma_enqueue_mbuf(sc->xchan_rx, &m, 0, 4, 4, XDMA_DEV_TO_MEM); + } + + return (0); +} + +static int +xae_get_phyaddr(phandle_t node, int *phy_addr) +{ + phandle_t phy_node; + pcell_t phy_handle, phy_reg; + + if (OF_getencprop(node, "phy-handle", (void *)&phy_handle, + sizeof(phy_handle)) <= 0) + return (ENXIO); + + phy_node = OF_node_from_xref(phy_handle); + + if (OF_getencprop(phy_node, "reg", (void *)&phy_reg, + sizeof(phy_reg)) <= 0) + return (ENXIO); + + *phy_addr = phy_reg; + + return (0); +} + +static int +xae_xdma_tx_intr(void *arg, xdma_transfer_status_t *status) +{ + xdma_transfer_status_t st; + struct xae_softc *sc; + struct ifnet *ifp; + struct mbuf *m; + int err; + + sc = arg; + + XAE_LOCK(sc); + + ifp = sc->ifp; + + for (;;) { + err = xdma_dequeue_mbuf(sc->xchan_tx, &m, &st); + if (err != 0) { + break; + } + + if (st.error != 0) { + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + } + + m_freem(m); + } + + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + XAE_UNLOCK(sc); + + return (0); +} + +static int +xae_xdma_rx_intr(void *arg, xdma_transfer_status_t *status) +{ + xdma_transfer_status_t st; + struct xae_softc *sc; + struct ifnet *ifp; + struct mbuf *m; + int err; + uint32_t cnt_processed; + + sc = arg; + + dprintf("%s\n", __func__); + + XAE_LOCK(sc); + + ifp = sc->ifp; + + cnt_processed = 0; + for (;;) { + err = xdma_dequeue_mbuf(sc->xchan_rx, &m, &st); + if (err != 0) { + break; + } + cnt_processed++; + + if (st.error != 0) { + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + m_freem(m); + continue; + } + + m->m_pkthdr.len = m->m_len = st.transferred; + m->m_pkthdr.rcvif = ifp; + XAE_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + XAE_LOCK(sc); + } + + xae_rx_enqueue(sc, cnt_processed); + + XAE_UNLOCK(sc); + + return (0); +} + +static void +xae_qflush(struct ifnet *ifp) +{ + struct xae_softc *sc; + + sc = ifp->if_softc; +} + +static int +xae_transmit_locked(struct ifnet *ifp) +{ + struct xae_softc *sc; + struct mbuf *m; + struct buf_ring *br; + int error; + int enq; + + dprintf("%s\n", __func__); + + sc = ifp->if_softc; + br = sc->br; + + enq = 0; + + while ((m = drbr_peek(ifp, br)) != NULL) { + error = xdma_enqueue_mbuf(sc->xchan_tx, + &m, 0, 4, 4, XDMA_MEM_TO_DEV); + if (error != 0) { + /* No space in request queue available yet. */ + drbr_putback(ifp, br, m); + break; + } + + drbr_advance(ifp, br); + + enq++; + + /* If anyone is interested give them a copy. */ + ETHER_BPF_MTAP(ifp, m); + } + + if (enq > 0) + xdma_queue_submit(sc->xchan_tx); + + return (0); +} + +static int +xae_transmit(struct ifnet *ifp, struct mbuf *m) +{ + struct xae_softc *sc; + int error; + + dprintf("%s\n", __func__); + + sc = ifp->if_softc; + + XAE_LOCK(sc); + + error = drbr_enqueue(ifp, sc->br, m); + if (error) { + XAE_UNLOCK(sc); + return (error); + } + + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) { + XAE_UNLOCK(sc); + return (0); + } + + if (!sc->link_is_up) { + XAE_UNLOCK(sc); + return (0); + } + + error = xae_transmit_locked(ifp); + + XAE_UNLOCK(sc); + + return (error); +} + +static void +xae_stop_locked(struct xae_softc *sc) +{ + struct ifnet *ifp; + uint32_t reg; + + XAE_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + + callout_stop(&sc->xae_callout); + + /* Stop the transmitter */ + reg = READ4(sc, XAE_TC); + reg &= ~TC_TX; + WRITE4(sc, XAE_TC, reg); + + /* Stop the receiver. */ + reg = READ4(sc, XAE_RCW1); + reg &= ~RCW1_RX; + WRITE4(sc, XAE_RCW1, reg); +} + +static uint64_t +xae_stat(struct xae_softc *sc, int counter_id) +{ + uint64_t new, old; + uint64_t delta; + + KASSERT(counter_id < XAE_MAX_COUNTERS, + ("counter %d is out of range", counter_id)); + + new = READ8(sc, XAE_STATCNT(counter_id)); + old = sc->counters[counter_id]; + + if (new >= old) + delta = new - old; + else + delta = UINT64_MAX - old + new; + sc->counters[counter_id] = new; + + return (delta); +} + +static void +xae_harvest_stats(struct xae_softc *sc) +{ + struct ifnet *ifp; + + ifp = sc->ifp; + + if_inc_counter(ifp, IFCOUNTER_IPACKETS, xae_stat(sc, RX_GOOD_FRAMES)); + if_inc_counter(ifp, IFCOUNTER_IMCASTS, xae_stat(sc, RX_GOOD_MCASTS)); + if_inc_counter(ifp, IFCOUNTER_IERRORS, + xae_stat(sc, RX_FRAME_CHECK_SEQ_ERROR) + + xae_stat(sc, RX_LEN_OUT_OF_RANGE) + + xae_stat(sc, RX_ALIGNMENT_ERRORS)); + + if_inc_counter(ifp, IFCOUNTER_OBYTES, xae_stat(sc, TX_BYTES)); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, xae_stat(sc, TX_GOOD_FRAMES)); + if_inc_counter(ifp, IFCOUNTER_OMCASTS, xae_stat(sc, TX_GOOD_MCASTS)); + if_inc_counter(ifp, IFCOUNTER_OERRORS, + xae_stat(sc, TX_GOOD_UNDERRUN_ERRORS)); + + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + xae_stat(sc, TX_SINGLE_COLLISION_FRAMES) + + xae_stat(sc, TX_MULTI_COLLISION_FRAMES) + + xae_stat(sc, TX_LATE_COLLISIONS) + + xae_stat(sc, TX_EXCESS_COLLISIONS)); +} + +static void +xae_tick(void *arg) +{ + struct xae_softc *sc; + struct ifnet *ifp; + int link_was_up; + + sc = arg; + + XAE_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + return; + + /* Gather stats from hardware counters. */ + xae_harvest_stats(sc); + + /* Check the media status. */ + link_was_up = sc->link_is_up; + mii_tick(sc->mii_softc); + if (sc->link_is_up && !link_was_up) + xae_transmit_locked(sc->ifp); + + /* Schedule another check one second from now. */ + callout_reset(&sc->xae_callout, hz, xae_tick, sc); +} + +static void +xae_init_locked(struct xae_softc *sc) +{ + struct ifnet *ifp; + + XAE_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + return; + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + + xae_setup_rxfilter(sc); + + /* Enable the transmitter */ + WRITE4(sc, XAE_TC, TC_TX); + + /* Enable the receiver. */ + WRITE4(sc, XAE_RCW1, RCW1_RX); + + /* + * Call mii_mediachg() which will call back into xae_miibus_statchg() + * to set up the remaining config registers based on current media. + */ + mii_mediachg(sc->mii_softc); + callout_reset(&sc->xae_callout, hz, xae_tick, sc); +} + +static void +xae_init(void *arg) +{ + struct xae_softc *sc; + + sc = arg; + + XAE_LOCK(sc); + xae_init_locked(sc); + XAE_UNLOCK(sc); +} + +static void +xae_media_status(struct ifnet * ifp, struct ifmediareq *ifmr) +{ + struct xae_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = sc->mii_softc; + + XAE_LOCK(sc); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + XAE_UNLOCK(sc); +} + +static int +xae_media_change_locked(struct xae_softc *sc) +{ + + return (mii_mediachg(sc->mii_softc)); +} + +static int +xae_media_change(struct ifnet * ifp) +{ + struct xae_softc *sc; + int error; + + sc = ifp->if_softc; + + XAE_LOCK(sc); + error = xae_media_change_locked(sc); + XAE_UNLOCK(sc); + + return (error); +} + +static void +xae_setup_rxfilter(struct xae_softc *sc) +{ + struct ifmultiaddr *ifma; + struct ifnet *ifp; + uint32_t reg; + uint8_t *ma; + int i; + + XAE_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + + /* + * Set the multicast (group) filter hash. + */ + if ((ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) != 0) { + reg = READ4(sc, XAE_FFC); + reg |= FFC_PM; + WRITE4(sc, XAE_FFC, reg); + } else { + reg = READ4(sc, XAE_FFC); + reg &= ~FFC_PM; + WRITE4(sc, XAE_FFC, reg); + + if_maddr_rlock(ifp); + + i = 0; + CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + + if (i >= XAE_MULTICAST_TABLE_SIZE) + break; + + ma = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); + + reg = READ4(sc, XAE_FFC) & 0xffffff00; + reg |= i++; + WRITE4(sc, XAE_FFC, reg); + + reg = (ma[0]); + reg |= (ma[1] << 8); + reg |= (ma[2] << 16); + reg |= (ma[3] << 24); + WRITE4(sc, XAE_FFV(0), reg); + + reg = ma[4]; + reg |= ma[5] << 8; + WRITE4(sc, XAE_FFV(1), reg); + } + if_maddr_runlock(ifp); + } + + /* + * Set the primary address. + */ + reg = sc->macaddr[0]; + reg |= (sc->macaddr[1] << 8); + reg |= (sc->macaddr[2] << 16); + reg |= (sc->macaddr[3] << 24); + WRITE4(sc, XAE_UAW0, reg); + + reg = sc->macaddr[4]; + reg |= (sc->macaddr[5] << 8); + WRITE4(sc, XAE_UAW1, reg); +} + +static int +xae_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + struct xae_softc *sc; + struct mii_data *mii; + struct ifreq *ifr; + int mask, error; + + sc = ifp->if_softc; + ifr = (struct ifreq *)data; + + error = 0; + switch (cmd) { + case SIOCSIFFLAGS: + XAE_LOCK(sc); + if (ifp->if_flags & IFF_UP) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if ((ifp->if_flags ^ sc->if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) + xae_setup_rxfilter(sc); + } else { + if (!sc->is_detaching) + xae_init_locked(sc); + } + } else { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + xae_stop_locked(sc); + } + sc->if_flags = ifp->if_flags; + XAE_UNLOCK(sc); + break; + case SIOCADDMULTI: + case SIOCDELMULTI: + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + XAE_LOCK(sc); + xae_setup_rxfilter(sc); + XAE_UNLOCK(sc); + } + break; + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + mii = sc->mii_softc; + error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, cmd); + break; + case SIOCSIFCAP: + mask = ifp->if_capenable ^ ifr->ifr_reqcap; + if (mask & IFCAP_VLAN_MTU) { + /* No work to do except acknowledge the change took */ + ifp->if_capenable ^= IFCAP_VLAN_MTU; + } + break; + + default: + error = ether_ioctl(ifp, cmd, data); + break; + } + + return (error); +} + +static void +xae_intr(void *arg) +{ + +} + +static int +xae_get_hwaddr(struct xae_softc *sc, uint8_t *hwaddr) +{ + phandle_t node; + int len; + + node = ofw_bus_get_node(sc->dev); + + /* Check if there is property */ + if ((len = OF_getproplen(node, "local-mac-address")) <= 0) + return (EINVAL); + + if (len != ETHER_ADDR_LEN) + return (EINVAL); + + OF_getprop(node, "local-mac-address", hwaddr, + ETHER_ADDR_LEN); + + return (0); +} + +static int +mdio_wait(struct xae_softc *sc) +{ + uint32_t reg; + int timeout; + + timeout = 200; + + do { + reg = READ4(sc, XAE_MDIO_CTRL); + if (reg & MDIO_CTRL_READY) + break; + DELAY(1); + } while (timeout--); + + if (timeout <= 0) { + printf("Failed to get MDIO ready\n"); + return (1); + } + + return (0); +} + +static int +xae_miibus_read_reg(device_t dev, int phy, int reg) +{ + struct xae_softc *sc; + uint32_t mii; + int rv; + + sc = device_get_softc(dev); + + if (mdio_wait(sc)) + return (0); + + mii = MDIO_CTRL_TX_OP_READ | MDIO_CTRL_INITIATE; + mii |= (reg << MDIO_TX_REGAD_S); + mii |= (phy << MDIO_TX_PHYAD_S); + + WRITE4(sc, XAE_MDIO_CTRL, mii); + + if (mdio_wait(sc)) + return (0); + + rv = READ4(sc, XAE_MDIO_READ); + + return (rv); +} + +static int +xae_miibus_write_reg(device_t dev, int phy, int reg, int val) +{ + struct xae_softc *sc; + uint32_t mii; + + sc = device_get_softc(dev); + + if (mdio_wait(sc)) + return (1); + + mii = MDIO_CTRL_TX_OP_WRITE | MDIO_CTRL_INITIATE; + mii |= (reg << MDIO_TX_REGAD_S); + mii |= (phy << MDIO_TX_PHYAD_S); + + WRITE4(sc, XAE_MDIO_WRITE, val); + WRITE4(sc, XAE_MDIO_CTRL, mii); + + if (mdio_wait(sc)) + return (1); + + return (0); +} + +static void +xae_phy_fixup(struct xae_softc *sc) +{ + uint32_t reg; + device_t dev; + + dev = sc->dev; + + do { + WRITE_TI_EREG(sc, DP83867_SGMIICTL1, SGMIICTL1_SGMII_6W); + PHY_WR(sc, DP83867_PHYCR, PHYCR_SGMII_EN); + + reg = PHY_RD(sc, DP83867_CFG2); + reg &= ~CFG2_SPEED_OPT_ATTEMPT_CNT_M; + reg |= (CFG2_SPEED_OPT_ATTEMPT_CNT_4); + reg |= CFG2_INTERRUPT_POLARITY; + reg |= CFG2_SPEED_OPT_ENHANCED_EN; + reg |= CFG2_SPEED_OPT_10M_EN; + PHY_WR(sc, DP83867_CFG2, reg); + + WRITE_TI_EREG(sc, DP83867_CFG4, CFG4_SGMII_TMR); + PHY_WR(sc, MII_BMCR, + BMCR_AUTOEN | BMCR_FDX | BMCR_SPEED1 | BMCR_RESET); + } while (PHY1_RD(sc, MII_BMCR) == 0x0ffff); + + do { + PHY1_WR(sc, MII_BMCR, + BMCR_AUTOEN | BMCR_FDX | BMCR_SPEED1 | BMCR_STARTNEG); + DELAY(40000); + } while ((PHY1_RD(sc, MII_BMSR) & BMSR_ACOMP) == 0); +} + +static int +setup_xdma(struct xae_softc *sc) +{ + device_t dev; + vmem_t *vmem; + int error; + + dev = sc->dev; + + /* Get xDMA controller */ + sc->xdma_tx = xdma_ofw_get(sc->dev, "tx"); + if (sc->xdma_tx == NULL) { + device_printf(dev, "Could not find DMA controller.\n"); + return (ENXIO); + } + + sc->xdma_rx = xdma_ofw_get(sc->dev, "rx"); + if (sc->xdma_rx == NULL) { + device_printf(dev, "Could not find DMA controller.\n"); + return (ENXIO); + } + + /* Alloc xDMA TX virtual channel. */ + sc->xchan_tx = xdma_channel_alloc(sc->xdma_tx, 0); + if (sc->xchan_tx == NULL) { + device_printf(dev, "Can't alloc virtual DMA TX channel.\n"); + return (ENXIO); + } + + /* Setup interrupt handler. */ + error = xdma_setup_intr(sc->xchan_tx, + xae_xdma_tx_intr, sc, &sc->ih_tx); + if (error) { + device_printf(sc->dev, + "Can't setup xDMA TX interrupt handler.\n"); + return (ENXIO); + } + + /* Alloc xDMA RX virtual channel. */ + sc->xchan_rx = xdma_channel_alloc(sc->xdma_rx, 0); + if (sc->xchan_rx == NULL) { + device_printf(dev, "Can't alloc virtual DMA RX channel.\n"); + return (ENXIO); + } + + /* Setup interrupt handler. */ + error = xdma_setup_intr(sc->xchan_rx, + xae_xdma_rx_intr, sc, &sc->ih_rx); + if (error) { + device_printf(sc->dev, + "Can't setup xDMA RX interrupt handler.\n"); + return (ENXIO); + } + + /* Setup bounce buffer */ + vmem = xdma_get_memory(dev); + if (vmem) { + xchan_set_memory(sc->xchan_tx, vmem); + xchan_set_memory(sc->xchan_rx, vmem); + } + + xdma_prep_sg(sc->xchan_tx, + TX_QUEUE_SIZE, /* xchan requests queue size */ + MCLBYTES, /* maxsegsize */ + 8, /* maxnsegs */ + 16, /* alignment */ + 0, /* boundary */ + BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR); + + xdma_prep_sg(sc->xchan_rx, + RX_QUEUE_SIZE, /* xchan requests queue size */ + MCLBYTES, /* maxsegsize */ + 1, /* maxnsegs */ + 16, /* alignment */ + 0, /* boundary */ + BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR); + + return (0); +} + +static int +xae_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "xlnx,axi-ethernet-1.00.a")) + return (ENXIO); + + device_set_desc(dev, "Xilinx AXI Ethernet"); + + return (BUS_PROBE_DEFAULT); +} + +static int +xae_attach(device_t dev) +{ + struct xae_softc *sc; + struct ifnet *ifp; + phandle_t node; + uint32_t reg; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + if (setup_xdma(sc) != 0) { + device_printf(dev, "Could not setup xDMA.\n"); + return (ENXIO); + } + + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), + MTX_NETWORK_LOCK, MTX_DEF); + + sc->br = buf_ring_alloc(BUFRING_SIZE, M_DEVBUF, + M_NOWAIT, &sc->mtx); + if (sc->br == NULL) + return (ENOMEM); + + if (bus_alloc_resources(dev, xae_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + device_printf(sc->dev, "Identification: %x\n", + READ4(sc, XAE_IDENT)); + + /* Get MAC addr */ + if (xae_get_hwaddr(sc, sc->macaddr)) { + device_printf(sc->dev, "can't get mac\n"); + return (ENXIO); + } + + /* Enable MII clock */ + reg = (MDIO_CLK_DIV_DEFAULT << MDIO_SETUP_CLK_DIV_S); + reg |= MDIO_SETUP_ENABLE; + WRITE4(sc, XAE_MDIO_SETUP, reg); + if (mdio_wait(sc)) + return (ENXIO); + + callout_init_mtx(&sc->xae_callout, &sc->mtx, 0); + + /* Setup interrupt handler. */ + error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_NET | INTR_MPSAFE, + NULL, xae_intr, sc, &sc->intr_cookie); + if (error != 0) { + device_printf(dev, "could not setup interrupt handler.\n"); + return (ENXIO); + } + + /* Set up the ethernet interface. */ + sc->ifp = ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 8 15:39:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85E64158A977 for ; Wed, 8 May 2019 15:39:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 006B480ACC for ; Wed, 8 May 2019 15:39:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x832.google.com with SMTP id y42so4246991qtk.6 for ; Wed, 08 May 2019 08:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+5zbKeg4Emwcw7mMAM9phxj5CHmlKP+OUTJvEXvLaPQ=; b=gh0quBRC2aYKLR6hRChf8SYi9woUzbqN56INHQm9Ka4LKskv9ZraWOy7BJZgwe2F8X d3J1ccBhKYD00KfoUtEfNGaimJmuknMgGGzinOFnlx2ouknkGB+2/E5vXbA1yXbYpLlx JzZJbDroh3gJpKn1Np4a0DPE94+IgEwGjkExDaF65p29KDJwGUg4QY6lSoahwGOB07tx P+FqdGRGZxALeoi6FHpR752DerTquWsQLGbh6cZWEdvRUykBQlOBaizcmV1VQyhB+ppx lWZ5JFNmTTWg6mN19zvGvru69y6AYJxYk/GFjw2D0byFFQN7LD54JnRb7VVdR08q7Mzt g4Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+5zbKeg4Emwcw7mMAM9phxj5CHmlKP+OUTJvEXvLaPQ=; b=RWT9R+SCYTc7xhh9yu09qvowB8HLzKPCOM+lQmJoM0RF/ig8byx2B5NeCXsU1tj/dK PLS9hleNj5PepkDTYDvC6iq7cBOLOVpHTg9Mvcv2SCSfbs+unTrTKR9Cg9FGQKxkbj6Q 2SRrdEg2a67Dndd9KnSny40zIwQGBvlkYOsF+Tn4yTflgd9zcDUzmZvgt8URqbnQMt8P sl6sNeBqdL09T7DH8vdurjM0kK4ac6FtHUK3Upr2QJ+wRriHr8CPl2aKPzBXZL+UbLQ+ g138RyK4D/oYGeLQ9JswB6i4WkIyYCQzD5LVihphZpQ2dDJaRqHDCVNmh5oKeeFz5vuG b4oA== X-Gm-Message-State: APjAAAUIlb2Wv9SZcGvdZlBB97YSwELXHmdQgxHtxdf0hZMPRSJNS7w9 VJuliR+sgDmKLBcaTFlApNDkVmRssJVRbAFUtWAbmg== X-Google-Smtp-Source: APXvYqzowqLLTP76KIxBZaBYyyoB4taHxc5t2R8aQ9KaVyrWr8r77GC/FfxABCPsTY2VDXLxB3vgAbiOTGzNMsWWLCo= X-Received: by 2002:ac8:875:: with SMTP id x50mr13696755qth.345.1557329997216; Wed, 08 May 2019 08:39:57 -0700 (PDT) MIME-Version: 1.0 References: <201905070508.x4758DW5015688@repo.freebsd.org> <201905070531.x475VuIY010069@gndrsh.dnsmgr.net> <57ea4a23-c78e-1871-e06b-baf4f78882fd@FreeBSD.org> In-Reply-To: <57ea4a23-c78e-1871-e06b-baf4f78882fd@FreeBSD.org> From: Warner Losh Date: Wed, 8 May 2019 09:39:46 -0600 Message-ID: Subject: Re: svn commit: r347218 - head/sys/compat/linsysfs To: Renato Botelho Cc: Dmitry Chagin , "Rodney W. Grimes" , svn-src-head , svn-src-all , src-committers X-Rspamd-Queue-Id: 006B480ACC X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=gh0quBRC X-Spamd-Result: default: False [-5.95 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[ALT1.aspmx.l.google.com,aspmx.l.google.com,ALT2.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; IP_SCORE(-2.95)[ip: (-9.23), ipnet: 2607:f8b0::/32(-3.21), asn: 15169(-2.25), country: US(-0.06)]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:39:59 -0000 On Tue, May 7, 2019 at 4:45 AM Renato Botelho wrote: > On 07/05/19 02:45, Dmitry Chagin wrote: > > =D0=B2=D1=82, 7 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 08:32, Rodney W.= Grimes : > > > >>> Author: dchagin > >>> Date: Tue May 7 05:08:13 2019 > >>> New Revision: 347218 > >>> URL: https://svnweb.freebsd.org/changeset/base/347218 > >>> > >>> Log: > >>> Remove wrong copyright line. Discussed with Carlos Neira. > >>> > >>> Reported by: Rodney W. Grimes > >> normally just use a committers username, aka rgrimes or rgrimes@ > >> for these types of things. > >> > >> > > ah, I see only: Rodney W. Grimes > > > > > > > >>> MFC after: 2 weeks > >>> Differential Revision: https://reviews.freebsd.org/D13656 > >> > >> Hang on, now you removed his copyright? > >> I see he said that was ok, but that was not the desired intent here. > >> It would of been fine to have the copyright read: > >> > >> * Copyright (c) 2006 IronPort Systems > >> * All rights reserved. > >> * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com > >> > >> As a heads up to other committers you should never insert your > >> copyright between another copyright and the "All rights reserved." tex= t, > >> if you wish to assert the all rights reserved you should duplicate > >> it like: > >> > >> * Copyright (c) 2006 IronPort Systems > >> * All rights reserved. > >> * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com > >> * All rights reserved. > >> > >> preferably on the line with your copyright as in: > >> * Copyright (c) 2017 Carlos Neira cneirabustos@gmail.com All rights > >> reserved. > >> > >> But if at all possible it would be best if we could not add any > >> more of these, and remove them when possible. > >> > >> > > and that actually I did. thanks > > Rod was saying to remove "All rights reserved" when possible, not the > Copyright line. > No. He's saying 'Add the copyright line after the all rights reserve line so we can start cleaning that mess up.' Don't just remove 'All Rights Reserved from old copyright notices. Warner From owner-svn-src-all@freebsd.org Wed May 8 15:42:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49FF0158ABD2; Wed, 8 May 2019 15:42:41 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA5E880EC4; Wed, 8 May 2019 15:42:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D76787E24; Wed, 8 May 2019 15:42:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FgeIn013115; Wed, 8 May 2019 15:42:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FgdVM013110; Wed, 8 May 2019 15:42:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905081542.x48FgdVM013110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 May 2019 15:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347343 - in head/sys: arm64/conf conf dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf conf dev/usb/controller X-SVN-Commit-Revision: 347343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA5E880EC4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:42:41 -0000 Author: manu Date: Wed May 8 15:42:39 2019 New Revision: 347343 URL: https://svnweb.freebsd.org/changeset/base/347343 Log: Add support for USB 3.0 XHCI via ACPI Ampere eMAG systems have XHCI just described in ACPI, not on PCI. Submitted by: Greg V Reviewed by: andrew MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19986 Added: head/sys/dev/usb/controller/generic_xhci.h (contents, props changed) head/sys/dev/usb/controller/generic_xhci_acpi.c (contents, props changed) head/sys/dev/usb/controller/generic_xhci_fdt.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 head/sys/dev/usb/controller/generic_xhci.c Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed May 8 15:36:57 2019 (r347342) +++ head/sys/arm64/conf/GENERIC Wed May 8 15:42:39 2019 (r347343) @@ -206,7 +206,7 @@ device dwcotg # DWC OTG controller device ohci # OHCI USB interface device ehci # EHCI USB interface (USB 2.0) device ehci_mv # Marvell EHCI USB interface -device xhci # XHCI PCI->USB interface (USB 3.0) +device xhci # XHCI USB interface (USB 3.0) device usb # USB Bus (required) device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed May 8 15:36:57 2019 (r347342) +++ head/sys/conf/files.arm64 Wed May 8 15:42:39 2019 (r347343) @@ -240,7 +240,9 @@ dev/usb/controller/generic_ehci.c optional ehci acpi dev/usb/controller/generic_ohci.c optional ohci fdt dev/usb/controller/generic_usb_if.m optional ohci fdt dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources -dev/usb/controller/generic_xhci.c optional xhci fdt +dev/usb/controller/generic_xhci.c optional xhci +dev/usb/controller/generic_xhci_acpi.c optional xhci acpi +dev/usb/controller/generic_xhci_fdt.c optional xhci fdt dev/vnic/mrml_bridge.c optional vnic fdt dev/vnic/nic_main.c optional vnic pci dev/vnic/nicvf_main.c optional vnic pci pci_iov Modified: head/sys/dev/usb/controller/generic_xhci.c ============================================================================== --- head/sys/dev/usb/controller/generic_xhci.c Wed May 8 15:36:57 2019 (r347342) +++ head/sys/dev/usb/controller/generic_xhci.c Wed May 8 15:42:39 2019 (r347343) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 Semihalf. * Copyright (c) 2015 Stormshield. * All rights reserved. @@ -28,8 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_bus.h" - #include #include #include @@ -48,9 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include #include @@ -64,50 +61,15 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef EXT_RESOURCES -#include -#endif +#include "generic_xhci.h" -#define XHCI_HC_DEVSTR "Marvell Integrated USB 3.0 controller" -#define XHCI_HC_VENDOR "Marvell" - #define IS_DMA_32B 1 -static device_attach_t xhci_attach; -static device_detach_t xhci_detach; - -static struct ofw_compat_data compat_data[] = { - {"marvell,armada-380-xhci", true}, - {"marvell,armada3700-xhci", true}, - {"marvell,armada-8k-xhci", true}, - {"generic-xhci", true}, - {NULL, false} -}; - -static int -xhci_probe(device_t dev) +int +generic_xhci_attach(device_t dev) { - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) - return (ENXIO); - - device_set_desc(dev, XHCI_HC_DEVSTR); - - return (BUS_PROBE_DEFAULT); -} - -static int -xhci_attach(device_t dev) -{ struct xhci_softc *sc = device_get_softc(dev); int err = 0, rid = 0; -#ifdef EXT_RESOURCES - phandle_t node; - phy_t phy; -#endif sc->sc_bus.parent = dev; sc->sc_bus.devices = sc->sc_devices; @@ -117,7 +79,7 @@ xhci_attach(device_t dev) RF_ACTIVE); if (sc->sc_io_res == NULL) { device_printf(dev, "Failed to map memory\n"); - xhci_detach(dev); + generic_xhci_detach(dev); return (ENXIO); } @@ -129,21 +91,14 @@ xhci_attach(device_t dev) RF_SHAREABLE | RF_ACTIVE); if (sc->sc_irq_res == NULL) { device_printf(dev, "Failed to allocate IRQ\n"); - xhci_detach(dev); + generic_xhci_detach(dev); return (ENXIO); } -#ifdef EXT_RESOURCES - node = ofw_bus_get_node(dev); - if (phy_get_by_ofw_property(dev, node, "usb-phy", &phy) == 0) - if (phy_enable(phy) != 0) - device_printf(dev, "Cannot enable phy\n"); -#endif - sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); if (sc->sc_bus.bdev == NULL) { device_printf(dev, "Failed to add USB device\n"); - xhci_detach(dev); + generic_xhci_detach(dev); return (ENXIO); } @@ -157,36 +112,36 @@ xhci_attach(device_t dev) if (err != 0) { device_printf(dev, "Failed to setup error IRQ, %d\n", err); sc->sc_intr_hdl = NULL; - xhci_detach(dev); + generic_xhci_detach(dev); return (err); } err = xhci_init(sc, dev, IS_DMA_32B); if (err != 0) { device_printf(dev, "Failed to init XHCI, with error %d\n", err); - xhci_detach(dev); + generic_xhci_detach(dev); return (ENXIO); } err = xhci_start_controller(sc); if (err != 0) { device_printf(dev, "Failed to start XHCI controller, with error %d\n", err); - xhci_detach(dev); + generic_xhci_detach(dev); return (ENXIO); } err = device_probe_and_attach(sc->sc_bus.bdev); if (err != 0) { device_printf(dev, "Failed to initialize USB, with error %d\n", err); - xhci_detach(dev); + generic_xhci_detach(dev); return (ENXIO); } return (0); } -static int -xhci_detach(device_t dev) +int +generic_xhci_detach(device_t dev) { struct xhci_softc *sc = device_get_softc(dev); int err; @@ -221,9 +176,8 @@ xhci_detach(device_t dev) static device_method_t xhci_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, xhci_probe), - DEVMETHOD(device_attach, xhci_attach), - DEVMETHOD(device_detach, xhci_detach), + DEVMETHOD(device_attach, generic_xhci_attach), + DEVMETHOD(device_detach, generic_xhci_detach), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), DEVMETHOD(device_shutdown, bus_generic_shutdown), @@ -231,13 +185,8 @@ static device_method_t xhci_methods[] = { DEVMETHOD_END }; -static driver_t xhci_driver = { +driver_t generic_xhci_driver = { "xhci", xhci_methods, sizeof(struct xhci_softc), }; - -static devclass_t xhci_devclass; - -DRIVER_MODULE(xhci, simplebus, xhci_driver, xhci_devclass, 0, 0); -MODULE_DEPEND(xhci, usb, 1, 1, 1); Added: head/sys/dev/usb/controller/generic_xhci.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/generic_xhci.h Wed May 8 15:42:39 2019 (r347343) @@ -0,0 +1,44 @@ +/* $FreeBSD$ */ + +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2015 Semihalf. + * Copyright (c) 2015 Stormshield. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#ifndef _GENERIC_XHCI_H_ +#define _GENERIC_XHCI_H_ + +#define XHCI_HC_DEVSTR "Generic USB 3.0 controller" +#define XHCI_HC_VENDOR "Generic" + +extern driver_t generic_xhci_driver; + +device_attach_t generic_xhci_attach; +device_detach_t generic_xhci_detach; + +#endif /* !_GENERIC_XHCI_H_ */ Added: head/sys/dev/usb/controller/generic_xhci_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/generic_xhci_acpi.c Wed May 8 15:42:39 2019 (r347343) @@ -0,0 +1,83 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Greg V + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_acpi.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "generic_xhci.h" + +static int +generic_xhci_acpi_probe(device_t dev) +{ + ACPI_HANDLE h; + + if ((h = acpi_get_handle(dev)) == NULL || + acpi_MatchHid(h, "PNP0D10") == ACPI_MATCHHID_NOMATCH) + return (ENXIO); + + device_set_desc(dev, XHCI_HC_DEVSTR); + + return (BUS_PROBE_DEFAULT); +} + +static device_method_t xhci_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, generic_xhci_acpi_probe), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(xhci, xhci_acpi_driver, xhci_acpi_methods, + sizeof(struct xhci_softc), generic_xhci_driver); + +static devclass_t xhci_acpi_devclass; + +DRIVER_MODULE(xhci, acpi, xhci_acpi_driver, xhci_acpi_devclass, 0, 0); +MODULE_DEPEND(xhci, usb, 1, 1, 1); Added: head/sys/dev/usb/controller/generic_xhci_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/generic_xhci_fdt.c Wed May 8 15:42:39 2019 (r347343) @@ -0,0 +1,139 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2015 Semihalf. + * Copyright (c) 2015 Stormshield. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#ifdef EXT_RESOURCES +#include +#endif + +#include "generic_xhci.h" + +static struct ofw_compat_data compat_data[] = { + {"marvell,armada-380-xhci", true}, + {"marvell,armada3700-xhci", true}, + {"marvell,armada-8k-xhci", true}, + {"generic-xhci", true}, + {NULL, false} +}; + +static int +generic_xhci_fdt_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, XHCI_HC_DEVSTR); + + return (BUS_PROBE_DEFAULT); +} + +static int +generic_xhci_fdt_attach(device_t dev) +{ +#ifdef EXT_RESOURCES + phandle_t node; + phy_t phy; + + node = ofw_bus_get_node(dev); + if (phy_get_by_ofw_property(dev, node, "usb-phy", &phy) == 0) + if (phy_enable(phy) != 0) + device_printf(dev, "Cannot enable phy\n"); +#endif + + return (generic_xhci_attach(dev)); +} + +static int +generic_xhci_fdt_detach(device_t dev) +{ +#ifdef EXT_RESOURCES + phandle_t node; + phy_t phy; +#endif + int err; + + err = generic_xhci_detach(dev); + if (err != 0) + return (err); + +#ifdef EXT_RESOURCES + node = ofw_bus_get_node(dev); + if (phy_get_by_ofw_property(dev, node, "usb-phy", &phy) == 0) + phy_release(phy); +#endif + + return (0); +} + + +static device_method_t xhci_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, generic_xhci_fdt_probe), + DEVMETHOD(device_attach, generic_xhci_fdt_attach), + DEVMETHOD(device_detach, generic_xhci_fdt_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(xhci, xhci_fdt_driver, xhci_fdt_methods, + sizeof(struct xhci_softc), generic_xhci_driver); + +static devclass_t xhci_fdt_devclass; + +DRIVER_MODULE(xhci, simplebus, xhci_fdt_driver, xhci_fdt_devclass, 0, 0); +MODULE_DEPEND(xhci, usb, 1, 1, 1); From owner-svn-src-all@freebsd.org Wed May 8 15:43:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12350158AC2C; Wed, 8 May 2019 15:43:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 889988101D; Wed, 8 May 2019 15:43:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 700F37E31; Wed, 8 May 2019 15:43:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FhI8P013189; Wed, 8 May 2019 15:43:18 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FhIQ3013188; Wed, 8 May 2019 15:43:18 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905081543.x48FhIQ3013188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 8 May 2019 15:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347344 - head/sys/dev/xilinx X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/xilinx X-SVN-Commit-Revision: 347344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 889988101D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:43:19 -0000 Author: br Date: Wed May 8 15:43:17 2019 New Revision: 347344 URL: https://svnweb.freebsd.org/changeset/base/347344 Log: Add driver for the Xilinx AXI Direct Memory Access (AXI DMA) controller found in the U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores. Sponsored by: DARPA, AFRL Added: head/sys/dev/xilinx/axidma.c (contents, props changed) head/sys/dev/xilinx/axidma.h (contents, props changed) Added: head/sys/dev/xilinx/axidma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xilinx/axidma.c Wed May 8 15:43:17 2019 (r347344) @@ -0,0 +1,648 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Xilinx AXI DMA controller driver. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +#include +#include + +#include "xdma_if.h" + +#define AXIDMA_DEBUG +#undef AXIDMA_DEBUG + +#ifdef AXIDMA_DEBUG +#define dprintf(fmt, ...) printf(fmt, ##__VA_ARGS__) +#else +#define dprintf(fmt, ...) +#endif + +#define AXIDMA_NCHANNELS 2 +#define AXIDMA_DESCS_NUM 512 +#define AXIDMA_TX_CHAN 0 +#define AXIDMA_RX_CHAN 1 + +extern struct bus_space memmap_bus; + +struct axidma_fdt_data { + int id; +}; + +struct axidma_channel { + struct axidma_softc *sc; + xdma_channel_t *xchan; + bool used; + int idx_head; + int idx_tail; + + struct axidma_desc **descs; + vm_paddr_t *descs_phys; + uint32_t descs_num; + + vm_size_t mem_size; + vm_offset_t mem_paddr; + vm_offset_t mem_vaddr; + + uint32_t descs_used_count; +}; + +struct axidma_softc { + device_t dev; + struct resource *res[3]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + void *ih[2]; + struct axidma_desc desc; + struct axidma_channel channels[AXIDMA_NCHANNELS]; +}; + +static struct resource_spec axidma_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { -1, 0 } +}; + +#define HWTYPE_NONE 0 +#define HWTYPE_STD 1 + +static struct ofw_compat_data compat_data[] = { + { "xlnx,eth-dma", HWTYPE_STD }, + { NULL, HWTYPE_NONE }, +}; + +static int axidma_probe(device_t dev); +static int axidma_attach(device_t dev); +static int axidma_detach(device_t dev); + +static inline uint32_t +axidma_next_desc(struct axidma_channel *chan, uint32_t curidx) +{ + + return ((curidx + 1) % chan->descs_num); +} + +static void +axidma_intr(struct axidma_softc *sc, + struct axidma_channel *chan) +{ + xdma_transfer_status_t status; + xdma_transfer_status_t st; + struct axidma_fdt_data *data; + xdma_controller_t *xdma; + struct axidma_desc *desc; + struct xdma_channel *xchan; + uint32_t tot_copied; + int pending; + int errors; + + xchan = chan->xchan; + xdma = xchan->xdma; + data = xdma->data; + + pending = READ4(sc, AXI_DMASR(data->id)); + WRITE4(sc, AXI_DMASR(data->id), pending); + + errors = (pending & (DMASR_DMAINTERR | DMASR_DMASLVERR + | DMASR_DMADECOREERR | DMASR_SGINTERR + | DMASR_SGSLVERR | DMASR_SGDECERR)); + + dprintf("%s: AXI_DMASR %x\n", __func__, + READ4(sc, AXI_DMASR(data->id))); + dprintf("%s: AXI_CURDESC %x\n", __func__, + READ4(sc, AXI_CURDESC(data->id))); + dprintf("%s: AXI_TAILDESC %x\n", __func__, + READ4(sc, AXI_TAILDESC(data->id))); + + tot_copied = 0; + + while (chan->idx_tail != chan->idx_head) { + desc = chan->descs[chan->idx_tail]; + if ((desc->status & BD_STATUS_CMPLT) == 0) + break; + + st.error = errors; + st.transferred = desc->status & BD_CONTROL_LEN_M; + tot_copied += st.transferred; + xchan_seg_done(xchan, &st); + + chan->idx_tail = axidma_next_desc(chan, chan->idx_tail); + atomic_subtract_int(&chan->descs_used_count, 1); + } + + /* Finish operation */ + status.error = errors; + status.transferred = tot_copied; + xdma_callback(chan->xchan, &status); +} + +static void +axidma_intr_rx(void *arg) +{ + struct axidma_softc *sc; + struct axidma_channel *chan; + + dprintf("%s\n", __func__); + + sc = arg; + chan = &sc->channels[AXIDMA_RX_CHAN]; + + axidma_intr(sc, chan); +} + +static void +axidma_intr_tx(void *arg) +{ + struct axidma_softc *sc; + struct axidma_channel *chan; + + dprintf("%s\n", __func__); + + sc = arg; + chan = &sc->channels[AXIDMA_TX_CHAN]; + + axidma_intr(sc, chan); +} + +static int +axidma_reset(struct axidma_softc *sc, int chan_id) +{ + int timeout; + + WRITE4(sc, AXI_DMACR(chan_id), DMACR_RESET); + + timeout = 100; + do { + if ((READ4(sc, AXI_DMACR(chan_id)) & DMACR_RESET) == 0) + break; + } while (timeout--); + + dprintf("timeout %d\n", timeout); + + if (timeout == 0) + return (-1); + + dprintf("%s: read control after reset: %x\n", + __func__, READ4(sc, AXI_DMACR(chan_id))); + + return (0); +} + +static int +axidma_probe(device_t dev) +{ + int hwtype; + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (hwtype == HWTYPE_NONE) + return (ENXIO); + + device_set_desc(dev, "Xilinx AXI DMA"); + + return (BUS_PROBE_DEFAULT); +} + +static int +axidma_attach(device_t dev) +{ + struct axidma_softc *sc; + phandle_t xref, node; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, axidma_spec, sc->res)) { + device_printf(dev, "could not allocate resources.\n"); + return (ENXIO); + } + + /* CSR memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[1], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, axidma_intr_tx, sc, &sc->ih[0]); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[2], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, axidma_intr_rx, sc, &sc->ih[1]); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + node = ofw_bus_get_node(dev); + xref = OF_xref_from_node(node); + OF_device_register_xref(xref, dev); + + return (0); +} + +static int +axidma_detach(device_t dev) +{ + struct axidma_softc *sc; + + sc = device_get_softc(dev); + + bus_teardown_intr(dev, sc->res[1], sc->ih[0]); + bus_teardown_intr(dev, sc->res[2], sc->ih[1]); + bus_release_resources(dev, axidma_spec, sc->res); + + return (0); +} + +static int +axidma_desc_free(struct axidma_softc *sc, struct axidma_channel *chan) +{ + struct xdma_channel *xchan; + int nsegments; + + nsegments = chan->descs_num; + xchan = chan->xchan; + + free(chan->descs, M_DEVBUF); + free(chan->descs_phys, M_DEVBUF); + + pmap_kremove_device(chan->mem_vaddr, chan->mem_size); + kva_free(chan->mem_vaddr, chan->mem_size); + vmem_free(xchan->vmem, chan->mem_paddr, chan->mem_size); + + return (0); +} + +static int +axidma_desc_alloc(struct axidma_softc *sc, struct xdma_channel *xchan, + uint32_t desc_size) +{ + struct axidma_channel *chan; + int nsegments; + int i; + + chan = (struct axidma_channel *)xchan->chan; + nsegments = chan->descs_num; + + chan->descs = malloc(nsegments * sizeof(struct axidma_desc *), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (chan->descs == NULL) { + device_printf(sc->dev, + "%s: Can't allocate memory.\n", __func__); + return (-1); + } + + chan->descs_phys = malloc(nsegments * sizeof(bus_dma_segment_t), + M_DEVBUF, M_NOWAIT | M_ZERO); + chan->mem_size = desc_size * nsegments; + if (vmem_alloc(xchan->vmem, chan->mem_size, M_FIRSTFIT | M_NOWAIT, + &chan->mem_paddr)) { + device_printf(sc->dev, "Failed to allocate memory.\n"); + return (-1); + } + chan->mem_vaddr = kva_alloc(chan->mem_size); + pmap_kenter_device(chan->mem_vaddr, chan->mem_size, chan->mem_paddr); + + device_printf(sc->dev, "Allocated chunk %lx %d\n", + chan->mem_paddr, chan->mem_size); + + for (i = 0; i < nsegments; i++) { + chan->descs[i] = (struct axidma_desc *) + ((uint64_t)chan->mem_vaddr + desc_size * i); + chan->descs_phys[i] = chan->mem_paddr + desc_size * i; + } + + return (0); +} + +static int +axidma_channel_alloc(device_t dev, struct xdma_channel *xchan) +{ + xdma_controller_t *xdma; + struct axidma_fdt_data *data; + struct axidma_channel *chan; + struct axidma_softc *sc; + + sc = device_get_softc(dev); + + if (xchan->caps & XCHAN_CAP_BUSDMA) { + device_printf(sc->dev, + "Error: busdma operation is not implemented."); + return (-1); + } + + xdma = xchan->xdma; + data = xdma->data; + + chan = &sc->channels[data->id]; + if (chan->used == false) { + if (axidma_reset(sc, data->id) != 0) + return (-1); + chan->xchan = xchan; + xchan->chan = (void *)chan; + chan->sc = sc; + chan->used = true; + chan->idx_head = 0; + chan->idx_tail = 0; + chan->descs_used_count = 0; + chan->descs_num = AXIDMA_DESCS_NUM; + + return (0); + } + + return (-1); +} + +static int +axidma_channel_free(device_t dev, struct xdma_channel *xchan) +{ + struct axidma_channel *chan; + struct axidma_softc *sc; + + sc = device_get_softc(dev); + + chan = (struct axidma_channel *)xchan->chan; + + axidma_desc_free(sc, chan); + + chan->used = false; + + return (0); +} + +static int +axidma_channel_capacity(device_t dev, xdma_channel_t *xchan, + uint32_t *capacity) +{ + struct axidma_channel *chan; + uint32_t c; + + chan = (struct axidma_channel *)xchan->chan; + + /* At least one descriptor must be left empty. */ + c = (chan->descs_num - chan->descs_used_count - 1); + + *capacity = c; + + return (0); +} + +static int +axidma_channel_submit_sg(device_t dev, struct xdma_channel *xchan, + struct xdma_sglist *sg, uint32_t sg_n) +{ + xdma_controller_t *xdma; + struct axidma_fdt_data *data; + struct axidma_channel *chan; + struct axidma_desc *desc; + struct axidma_softc *sc; + uint32_t src_addr; + uint32_t dst_addr; + uint32_t addr; + uint32_t len; + uint32_t tmp; + int i; + int tail; + + dprintf("%s: sg_n %d\n", __func__, sg_n); + + sc = device_get_softc(dev); + + chan = (struct axidma_channel *)xchan->chan; + xdma = xchan->xdma; + data = xdma->data; + + if (sg_n == 0) + return (0); + + tail = chan->idx_head; + + tmp = 0; + + for (i = 0; i < sg_n; i++) { + src_addr = (uint32_t)sg[i].src_addr; + dst_addr = (uint32_t)sg[i].dst_addr; + len = (uint32_t)sg[i].len; + + dprintf("%s(%d): src %x dst %x len %d\n", __func__, + data->id, src_addr, dst_addr, len); + + desc = chan->descs[chan->idx_head]; + if (sg[i].direction == XDMA_MEM_TO_DEV) + desc->phys = src_addr; + else + desc->phys = dst_addr; + desc->status = 0; + desc->control = len; + if (sg[i].first == 1) + desc->control |= BD_CONTROL_TXSOF; + if (sg[i].last == 1) + desc->control |= BD_CONTROL_TXEOF; + + tmp = chan->idx_head; + + atomic_add_int(&chan->descs_used_count, 1); + chan->idx_head = axidma_next_desc(chan, chan->idx_head); + } + + dprintf("%s(%d): _curdesc %x\n", __func__, data->id, + READ8(sc, AXI_CURDESC(data->id))); + dprintf("%s(%d): _curdesc %x\n", __func__, data->id, + READ8(sc, AXI_CURDESC(data->id))); + dprintf("%s(%d): status %x\n", __func__, data->id, + READ4(sc, AXI_DMASR(data->id))); + + addr = chan->descs_phys[tmp]; + WRITE8(sc, AXI_TAILDESC(data->id), addr); + + return (0); +} + +static int +axidma_channel_prep_sg(device_t dev, struct xdma_channel *xchan) +{ + xdma_controller_t *xdma; + struct axidma_fdt_data *data; + struct axidma_channel *chan; + struct axidma_desc *desc; + struct axidma_softc *sc; + uint32_t addr; + uint32_t reg; + int ret; + int i; + + sc = device_get_softc(dev); + + chan = (struct axidma_channel *)xchan->chan; + xdma = xchan->xdma; + data = xdma->data; + + dprintf("%s(%d)\n", __func__, data->id); + + ret = axidma_desc_alloc(sc, xchan, sizeof(struct axidma_desc)); + if (ret != 0) { + device_printf(sc->dev, + "%s: Can't allocate descriptors.\n", __func__); + return (-1); + } + + for (i = 0; i < chan->descs_num; i++) { + desc = chan->descs[i]; + bzero(desc, sizeof(struct axidma_desc)); + + if (i == (chan->descs_num - 1)) + desc->next = chan->descs_phys[0]; + else + desc->next = chan->descs_phys[i + 1]; + desc->status = 0; + desc->control = 0; + + dprintf("%s(%d): desc %d vaddr %lx next paddr %x\n", __func__, + data->id, i, (uint64_t)desc, le32toh(desc->next)); + } + + addr = chan->descs_phys[0]; + WRITE8(sc, AXI_CURDESC(data->id), addr); + + reg = READ4(sc, AXI_DMACR(data->id)); + reg |= DMACR_IOC_IRQEN | DMACR_DLY_IRQEN | DMACR_ERR_IRQEN; + WRITE4(sc, AXI_DMACR(data->id), reg); + reg |= DMACR_RS; + WRITE4(sc, AXI_DMACR(data->id), reg); + + return (0); +} + +static int +axidma_channel_control(device_t dev, xdma_channel_t *xchan, int cmd) +{ + struct axidma_channel *chan; + struct axidma_softc *sc; + + sc = device_get_softc(dev); + + chan = (struct axidma_channel *)xchan->chan; + + switch (cmd) { + case XDMA_CMD_BEGIN: + case XDMA_CMD_TERMINATE: + case XDMA_CMD_PAUSE: + /* TODO: implement me */ + return (-1); + } + + return (0); +} + +#ifdef FDT +static int +axidma_ofw_md_data(device_t dev, pcell_t *cells, int ncells, void **ptr) +{ + struct axidma_fdt_data *data; + + if (ncells != 1) + return (-1); + + data = malloc(sizeof(struct axidma_fdt_data), + M_DEVBUF, (M_WAITOK | M_ZERO)); + data->id = cells[0]; + + *ptr = data; + + return (0); +} +#endif + +static device_method_t axidma_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, axidma_probe), + DEVMETHOD(device_attach, axidma_attach), + DEVMETHOD(device_detach, axidma_detach), + + /* xDMA Interface */ + DEVMETHOD(xdma_channel_alloc, axidma_channel_alloc), + DEVMETHOD(xdma_channel_free, axidma_channel_free), + DEVMETHOD(xdma_channel_control, axidma_channel_control), + + /* xDMA SG Interface */ + DEVMETHOD(xdma_channel_capacity, axidma_channel_capacity), + DEVMETHOD(xdma_channel_prep_sg, axidma_channel_prep_sg), + DEVMETHOD(xdma_channel_submit_sg, axidma_channel_submit_sg), + +#ifdef FDT + DEVMETHOD(xdma_ofw_md_data, axidma_ofw_md_data), +#endif + + DEVMETHOD_END +}; + +static driver_t axidma_driver = { + "axidma", + axidma_methods, + sizeof(struct axidma_softc), +}; + +static devclass_t axidma_devclass; + +EARLY_DRIVER_MODULE(axidma, simplebus, axidma_driver, axidma_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); Added: head/sys/dev/xilinx/axidma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xilinx/axidma.h Wed May 8 15:43:17 2019 (r347344) @@ -0,0 +1,96 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Ruslan Bukin + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_XILINX_AXIDMA_H_ +#define _DEV_XILINX_AXIDMA_H_ + +#define AXI_DMACR(n) (0x00 + 0x30 * (n)) /* DMA Control register */ +#define DMACR_RS (1 << 0) /* Run / Stop. */ +#define DMACR_RESET (1 << 2) /* Soft reset the AXI DMA core. */ +#define DMACR_IOC_IRQEN (1 << 12) /* Interrupt on Complete (IOC) Interrupt Enable. */ +#define DMACR_DLY_IRQEN (1 << 13) /* Interrupt on Delay Timer Interrupt Enable. */ +#define DMACR_ERR_IRQEN (1 << 14) /* Interrupt on Error Interrupt Enable. */ +#define AXI_DMASR(n) (0x04 + 0x30 * (n)) /* DMA Status register */ +#define DMASR_HALTED (1 << 0) +#define DMASR_IDLE (1 << 1) +#define DMASR_SGINCLD (1 << 3) /* Scatter Gather Enabled */ +#define DMASR_DMAINTERR (1 << 4) /* DMA Internal Error. */ +#define DMASR_DMASLVERR (1 << 5) /* DMA Slave Error. */ +#define DMASR_DMADECOREERR (1 << 6) /* Decode Error. */ +#define DMASR_SGINTERR (1 << 8) /* Scatter Gather Internal Error. */ +#define DMASR_SGSLVERR (1 << 9) /* Scatter Gather Slave Error. */ +#define DMASR_SGDECERR (1 << 10) /* Scatter Gather Decode Error. */ +#define DMASR_IOC_IRQ (1 << 12) /* Interrupt on Complete. */ +#define DMASR_DLY_IRQ (1 << 13) /* Interrupt on Delay. */ +#define DMASR_ERR_IRQ (1 << 14) /* Interrupt on Error. */ +#define AXI_CURDESC(n) (0x08 + 0x30 * (n)) /* Current Descriptor Pointer. Lower 32 bits of the address. */ +#define AXI_CURDESC_MSB(n) (0x0C + 0x30 * (n)) /* Current Descriptor Pointer. Upper 32 bits of address. */ +#define AXI_TAILDESC(n) (0x10 + 0x30 * (n)) /* Tail Descriptor Pointer. Lower 32 bits. */ +#define AXI_TAILDESC_MSB(n) (0x14 + 0x30 * (n)) /* Tail Descriptor Pointer. Upper 32 bits of address. */ +#define AXI_SG_CTL 0x2C /* Scatter/Gather User and Cache */ + +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) +#define READ8(_sc, _reg) \ + bus_space_read_8(_sc->bst, _sc->bsh, _reg) +#define WRITE8(_sc, _reg, _val) \ + bus_space_write_8(_sc->bst, _sc->bsh, _reg, _val) + +struct axidma_desc { + uint32_t next; + uint32_t reserved1; + uint32_t phys; + uint32_t reserved2; + uint32_t reserved3; + uint32_t reserved4; + uint32_t control; +#define BD_CONTROL_TXSOF (1 << 27) /* Start of Frame. */ +#define BD_CONTROL_TXEOF (1 << 26) /* End of Frame. */ +#define BD_CONTROL_LEN_S 0 /* Buffer Length. */ +#define BD_CONTROL_LEN_M (0x3ffffff << BD_CONTROL_LEN_S) + uint32_t status; +#define BD_STATUS_CMPLT (1 << 31) +#define BD_STATUS_TRANSFERRED_S 0 +#define BD_STATUS_TRANSFERRED_M (0x7fffff << BD_STATUS_TRANSFERRED_S) + uint32_t app0; + uint32_t app1; + uint32_t app2; + uint32_t app3; + uint32_t app4; + uint32_t reserved[3]; +}; + +#endif /* !_DEV_XILINX_AXIDMA_H_ */ From owner-svn-src-all@freebsd.org Wed May 8 15:43:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65AE8158AC5B; Wed, 8 May 2019 15:43:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04FD681061; Wed, 8 May 2019 15:43:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5F6C7E32; Wed, 8 May 2019 15:43:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FhMNc013237; Wed, 8 May 2019 15:43:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FhM0D013236; Wed, 8 May 2019 15:43:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905081543.x48FhM0D013236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 May 2019 15:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347345 - stable/12/sys/x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/x86/x86 X-SVN-Commit-Revision: 347345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 04FD681061 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:43:24 -0000 Author: kib Date: Wed May 8 15:43:22 2019 New Revision: 347345 URL: https://svnweb.freebsd.org/changeset/base/347345 Log: MFC r346851: Remove witness warning, same as r346351 for busdma_dmar. bounce_bus_dmamap_create() does not sleep either. Modified: stable/12/sys/x86/x86/busdma_bounce.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/x86/busdma_bounce.c ============================================================================== --- stable/12/sys/x86/x86/busdma_bounce.c Wed May 8 15:43:17 2019 (r347344) +++ stable/12/sys/x86/x86/busdma_bounce.c Wed May 8 15:43:22 2019 (r347345) @@ -286,8 +286,6 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags struct bounce_zone *bz; int error, maxpages, pages; - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); - error = 0; if (dmat->segments == NULL) { From owner-svn-src-all@freebsd.org Wed May 8 15:44:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 759BA158AD3C; Wed, 8 May 2019 15:44:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1ABB4812A3; Wed, 8 May 2019 15:44:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9ACC7E39; Wed, 8 May 2019 15:44:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Firip013378; Wed, 8 May 2019 15:44:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Firc8013377; Wed, 8 May 2019 15:44:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905081544.x48Firc8013377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 May 2019 15:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347346 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 347346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1ABB4812A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:44:54 -0000 Author: kib Date: Wed May 8 15:44:53 2019 New Revision: 347346 URL: https://svnweb.freebsd.org/changeset/base/347346 Log: MFC r346990: Fix another race between vm_map_protect() and vm_map_wire(). Modified: stable/12/sys/vm/vm_map.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Wed May 8 15:43:22 2019 (r347345) +++ stable/12/sys/vm/vm_map.c Wed May 8 15:44:53 2019 (r347346) @@ -2347,7 +2347,7 @@ int vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end, vm_prot_t new_prot, boolean_t set_max) { - vm_map_entry_t current, entry; + vm_map_entry_t current, entry, in_tran; vm_object_t obj; struct ucred *cred; vm_prot_t old_prot; @@ -2355,6 +2355,8 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off if (start == end) return (KERN_SUCCESS); +again: + in_tran = NULL; vm_map_lock(map); /* @@ -2387,6 +2389,22 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off vm_map_unlock(map); return (KERN_PROTECTION_FAILURE); } + if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0) + in_tran = entry; + } + + /* + * Postpone the operation until all in transition map entries + * are stabilized. In-transition entry might already have its + * pages wired and wired_count incremented, but + * MAP_ENTRY_USER_WIRED flag not yet set, and visible to other + * threads because the map lock is dropped. In this case we + * would miss our call to vm_fault_copy_entry(). + */ + if (in_tran != NULL) { + in_tran->eflags |= MAP_ENTRY_NEEDS_WAKEUP; + vm_map_unlock_and_wait(map, 0); + goto again; } /* From owner-svn-src-all@freebsd.org Wed May 8 15:49:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1AB7158AE37; Wed, 8 May 2019 15:49:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AD1C81454; Wed, 8 May 2019 15:49:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BA167E3C; Wed, 8 May 2019 15:49:12 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FnC1h013655; Wed, 8 May 2019 15:49:12 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FmuwL013633; Wed, 8 May 2019 15:48:56 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905081548.x48FmuwL013633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 8 May 2019 15:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347347 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic X-SVN-Commit-Revision: 347347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4AD1C81454 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:49:13 -0000 Author: cy Date: Wed May 8 15:48:55 2019 New Revision: 347347 URL: https://svnweb.freebsd.org/changeset/base/347347 Log: MFC r347139: MFV r347136: Update sqlite3-3.27.2 (3270200) --> sqlite3-3.28.0 (3280000) Security: CVE-2019-9937, CVE-2019-9936 Modified: stable/11/contrib/sqlite3/Makefile.msc stable/11/contrib/sqlite3/configure stable/11/contrib/sqlite3/configure.ac stable/11/contrib/sqlite3/shell.c stable/11/contrib/sqlite3/sqlite3.c stable/11/contrib/sqlite3/sqlite3.h stable/11/contrib/sqlite3/sqlite3ext.h stable/11/contrib/sqlite3/tea/configure stable/11/contrib/sqlite3/tea/configure.ac stable/11/contrib/sqlite3/tea/generic/tclsqlite3.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/sqlite3/Makefile.msc stable/12/contrib/sqlite3/configure stable/12/contrib/sqlite3/configure.ac stable/12/contrib/sqlite3/shell.c stable/12/contrib/sqlite3/sqlite3.c stable/12/contrib/sqlite3/sqlite3.h stable/12/contrib/sqlite3/sqlite3ext.h stable/12/contrib/sqlite3/tea/configure stable/12/contrib/sqlite3/tea/configure.ac stable/12/contrib/sqlite3/tea/generic/tclsqlite3.c Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/sqlite3/Makefile.msc ============================================================================== --- stable/11/contrib/sqlite3/Makefile.msc Wed May 8 15:44:53 2019 (r347346) +++ stable/11/contrib/sqlite3/Makefile.msc Wed May 8 15:48:55 2019 (r347347) @@ -433,9 +433,9 @@ UCRTLIBPATH = $(UCRTLIBPATH:\\=\) # will run on the platform that is doing the build. # !IF $(USE_FULLWARN)!=0 -BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS) +BCC = $(NCC) -nologo -W4 -Fd$*.pdb $(CCOPTS) $(BCCOPTS) !ELSE -BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS) +BCC = $(NCC) -nologo -W3 -Fd$*.pdb $(CCOPTS) $(BCCOPTS) !ENDIF # Check if assembly code listings should be generated for the source @@ -808,7 +808,7 @@ BCC = $(BCC) -Zi # Command line prefixes for compiling code, compiling resources, # linking, etc. # -LTCOMPILE = $(TCC) -Fo$@ +LTCOMPILE = $(TCC) -Fo$@ -Fd$*.pdb LTRCOMPILE = $(RCC) -r LTLIB = lib.exe LTLINK = $(TCC) -Fe$@ @@ -826,6 +826,11 @@ LTLIBS = $(LTLIBS) rpcrt4.lib !IFDEF PLATFORM LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM) LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM) +!ELSEIF "$(VISUALSTUDIOVERSION)"=="12.0" || \ + "$(VISUALSTUDIOVERSION)"=="14.0" || \ + "$(VISUALSTUDIOVERSION)"=="15.0" +LTLINKOPTS = /NOLOGO /MACHINE:x86 +LTLIBOPTS = /NOLOGO /MACHINE:x86 !ELSE LTLINKOPTS = /NOLOGO LTLIBOPTS = /NOLOGO Modified: stable/11/contrib/sqlite3/configure ============================================================================== --- stable/11/contrib/sqlite3/configure Wed May 8 15:44:53 2019 (r347346) +++ stable/11/contrib/sqlite3/configure Wed May 8 15:48:55 2019 (r347347) @@ -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.2. +# Generated by GNU Autoconf 2.69 for sqlite 3.28.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.27.2' -PACKAGE_STRING='sqlite 3.27.2' +PACKAGE_VERSION='3.28.0' +PACKAGE_STRING='sqlite 3.28.0' 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.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.28.0 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.2:";; + short | recursive ) echo "Configuration of sqlite 3.28.0:";; 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.2 +sqlite configure 3.28.0 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.2, which was +It was created by sqlite $as_me 3.28.0, 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.2' + VERSION='3.28.0' 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.2, which was +This file was extended by sqlite $as_me 3.28.0, 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.2 +sqlite config.status 3.28.0 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 8 15:44:53 2019 (r347346) +++ stable/11/contrib/sqlite3/configure.ac Wed May 8 15:48:55 2019 (r347347) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.27.2, http://www.sqlite.org) +AC_INIT(sqlite, 3.28.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: stable/11/contrib/sqlite3/shell.c ============================================================================== --- stable/11/contrib/sqlite3/shell.c Wed May 8 15:44:53 2019 (r347346) +++ stable/11/contrib/sqlite3/shell.c Wed May 8 15:48:55 2019 (r347347) @@ -2177,13 +2177,13 @@ static void readFileContents(sqlite3_context *ctx, con fclose(in); return; } - pBuf = sqlite3_malloc64( nIn ); + pBuf = sqlite3_malloc64( nIn ? nIn : 1 ); if( pBuf==0 ){ sqlite3_result_error_nomem(ctx); fclose(in); return; } - if( 1==fread(pBuf, nIn, 1, in) ){ + if( nIn==(sqlite3_int64)fread(pBuf, 1, (size_t)nIn, in) ){ sqlite3_result_blob64(ctx, pBuf, nIn, sqlite3_free); }else{ sqlite3_result_error_code(ctx, SQLITE_IOERR); @@ -2318,15 +2318,15 @@ static int fileLinkStat( ** Argument zFile is the name of a file that will be created and/or written ** by SQL function writefile(). This function ensures that the directory ** zFile will be written to exists, creating it if required. The permissions -** for any path components created by this function are set to (mode&0777). +** for any path components created by this function are set in accordance +** with the current umask. ** ** If an OOM condition is encountered, SQLITE_NOMEM is returned. Otherwise, ** SQLITE_OK is returned if the directory is successfully created, or ** SQLITE_ERROR otherwise. */ static int makeDirectory( - const char *zFile, - mode_t mode + const char *zFile ){ char *zCopy = sqlite3_mprintf("%s", zFile); int rc = SQLITE_OK; @@ -2347,7 +2347,7 @@ static int makeDirectory( rc2 = fileStat(zCopy, &sStat); if( rc2!=0 ){ - if( mkdir(zCopy, mode & 0777) ) rc = SQLITE_ERROR; + if( mkdir(zCopy, 0777) ) rc = SQLITE_ERROR; }else{ if( !S_ISDIR(sStat.st_mode) ) rc = SQLITE_ERROR; } @@ -2505,7 +2505,7 @@ static void writefileFunc( res = writeFile(context, zFile, argv[1], mode, mtime); if( res==1 && errno==ENOENT ){ - if( makeDirectory(zFile, mode)==SQLITE_OK ){ + if( makeDirectory(zFile)==SQLITE_OK ){ res = writeFile(context, zFile, argv[1], mode, mtime); } } @@ -10430,7 +10430,67 @@ static void restore_debug_trace_modes(void){ #endif } +/* Create the TEMP table used to store parameter bindings */ +static void bind_table_init(ShellState *p){ + int wrSchema = 0; + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); + sqlite3_exec(p->db, + "CREATE TABLE IF NOT EXISTS temp.sqlite_parameters(\n" + " key TEXT PRIMARY KEY,\n" + " value ANY\n" + ") WITHOUT ROWID;", + 0, 0, 0); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); +} + /* +** Bind parameters on a prepared statement. +** +** Parameter bindings are taken from a TEMP table of the form: +** +** CREATE TEMP TABLE sqlite_parameters(key TEXT PRIMARY KEY, value) +** WITHOUT ROWID; +** +** No bindings occur if this table does not exist. The special character '$' +** is included in the table name to help prevent collisions with actual tables. +** The table must be in the TEMP schema. +*/ +static void bind_prepared_stmt(ShellState *pArg, sqlite3_stmt *pStmt){ + int nVar; + int i; + int rc; + sqlite3_stmt *pQ = 0; + + nVar = sqlite3_bind_parameter_count(pStmt); + if( nVar==0 ) return; /* Nothing to do */ + if( sqlite3_table_column_metadata(pArg->db, "TEMP", "sqlite_parameters", + "key", 0, 0, 0, 0, 0)!=SQLITE_OK ){ + return; /* Parameter table does not exist */ + } + rc = sqlite3_prepare_v2(pArg->db, + "SELECT value FROM temp.sqlite_parameters" + " WHERE key=?1", -1, &pQ, 0); + if( rc || pQ==0 ) return; + for(i=1; i<=nVar; i++){ + char zNum[30]; + const char *zVar = sqlite3_bind_parameter_name(pStmt, i); + if( zVar==0 ){ + sqlite3_snprintf(sizeof(zNum),zNum,"?%d",i); + zVar = zNum; + } + sqlite3_bind_text(pQ, 1, zVar, -1, SQLITE_STATIC); + if( sqlite3_step(pQ)==SQLITE_ROW ){ + sqlite3_bind_value(pStmt, i, sqlite3_column_value(pQ, 0)); + }else{ + sqlite3_bind_null(pStmt, i); + } + sqlite3_reset(pQ); + } + sqlite3_finalize(pQ); +} + +/* ** Run a prepared statement */ static void exec_prepared_stmt( @@ -10682,7 +10742,7 @@ static int shell_exec( } /* Show the EXPLAIN QUERY PLAN if .eqp is on */ - if( pArg && pArg->autoEQP && sqlite3_strlike("EXPLAIN%",zStmtSql,0)!=0 ){ + if( pArg && pArg->autoEQP && sqlite3_stmt_isexplain(pStmt)==0 ){ sqlite3_stmt *pExplain; char *zEQP; int triggerEQP = 0; @@ -10731,13 +10791,10 @@ static int shell_exec( if( pArg ){ pArg->cMode = pArg->mode; if( pArg->autoExplain ){ - if( sqlite3_column_count(pStmt)==8 - && sqlite3_strlike("EXPLAIN%", zStmtSql,0)==0 - ){ + if( sqlite3_stmt_isexplain(pStmt)==1 ){ pArg->cMode = MODE_Explain; } - if( sqlite3_column_count(pStmt)==4 - && sqlite3_strlike("EXPLAIN QUERY PLAN%", zStmtSql,0)==0 ){ + if( sqlite3_stmt_isexplain(pStmt)==2 ){ pArg->cMode = MODE_EQP; } } @@ -10749,6 +10806,7 @@ static int shell_exec( } } + bind_prepared_stmt(pArg, pStmt); exec_prepared_stmt(pArg, pStmt); explain_data_delete(pArg); eqp_render(pArg); @@ -11078,7 +11136,8 @@ static const char *(azHelp[]) = { ".archive ... Manage SQL archives", " Each command must have exactly one of the following options:", " -c, --create Create a new archive", - " -u, --update Update or add files to an existing archive", + " -u, --update Add files or update files with changed mtime", + " -i, --insert Like -u but always add even if mtime unchanged", " -t, --list List contents of archive", " -x, --extract Extract files from archive", " Optional arguments:", @@ -11180,6 +11239,13 @@ static const char *(azHelp[]) = { " --zip FILE is a ZIP archive", ".output ?FILE? Send output to FILE or stdout if FILE is omitted", " If FILE begins with '|' then open it as a pipe.", + ".parameter CMD ... Manage SQL parameter bindings", + " clear Erase all bindings", + " init Initialize the TEMP table that holds bindings", + " list List the current parameter bindings", + " set PARAMETER VALUE Given SQL parameter PARAMETER a value of VALUE", + " PARAMETER should start with '$', ':', '@', or '?'", + " unset PARAMETER Remove PARAMETER from the binding table", ".print STRING... Print literal STRING", #ifndef SQLITE_OMIT_PROGRESS_CALLBACK ".progress N Invoke progress handler after every N opcodes", @@ -12392,7 +12458,7 @@ static int shell_dbinfo_command(ShellState *p, int nAr { "schema size:", "SELECT total(length(sql)) FROM %s" }, }; - int i; + int i, rc; unsigned iDataVersion; char *zSchemaTab; char *zDb = nArg>=2 ? azArg[1] : "main"; @@ -12400,8 +12466,19 @@ static int shell_dbinfo_command(ShellState *p, int nAr unsigned char aHdr[100]; open_db(p, 0); if( p->db==0 ) return 1; - sqlite3_prepare_v2(p->db,"SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1", - -1, &pStmt, 0); + rc = sqlite3_prepare_v2(p->db, + "SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1", + -1, &pStmt, 0); + if( rc ){ + if( !sqlite3_compileoption_used("ENABLE_DBPAGE_VTAB") ){ + utf8_printf(stderr, "the \".dbinfo\" command requires the " + "-DSQLITE_ENABLE_DBPAGE_VTAB compile-time options\n"); + }else{ + utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db)); + } + sqlite3_finalize(pStmt); + return 1; + } sqlite3_bind_text(pStmt, 1, zDb, -1, SQLITE_STATIC); if( sqlite3_step(pStmt)==SQLITE_ROW && sqlite3_column_bytes(pStmt,0)>100 @@ -12995,19 +13072,20 @@ static int arErrorMsg(ArCommand *pAr, const char *zFmt ** Values for ArCommand.eCmd. */ #define AR_CMD_CREATE 1 -#define AR_CMD_EXTRACT 2 -#define AR_CMD_LIST 3 -#define AR_CMD_UPDATE 4 -#define AR_CMD_HELP 5 +#define AR_CMD_UPDATE 2 +#define AR_CMD_INSERT 3 +#define AR_CMD_EXTRACT 4 +#define AR_CMD_LIST 5 +#define AR_CMD_HELP 6 /* ** Other (non-command) switches. */ -#define AR_SWITCH_VERBOSE 6 -#define AR_SWITCH_FILE 7 -#define AR_SWITCH_DIRECTORY 8 -#define AR_SWITCH_APPEND 9 -#define AR_SWITCH_DRYRUN 10 +#define AR_SWITCH_VERBOSE 7 +#define AR_SWITCH_FILE 8 +#define AR_SWITCH_DIRECTORY 9 +#define AR_SWITCH_APPEND 10 +#define AR_SWITCH_DRYRUN 11 static int arProcessSwitch(ArCommand *pAr, int eSwitch, const char *zArg){ switch( eSwitch ){ @@ -13015,6 +13093,7 @@ static int arProcessSwitch(ArCommand *pAr, int eSwitch case AR_CMD_EXTRACT: case AR_CMD_LIST: case AR_CMD_UPDATE: + case AR_CMD_INSERT: case AR_CMD_HELP: if( pAr->eCmd ){ return arErrorMsg(pAr, "multiple command options"); @@ -13061,6 +13140,7 @@ static int arParseCommand( } aSwitch[] = { { "create", 'c', AR_CMD_CREATE, 0 }, { "extract", 'x', AR_CMD_EXTRACT, 0 }, + { "insert", 'i', AR_CMD_INSERT, 0 }, { "list", 't', AR_CMD_LIST, 0 }, { "update", 'u', AR_CMD_UPDATE, 0 }, { "help", 'h', AR_CMD_HELP, 0 }, @@ -13396,19 +13476,27 @@ static int arExecSql(ArCommand *pAr, const char *zSql) /* -** Implementation of .ar "create" and "update" commands. +** Implementation of .ar "create", "insert", and "update" commands. ** +** create -> Create a new SQL archive +** insert -> Insert or reinsert all files listed +** update -> Insert files that have changed or that were not +** previously in the archive +** ** Create the "sqlar" table in the database if it does not already exist. ** Then add each file in the azFile[] array to the archive. Directories ** are added recursively. If argument bVerbose is non-zero, a message is ** printed on stdout for each file archived. ** ** The create command is the same as update, except that it drops -** any existing "sqlar" table before beginning. +** any existing "sqlar" table before beginning. The "insert" command +** always overwrites every file named on the command-line, where as +** "update" only overwrites if the size or mtime or mode has changed. */ static int arCreateOrUpdateCommand( ArCommand *pAr, /* Command arguments and options */ - int bUpdate /* true for a --create. false for --update */ + int bUpdate, /* true for a --create. */ + int bOnlyIfChanged /* Only update if file has changed */ ){ const char *zCreate = "CREATE TABLE IF NOT EXISTS sqlar(\n" @@ -13430,22 +13518,24 @@ static int arCreateOrUpdateCommand( " WHEN 'd' THEN 0\n" " ELSE -1 END,\n" " sqlar_compress(data)\n" - " FROM fsdir(%Q,%Q)\n" - " WHERE lsmode(mode) NOT LIKE '?%%';", + " FROM fsdir(%Q,%Q) AS disk\n" + " WHERE lsmode(mode) NOT LIKE '?%%'%s;" + , "REPLACE INTO %s(name,mode,mtime,data)\n" " SELECT\n" " %s,\n" " mode,\n" " mtime,\n" " data\n" - " FROM fsdir(%Q,%Q)\n" - " WHERE lsmode(mode) NOT LIKE '?%%';" + " FROM fsdir(%Q,%Q) AS disk\n" + " WHERE lsmode(mode) NOT LIKE '?%%'%s;" }; int i; /* For iterating through azFile[] */ int rc; /* Return code */ const char *zTab = 0; /* SQL table into which to insert */ char *zSql; char zTemp[50]; + char *zExists = 0; arExecSql(pAr, "PRAGMA page_size=512"); rc = arExecSql(pAr, "SAVEPOINT ar;"); @@ -13476,10 +13566,21 @@ static int arCreateOrUpdateCommand( } rc = arExecSql(pAr, zCreate); } + if( bOnlyIfChanged ){ + zExists = sqlite3_mprintf( + " AND NOT EXISTS(" + "SELECT 1 FROM %s AS mem" + " WHERE mem.name=disk.name" + " AND mem.mtime=disk.mtime" + " AND mem.mode=disk.mode)", zTab); + }else{ + zExists = sqlite3_mprintf(""); + } + if( zExists==0 ) rc = SQLITE_NOMEM; for(i=0; inArg && rc==SQLITE_OK; i++){ char *zSql2 = sqlite3_mprintf(zInsertFmt[pAr->bZip], zTab, pAr->bVerbose ? "shell_putsnl(name)" : "name", - pAr->azArg[i], pAr->zDir); + pAr->azArg[i], pAr->zDir, zExists); rc = arExecSql(pAr, zSql2); sqlite3_free(zSql2); } @@ -13494,6 +13595,7 @@ end_ar_transaction: sqlite3_free(zSql); } } + sqlite3_free(zExists); return rc; } @@ -13532,7 +13634,8 @@ static int arDotCommand( }else if( cmd.zFile ){ int flags; if( cmd.bAppend ) eDbType = SHELL_OPEN_APPENDVFS; - if( cmd.eCmd==AR_CMD_CREATE || cmd.eCmd==AR_CMD_UPDATE ){ + if( cmd.eCmd==AR_CMD_CREATE || cmd.eCmd==AR_CMD_INSERT + || cmd.eCmd==AR_CMD_UPDATE ){ flags = SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE; }else{ flags = SQLITE_OPEN_READONLY; @@ -13569,7 +13672,7 @@ static int arDotCommand( switch( cmd.eCmd ){ case AR_CMD_CREATE: - rc = arCreateOrUpdateCommand(&cmd, 0); + rc = arCreateOrUpdateCommand(&cmd, 0, 0); break; case AR_CMD_EXTRACT: @@ -13584,9 +13687,13 @@ static int arDotCommand( arUsage(pState->out); break; + case AR_CMD_INSERT: + rc = arCreateOrUpdateCommand(&cmd, 1, 0); + break; + default: assert( cmd.eCmd==AR_CMD_UPDATE ); - rc = arCreateOrUpdateCommand(&cmd, 1); + rc = arCreateOrUpdateCommand(&cmd, 1, 1); break; } } @@ -14709,6 +14816,114 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", zFile); } } + }else + + if( c=='p' && n>=3 && strncmp(azArg[0], "parameter", n)==0 ){ + open_db(p,0); + if( nArg<=1 ) goto parameter_syntax_error; + + /* .parameter clear + ** Clear all bind parameters by dropping the TEMP table that holds them. + */ + if( nArg==2 && strcmp(azArg[1],"clear")==0 ){ + int wrSchema = 0; + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); + sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp.sqlite_parameters;", + 0, 0, 0); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); + }else + + /* .parameter list + ** List all bind parameters. + */ + if( nArg==2 && strcmp(azArg[1],"list")==0 ){ + sqlite3_stmt *pStmt = 0; + int rx; + int len = 0; + rx = sqlite3_prepare_v2(p->db, + "SELECT max(length(key)) " + "FROM temp.sqlite_parameters;", -1, &pStmt, 0); + if( rx==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ + len = sqlite3_column_int(pStmt, 0); + if( len>40 ) len = 40; + } + sqlite3_finalize(pStmt); + pStmt = 0; + if( len ){ + rx = sqlite3_prepare_v2(p->db, + "SELECT key, quote(value) " + "FROM temp.sqlite_parameters;", -1, &pStmt, 0); + while( sqlite3_step(pStmt)==SQLITE_ROW ){ + utf8_printf(p->out, "%-*s %s\n", len, sqlite3_column_text(pStmt,0), + sqlite3_column_text(pStmt,1)); + } + sqlite3_finalize(pStmt); + } + }else + + /* .parameter init + ** Make sure the TEMP table used to hold bind parameters exists. + ** Create it if necessary. + */ + if( nArg==2 && strcmp(azArg[1],"init")==0 ){ + bind_table_init(p); + }else + + /* .parameter set NAME VALUE + ** Set or reset a bind parameter. NAME should be the full parameter + ** name exactly as it appears in the query. (ex: $abc, @def). The + ** VALUE can be in either SQL literal notation, or if not it will be + ** understood to be a text string. + */ + if( nArg==4 && strcmp(azArg[1],"set")==0 ){ + int rx; + char *zSql; + sqlite3_stmt *pStmt; + const char *zKey = azArg[2]; + const char *zValue = azArg[3]; + bind_table_init(p); + zSql = sqlite3_mprintf( + "REPLACE INTO temp.sqlite_parameters(key,value)" + "VALUES(%Q,%s);", zKey, zValue); + if( zSql==0 ) shell_out_of_memory(); + pStmt = 0; + rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); + sqlite3_free(zSql); + if( rx!=SQLITE_OK ){ + sqlite3_finalize(pStmt); + pStmt = 0; + zSql = sqlite3_mprintf( + "REPLACE INTO temp.sqlite_parameters(key,value)" + "VALUES(%Q,%Q);", zKey, zValue); + if( zSql==0 ) shell_out_of_memory(); + rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); + sqlite3_free(zSql); + if( rx!=SQLITE_OK ){ + utf8_printf(p->out, "Error: %s\n", sqlite3_errmsg(p->db)); + sqlite3_finalize(pStmt); + pStmt = 0; + rc = 1; + } + } + sqlite3_step(pStmt); + sqlite3_finalize(pStmt); + }else + + /* .parameter unset NAME + ** Remove the NAME binding from the parameter binding table, if it + ** exists. + */ + if( nArg==3 && strcmp(azArg[1],"unset")==0 ){ + char *zSql = sqlite3_mprintf( + "DELETE FROM temp.sqlite_parameters WHERE key=%Q", azArg[2]); + if( zSql==0 ) shell_out_of_memory(); + sqlite3_exec(p->db, zSql, 0, 0, 0); + sqlite3_free(zSql); + }else + /* If no command name matches, show a syntax error */ + parameter_syntax_error: + showHelp(p->out, "parameter"); }else if( c=='p' && n>=3 && strncmp(azArg[0], "print", n)==0 ){ Modified: stable/11/contrib/sqlite3/sqlite3.c ============================================================================== --- stable/11/contrib/sqlite3/sqlite3.c Wed May 8 15:44:53 2019 (r347346) +++ stable/11/contrib/sqlite3/sqlite3.c Wed May 8 15:48:55 2019 (r347347) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.27.2. By combining all the individual C code files into this +** version 3.28.0. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1162,9 +1162,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.27.2" -#define SQLITE_VERSION_NUMBER 3027002 -#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7" +#define SQLITE_VERSION "3.28.0" +#define SQLITE_VERSION_NUMBER 3028000 +#define SQLITE_SOURCE_ID "2019-04-16 19:49:53 884b4b7e502b4e991677b53971277adfaf0a04a284f8e483e2553d0f83156b50" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1228,6 +1228,9 @@ SQLITE_API int sqlite3_libversion_number(void); #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS SQLITE_API int sqlite3_compileoption_used(const char *zOptName); SQLITE_API const char *sqlite3_compileoption_get(int N); +#else +# define sqlite3_compileoption_used(X) 0 +# define sqlite3_compileoption_get(X) ((void*)0) #endif /* @@ -3125,8 +3128,8 @@ struct sqlite3_mem_methods { ** ** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]] **
    SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
    -**
    ^This option is used to enable or disable the two-argument -** version of the [fts3_tokenizer()] function which is part of the +**
    ^This option is used to enable or disable the +** [fts3_tokenizer()] function which is part of the ** [FTS3] full-text search engine extension. ** There should be two additional arguments. ** The first argument is an integer which is 0 to disable fts3_tokenizer() or @@ -3238,6 +3241,17 @@ struct sqlite3_mem_methods { **
  • Direct writes to [shadow tables]. ** **
  • +** +** [[SQLITE_DBCONFIG_WRITABLE_SCHEMA]]
    SQLITE_DBCONFIG_WRITABLE_SCHEMA
    +**
    The SQLITE_DBCONFIG_WRITABLE_SCHEMA option activates or deactivates the +** "writable_schema" flag. This has the same effect and is logically equivalent +** to setting [PRAGMA writable_schema=ON] or [PRAGMA writable_schema=OFF]. +** The first argument to this setting is an integer which is 0 to disable +** the writable_schema, positive to enable writable_schema, or negative to +** leave the setting unchanged. The second parameter is a pointer to an +** integer into which is written 0 or 1 to indicate whether the writable_schema +** is enabled or disabled following this call. +**
    ** */ #define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ @@ -3251,7 +3265,8 @@ struct sqlite3_mem_methods { #define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */ #define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */ #define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */ -#define SQLITE_DBCONFIG_MAX 1010 /* Largest DBCONFIG */ +#define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */ +#define SQLITE_DBCONFIG_MAX 1011 /* Largest DBCONFIG */ /* ** CAPI3REF: Enable Or Disable Extended Result Codes @@ -4934,6 +4949,18 @@ SQLITE_API const char *sqlite3_normalized_sql(sqlite3_ SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); /* +** CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement +** METHOD: sqlite3_stmt +** +** ^The sqlite3_stmt_isexplain(S) interface returns 1 if the +** prepared statement S is an EXPLAIN statement, or 2 if the +** statement S is an EXPLAIN QUERY PLAN. +** ^The sqlite3_stmt_isexplain(S) interface returns 0 if S is +** an ordinary statement or a NULL pointer. +*/ +SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt); + +/* ** CAPI3REF: Determine If A Prepared Statement Has Been Reset ** METHOD: sqlite3_stmt ** @@ -5072,7 +5099,9 @@ typedef struct sqlite3_context sqlite3_context; ** ^The fifth argument to the BLOB and string binding interfaces ** is a destructor used to dispose of the BLOB or ** string after SQLite has finished with it. ^The destructor is called -** to dispose of the BLOB or string even if the call to bind API fails. +** to dispose of the BLOB or string even if the call to the bind API fails, +** except the destructor is not called if the third parameter is a NULL +** pointer or the fourth parameter is negative. ** ^If the fifth argument is ** the special value [SQLITE_STATIC], then SQLite assumes that the ** information is in static, unmanaged space and does not need to be freed. @@ -5989,6 +6018,8 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm( ** sqlite3_value_nochange   ** →  True if the column is unchanged in an UPDATE ** against a virtual table. +** sqlite3_value_frombind   +** →  True if value originated from a [bound parameter] ** ** ** Details: @@ -6050,6 +6081,11 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm( ** than within an [xUpdate] method call for an UPDATE statement, then ** the return value is arbitrary and meaningless. ** +** ^The sqlite3_value_frombind(X) interface returns non-zero if the +** value X originated from one of the [sqlite3_bind_int|sqlite3_bind()] +** interfaces. ^If X comes from an SQL literal value, or a table column, +** and expression, then sqlite3_value_frombind(X) returns zero. +** ** Please pay particular attention to the fact that the pointer returned ** from [sqlite3_value_blob()], [sqlite3_value_text()], or ** [sqlite3_value_text16()] can be invalidated by a subsequent call to @@ -6095,6 +6131,7 @@ SQLITE_API int sqlite3_value_bytes16(sqlite3_value*); SQLITE_API int sqlite3_value_type(sqlite3_value*); SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*); SQLITE_API int sqlite3_value_nochange(sqlite3_value*); +SQLITE_API int sqlite3_value_frombind(sqlite3_value*); /* ** CAPI3REF: Finding The Subtype Of SQL Values @@ -6830,7 +6867,7 @@ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); ** associated with database N of connection D. ^The main database file ** has the name "main". If there is no attached database N on the database ** connection D, or if database N is a temporary or in-memory database, then -** a NULL pointer is returned. +** this function will return either a NULL pointer or an empty string. ** ** ^The filename returned by this function is the output of the ** xFullPathname method of the [VFS]. ^In other words, the filename @@ -11931,7 +11968,7 @@ SQLITE_API int sqlite3rebaser_configure( ** in size. This function allocates and populates a buffer with a copy ** of the changeset rebased rebased according to the configuration of the ** rebaser object passed as the first argument. If successful, (*ppOut) -** is set to point to the new buffer containing the rebased changset and +** is set to point to the new buffer containing the rebased changeset and ** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the ** responsibility of the caller to eventually free the new buffer using ** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut) @@ -12340,7 +12377,7 @@ struct Fts5PhraseIter { ** Save the pointer passed as the second argument as the extension functions ** "auxiliary data". The pointer may then be retrieved by the current or any ** future invocation of the same fts5 extension function made as part of -** of the same MATCH query using the xGetAuxdata() API. +** the same MATCH query using the xGetAuxdata() API. ** ** Each extension function is allocated a single auxiliary data slot for ** each FTS query (MATCH expression). If the extension function is invoked @@ -12355,7 +12392,7 @@ struct Fts5PhraseIter { ** The xDelete callback, if one is specified, is also invoked on the ** auxiliary data pointer after the FTS5 query has finished. ** -** If an error (e.g. an OOM condition) occurs within this function, an +** If an error (e.g. an OOM condition) occurs within this function, ** the auxiliary data is set to NULL and an error code returned. If the ** xDelete parameter was not NULL, it is invoked on the auxiliary data ** pointer before returning. @@ -13381,7 +13418,7 @@ struct Hash { unsigned int count; /* Number of entries in this table */ HashElem *first; /* The first element of the array */ struct _ht { /* the hash table */ - int count; /* Number of entries with this hash */ + unsigned int count; /* Number of entries with this hash */ HashElem *chain; /* Pointer to first entry with this hash */ } *ht; }; @@ -13522,100 +13559,95 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*); #define TK_PRECEDING 85 #define TK_RANGE 86 #define TK_UNBOUNDED 87 -#define TK_REINDEX 88 -#define TK_RENAME 89 -#define TK_CTIME_KW 90 -#define TK_ANY 91 -#define TK_BITAND 92 -#define TK_BITOR 93 -#define TK_LSHIFT 94 -#define TK_RSHIFT 95 -#define TK_PLUS 96 -#define TK_MINUS 97 -#define TK_STAR 98 -#define TK_SLASH 99 -#define TK_REM 100 -#define TK_CONCAT 101 -#define TK_COLLATE 102 -#define TK_BITNOT 103 -#define TK_ON 104 -#define TK_INDEXED 105 -#define TK_STRING 106 -#define TK_JOIN_KW 107 -#define TK_CONSTRAINT 108 -#define TK_DEFAULT 109 -#define TK_NULL 110 -#define TK_PRIMARY 111 -#define TK_UNIQUE 112 -#define TK_CHECK 113 -#define TK_REFERENCES 114 -#define TK_AUTOINCR 115 -#define TK_INSERT 116 -#define TK_DELETE 117 -#define TK_UPDATE 118 -#define TK_SET 119 -#define TK_DEFERRABLE 120 -#define TK_FOREIGN 121 -#define TK_DROP 122 -#define TK_UNION 123 -#define TK_ALL 124 -#define TK_EXCEPT 125 -#define TK_INTERSECT 126 -#define TK_SELECT 127 -#define TK_VALUES 128 -#define TK_DISTINCT 129 -#define TK_DOT 130 -#define TK_FROM 131 -#define TK_JOIN 132 -#define TK_USING 133 -#define TK_ORDER 134 -#define TK_GROUP 135 -#define TK_HAVING 136 -#define TK_LIMIT 137 -#define TK_WHERE 138 -#define TK_INTO 139 -#define TK_NOTHING 140 -#define TK_FLOAT 141 -#define TK_BLOB 142 -#define TK_INTEGER 143 -#define TK_VARIABLE 144 -#define TK_CASE 145 -#define TK_WHEN 146 -#define TK_THEN 147 -#define TK_ELSE 148 -#define TK_INDEX 149 -#define TK_ALTER 150 -#define TK_ADD 151 -#define TK_WINDOW 152 -#define TK_OVER 153 -#define TK_FILTER 154 -#define TK_TRUEFALSE 155 -#define TK_ISNOT 156 -#define TK_FUNCTION 157 -#define TK_COLUMN 158 -#define TK_AGG_FUNCTION 159 -#define TK_AGG_COLUMN 160 -#define TK_UMINUS 161 -#define TK_UPLUS 162 -#define TK_TRUTH 163 -#define TK_REGISTER 164 -#define TK_VECTOR 165 -#define TK_SELECT_COLUMN 166 -#define TK_IF_NULL_ROW 167 -#define TK_ASTERISK 168 -#define TK_SPAN 169 -#define TK_END_OF_FILE 170 -#define TK_UNCLOSED_STRING 171 -#define TK_SPACE 172 -#define TK_ILLEGAL 173 +#define TK_EXCLUDE 88 +#define TK_GROUPS 89 +#define TK_OTHERS 90 +#define TK_TIES 91 +#define TK_REINDEX 92 +#define TK_RENAME 93 +#define TK_CTIME_KW 94 +#define TK_ANY 95 +#define TK_BITAND 96 +#define TK_BITOR 97 +#define TK_LSHIFT 98 +#define TK_RSHIFT 99 +#define TK_PLUS 100 +#define TK_MINUS 101 +#define TK_STAR 102 +#define TK_SLASH 103 +#define TK_REM 104 +#define TK_CONCAT 105 +#define TK_COLLATE 106 +#define TK_BITNOT 107 +#define TK_ON 108 +#define TK_INDEXED 109 +#define TK_STRING 110 +#define TK_JOIN_KW 111 +#define TK_CONSTRAINT 112 +#define TK_DEFAULT 113 +#define TK_NULL 114 +#define TK_PRIMARY 115 +#define TK_UNIQUE 116 +#define TK_CHECK 117 +#define TK_REFERENCES 118 +#define TK_AUTOINCR 119 +#define TK_INSERT 120 +#define TK_DELETE 121 +#define TK_UPDATE 122 +#define TK_SET 123 +#define TK_DEFERRABLE 124 +#define TK_FOREIGN 125 +#define TK_DROP 126 +#define TK_UNION 127 +#define TK_ALL 128 +#define TK_EXCEPT 129 +#define TK_INTERSECT 130 +#define TK_SELECT 131 +#define TK_VALUES 132 +#define TK_DISTINCT 133 +#define TK_DOT 134 +#define TK_FROM 135 +#define TK_JOIN 136 +#define TK_USING 137 +#define TK_ORDER 138 +#define TK_GROUP 139 +#define TK_HAVING 140 +#define TK_LIMIT 141 +#define TK_WHERE 142 +#define TK_INTO 143 +#define TK_NOTHING 144 +#define TK_FLOAT 145 +#define TK_BLOB 146 +#define TK_INTEGER 147 +#define TK_VARIABLE 148 +#define TK_CASE 149 +#define TK_WHEN 150 +#define TK_THEN 151 +#define TK_ELSE 152 +#define TK_INDEX 153 +#define TK_ALTER 154 +#define TK_ADD 155 +#define TK_WINDOW 156 +#define TK_OVER 157 +#define TK_FILTER 158 +#define TK_TRUEFALSE 159 +#define TK_ISNOT 160 +#define TK_FUNCTION 161 +#define TK_COLUMN 162 +#define TK_AGG_FUNCTION 163 +#define TK_AGG_COLUMN 164 +#define TK_UMINUS 165 +#define TK_UPLUS 166 +#define TK_TRUTH 167 +#define TK_REGISTER 168 +#define TK_VECTOR 169 +#define TK_SELECT_COLUMN 170 +#define TK_IF_NULL_ROW 171 +#define TK_ASTERISK 172 +#define TK_SPAN 173 +#define TK_SPACE 174 +#define TK_ILLEGAL 175 -/* The token codes above must all fit in 8 bits */ -#define TKFLG_MASK 0xff - -/* Flags that can be added to a token code when it is not -** being stored in a u8: */ -#define TKFLG_DONTFOLD 0x100 /* Omit constant folding optimizations */ - /************** End of parse.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ #include @@ -14546,9 +14578,6 @@ struct BtreePayload { SQLITE_PRIVATE int sqlite3BtreeInsert(BtCursor*, const BtreePayload *pPayload, int flags, int seekResult); SQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor*, int *pRes); -#ifndef SQLITE_OMIT_WINDOWFUNC -SQLITE_PRIVATE void sqlite3BtreeSkipNext(BtCursor*); -#endif SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor*, int *pRes); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 8 15:49:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3873F158AE7B; Wed, 8 May 2019 15:49:28 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC39381538; Wed, 8 May 2019 15:49:27 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B79387E3D; Wed, 8 May 2019 15:49:27 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48FnR6E013677; Wed, 8 May 2019 15:49:27 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48FnCZw013660; Wed, 8 May 2019 15:49:12 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905081549.x48FnCZw013660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 8 May 2019 15:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347347 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 11/contrib/sqlite3/tea/generic 12/contrib/sqlite3 12/contrib/sqlite3/tea 12/contrib/sqlite3/tea/generic X-SVN-Commit-Revision: 347347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC39381538 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 15:49:28 -0000 Author: cy Date: Wed May 8 15:48:55 2019 New Revision: 347347 URL: https://svnweb.freebsd.org/changeset/base/347347 Log: MFC r347139: MFV r347136: Update sqlite3-3.27.2 (3270200) --> sqlite3-3.28.0 (3280000) Security: CVE-2019-9937, CVE-2019-9936 Modified: stable/12/contrib/sqlite3/Makefile.msc stable/12/contrib/sqlite3/configure stable/12/contrib/sqlite3/configure.ac stable/12/contrib/sqlite3/shell.c stable/12/contrib/sqlite3/sqlite3.c stable/12/contrib/sqlite3/sqlite3.h stable/12/contrib/sqlite3/sqlite3ext.h stable/12/contrib/sqlite3/tea/configure stable/12/contrib/sqlite3/tea/configure.ac stable/12/contrib/sqlite3/tea/generic/tclsqlite3.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/sqlite3/Makefile.msc stable/11/contrib/sqlite3/configure stable/11/contrib/sqlite3/configure.ac stable/11/contrib/sqlite3/shell.c stable/11/contrib/sqlite3/sqlite3.c stable/11/contrib/sqlite3/sqlite3.h stable/11/contrib/sqlite3/sqlite3ext.h stable/11/contrib/sqlite3/tea/configure stable/11/contrib/sqlite3/tea/configure.ac stable/11/contrib/sqlite3/tea/generic/tclsqlite3.c Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/sqlite3/Makefile.msc ============================================================================== --- stable/12/contrib/sqlite3/Makefile.msc Wed May 8 15:44:53 2019 (r347346) +++ stable/12/contrib/sqlite3/Makefile.msc Wed May 8 15:48:55 2019 (r347347) @@ -433,9 +433,9 @@ UCRTLIBPATH = $(UCRTLIBPATH:\\=\) # will run on the platform that is doing the build. # !IF $(USE_FULLWARN)!=0 -BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS) +BCC = $(NCC) -nologo -W4 -Fd$*.pdb $(CCOPTS) $(BCCOPTS) !ELSE -BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS) +BCC = $(NCC) -nologo -W3 -Fd$*.pdb $(CCOPTS) $(BCCOPTS) !ENDIF # Check if assembly code listings should be generated for the source @@ -808,7 +808,7 @@ BCC = $(BCC) -Zi # Command line prefixes for compiling code, compiling resources, # linking, etc. # -LTCOMPILE = $(TCC) -Fo$@ +LTCOMPILE = $(TCC) -Fo$@ -Fd$*.pdb LTRCOMPILE = $(RCC) -r LTLIB = lib.exe LTLINK = $(TCC) -Fe$@ @@ -826,6 +826,11 @@ LTLIBS = $(LTLIBS) rpcrt4.lib !IFDEF PLATFORM LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM) LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM) +!ELSEIF "$(VISUALSTUDIOVERSION)"=="12.0" || \ + "$(VISUALSTUDIOVERSION)"=="14.0" || \ + "$(VISUALSTUDIOVERSION)"=="15.0" +LTLINKOPTS = /NOLOGO /MACHINE:x86 +LTLIBOPTS = /NOLOGO /MACHINE:x86 !ELSE LTLINKOPTS = /NOLOGO LTLIBOPTS = /NOLOGO Modified: stable/12/contrib/sqlite3/configure ============================================================================== --- stable/12/contrib/sqlite3/configure Wed May 8 15:44:53 2019 (r347346) +++ stable/12/contrib/sqlite3/configure Wed May 8 15:48:55 2019 (r347347) @@ -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.2. +# Generated by GNU Autoconf 2.69 for sqlite 3.28.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.27.2' -PACKAGE_STRING='sqlite 3.27.2' +PACKAGE_VERSION='3.28.0' +PACKAGE_STRING='sqlite 3.28.0' 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.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.28.0 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.2:";; + short | recursive ) echo "Configuration of sqlite 3.28.0:";; 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.2 +sqlite configure 3.28.0 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.2, which was +It was created by sqlite $as_me 3.28.0, 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.2' + VERSION='3.28.0' 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.2, which was +This file was extended by sqlite $as_me 3.28.0, 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.2 +sqlite config.status 3.28.0 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 8 15:44:53 2019 (r347346) +++ stable/12/contrib/sqlite3/configure.ac Wed May 8 15:48:55 2019 (r347347) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.27.2, http://www.sqlite.org) +AC_INIT(sqlite, 3.28.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: stable/12/contrib/sqlite3/shell.c ============================================================================== --- stable/12/contrib/sqlite3/shell.c Wed May 8 15:44:53 2019 (r347346) +++ stable/12/contrib/sqlite3/shell.c Wed May 8 15:48:55 2019 (r347347) @@ -2177,13 +2177,13 @@ static void readFileContents(sqlite3_context *ctx, con fclose(in); return; } - pBuf = sqlite3_malloc64( nIn ); + pBuf = sqlite3_malloc64( nIn ? nIn : 1 ); if( pBuf==0 ){ sqlite3_result_error_nomem(ctx); fclose(in); return; } - if( 1==fread(pBuf, nIn, 1, in) ){ + if( nIn==(sqlite3_int64)fread(pBuf, 1, (size_t)nIn, in) ){ sqlite3_result_blob64(ctx, pBuf, nIn, sqlite3_free); }else{ sqlite3_result_error_code(ctx, SQLITE_IOERR); @@ -2318,15 +2318,15 @@ static int fileLinkStat( ** Argument zFile is the name of a file that will be created and/or written ** by SQL function writefile(). This function ensures that the directory ** zFile will be written to exists, creating it if required. The permissions -** for any path components created by this function are set to (mode&0777). +** for any path components created by this function are set in accordance +** with the current umask. ** ** If an OOM condition is encountered, SQLITE_NOMEM is returned. Otherwise, ** SQLITE_OK is returned if the directory is successfully created, or ** SQLITE_ERROR otherwise. */ static int makeDirectory( - const char *zFile, - mode_t mode + const char *zFile ){ char *zCopy = sqlite3_mprintf("%s", zFile); int rc = SQLITE_OK; @@ -2347,7 +2347,7 @@ static int makeDirectory( rc2 = fileStat(zCopy, &sStat); if( rc2!=0 ){ - if( mkdir(zCopy, mode & 0777) ) rc = SQLITE_ERROR; + if( mkdir(zCopy, 0777) ) rc = SQLITE_ERROR; }else{ if( !S_ISDIR(sStat.st_mode) ) rc = SQLITE_ERROR; } @@ -2505,7 +2505,7 @@ static void writefileFunc( res = writeFile(context, zFile, argv[1], mode, mtime); if( res==1 && errno==ENOENT ){ - if( makeDirectory(zFile, mode)==SQLITE_OK ){ + if( makeDirectory(zFile)==SQLITE_OK ){ res = writeFile(context, zFile, argv[1], mode, mtime); } } @@ -10430,7 +10430,67 @@ static void restore_debug_trace_modes(void){ #endif } +/* Create the TEMP table used to store parameter bindings */ +static void bind_table_init(ShellState *p){ + int wrSchema = 0; + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); + sqlite3_exec(p->db, + "CREATE TABLE IF NOT EXISTS temp.sqlite_parameters(\n" + " key TEXT PRIMARY KEY,\n" + " value ANY\n" + ") WITHOUT ROWID;", + 0, 0, 0); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); +} + /* +** Bind parameters on a prepared statement. +** +** Parameter bindings are taken from a TEMP table of the form: +** +** CREATE TEMP TABLE sqlite_parameters(key TEXT PRIMARY KEY, value) +** WITHOUT ROWID; +** +** No bindings occur if this table does not exist. The special character '$' +** is included in the table name to help prevent collisions with actual tables. +** The table must be in the TEMP schema. +*/ +static void bind_prepared_stmt(ShellState *pArg, sqlite3_stmt *pStmt){ + int nVar; + int i; + int rc; + sqlite3_stmt *pQ = 0; + + nVar = sqlite3_bind_parameter_count(pStmt); + if( nVar==0 ) return; /* Nothing to do */ + if( sqlite3_table_column_metadata(pArg->db, "TEMP", "sqlite_parameters", + "key", 0, 0, 0, 0, 0)!=SQLITE_OK ){ + return; /* Parameter table does not exist */ + } + rc = sqlite3_prepare_v2(pArg->db, + "SELECT value FROM temp.sqlite_parameters" + " WHERE key=?1", -1, &pQ, 0); + if( rc || pQ==0 ) return; + for(i=1; i<=nVar; i++){ + char zNum[30]; + const char *zVar = sqlite3_bind_parameter_name(pStmt, i); + if( zVar==0 ){ + sqlite3_snprintf(sizeof(zNum),zNum,"?%d",i); + zVar = zNum; + } + sqlite3_bind_text(pQ, 1, zVar, -1, SQLITE_STATIC); + if( sqlite3_step(pQ)==SQLITE_ROW ){ + sqlite3_bind_value(pStmt, i, sqlite3_column_value(pQ, 0)); + }else{ + sqlite3_bind_null(pStmt, i); + } + sqlite3_reset(pQ); + } + sqlite3_finalize(pQ); +} + +/* ** Run a prepared statement */ static void exec_prepared_stmt( @@ -10682,7 +10742,7 @@ static int shell_exec( } /* Show the EXPLAIN QUERY PLAN if .eqp is on */ - if( pArg && pArg->autoEQP && sqlite3_strlike("EXPLAIN%",zStmtSql,0)!=0 ){ + if( pArg && pArg->autoEQP && sqlite3_stmt_isexplain(pStmt)==0 ){ sqlite3_stmt *pExplain; char *zEQP; int triggerEQP = 0; @@ -10731,13 +10791,10 @@ static int shell_exec( if( pArg ){ pArg->cMode = pArg->mode; if( pArg->autoExplain ){ - if( sqlite3_column_count(pStmt)==8 - && sqlite3_strlike("EXPLAIN%", zStmtSql,0)==0 - ){ + if( sqlite3_stmt_isexplain(pStmt)==1 ){ pArg->cMode = MODE_Explain; } - if( sqlite3_column_count(pStmt)==4 - && sqlite3_strlike("EXPLAIN QUERY PLAN%", zStmtSql,0)==0 ){ + if( sqlite3_stmt_isexplain(pStmt)==2 ){ pArg->cMode = MODE_EQP; } } @@ -10749,6 +10806,7 @@ static int shell_exec( } } + bind_prepared_stmt(pArg, pStmt); exec_prepared_stmt(pArg, pStmt); explain_data_delete(pArg); eqp_render(pArg); @@ -11078,7 +11136,8 @@ static const char *(azHelp[]) = { ".archive ... Manage SQL archives", " Each command must have exactly one of the following options:", " -c, --create Create a new archive", - " -u, --update Update or add files to an existing archive", + " -u, --update Add files or update files with changed mtime", + " -i, --insert Like -u but always add even if mtime unchanged", " -t, --list List contents of archive", " -x, --extract Extract files from archive", " Optional arguments:", @@ -11180,6 +11239,13 @@ static const char *(azHelp[]) = { " --zip FILE is a ZIP archive", ".output ?FILE? Send output to FILE or stdout if FILE is omitted", " If FILE begins with '|' then open it as a pipe.", + ".parameter CMD ... Manage SQL parameter bindings", + " clear Erase all bindings", + " init Initialize the TEMP table that holds bindings", + " list List the current parameter bindings", + " set PARAMETER VALUE Given SQL parameter PARAMETER a value of VALUE", + " PARAMETER should start with '$', ':', '@', or '?'", + " unset PARAMETER Remove PARAMETER from the binding table", ".print STRING... Print literal STRING", #ifndef SQLITE_OMIT_PROGRESS_CALLBACK ".progress N Invoke progress handler after every N opcodes", @@ -12392,7 +12458,7 @@ static int shell_dbinfo_command(ShellState *p, int nAr { "schema size:", "SELECT total(length(sql)) FROM %s" }, }; - int i; + int i, rc; unsigned iDataVersion; char *zSchemaTab; char *zDb = nArg>=2 ? azArg[1] : "main"; @@ -12400,8 +12466,19 @@ static int shell_dbinfo_command(ShellState *p, int nAr unsigned char aHdr[100]; open_db(p, 0); if( p->db==0 ) return 1; - sqlite3_prepare_v2(p->db,"SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1", - -1, &pStmt, 0); + rc = sqlite3_prepare_v2(p->db, + "SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1", + -1, &pStmt, 0); + if( rc ){ + if( !sqlite3_compileoption_used("ENABLE_DBPAGE_VTAB") ){ + utf8_printf(stderr, "the \".dbinfo\" command requires the " + "-DSQLITE_ENABLE_DBPAGE_VTAB compile-time options\n"); + }else{ + utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db)); + } + sqlite3_finalize(pStmt); + return 1; + } sqlite3_bind_text(pStmt, 1, zDb, -1, SQLITE_STATIC); if( sqlite3_step(pStmt)==SQLITE_ROW && sqlite3_column_bytes(pStmt,0)>100 @@ -12995,19 +13072,20 @@ static int arErrorMsg(ArCommand *pAr, const char *zFmt ** Values for ArCommand.eCmd. */ #define AR_CMD_CREATE 1 -#define AR_CMD_EXTRACT 2 -#define AR_CMD_LIST 3 -#define AR_CMD_UPDATE 4 -#define AR_CMD_HELP 5 +#define AR_CMD_UPDATE 2 +#define AR_CMD_INSERT 3 +#define AR_CMD_EXTRACT 4 +#define AR_CMD_LIST 5 +#define AR_CMD_HELP 6 /* ** Other (non-command) switches. */ -#define AR_SWITCH_VERBOSE 6 -#define AR_SWITCH_FILE 7 -#define AR_SWITCH_DIRECTORY 8 -#define AR_SWITCH_APPEND 9 -#define AR_SWITCH_DRYRUN 10 +#define AR_SWITCH_VERBOSE 7 +#define AR_SWITCH_FILE 8 +#define AR_SWITCH_DIRECTORY 9 +#define AR_SWITCH_APPEND 10 +#define AR_SWITCH_DRYRUN 11 static int arProcessSwitch(ArCommand *pAr, int eSwitch, const char *zArg){ switch( eSwitch ){ @@ -13015,6 +13093,7 @@ static int arProcessSwitch(ArCommand *pAr, int eSwitch case AR_CMD_EXTRACT: case AR_CMD_LIST: case AR_CMD_UPDATE: + case AR_CMD_INSERT: case AR_CMD_HELP: if( pAr->eCmd ){ return arErrorMsg(pAr, "multiple command options"); @@ -13061,6 +13140,7 @@ static int arParseCommand( } aSwitch[] = { { "create", 'c', AR_CMD_CREATE, 0 }, { "extract", 'x', AR_CMD_EXTRACT, 0 }, + { "insert", 'i', AR_CMD_INSERT, 0 }, { "list", 't', AR_CMD_LIST, 0 }, { "update", 'u', AR_CMD_UPDATE, 0 }, { "help", 'h', AR_CMD_HELP, 0 }, @@ -13396,19 +13476,27 @@ static int arExecSql(ArCommand *pAr, const char *zSql) /* -** Implementation of .ar "create" and "update" commands. +** Implementation of .ar "create", "insert", and "update" commands. ** +** create -> Create a new SQL archive +** insert -> Insert or reinsert all files listed +** update -> Insert files that have changed or that were not +** previously in the archive +** ** Create the "sqlar" table in the database if it does not already exist. ** Then add each file in the azFile[] array to the archive. Directories ** are added recursively. If argument bVerbose is non-zero, a message is ** printed on stdout for each file archived. ** ** The create command is the same as update, except that it drops -** any existing "sqlar" table before beginning. +** any existing "sqlar" table before beginning. The "insert" command +** always overwrites every file named on the command-line, where as +** "update" only overwrites if the size or mtime or mode has changed. */ static int arCreateOrUpdateCommand( ArCommand *pAr, /* Command arguments and options */ - int bUpdate /* true for a --create. false for --update */ + int bUpdate, /* true for a --create. */ + int bOnlyIfChanged /* Only update if file has changed */ ){ const char *zCreate = "CREATE TABLE IF NOT EXISTS sqlar(\n" @@ -13430,22 +13518,24 @@ static int arCreateOrUpdateCommand( " WHEN 'd' THEN 0\n" " ELSE -1 END,\n" " sqlar_compress(data)\n" - " FROM fsdir(%Q,%Q)\n" - " WHERE lsmode(mode) NOT LIKE '?%%';", + " FROM fsdir(%Q,%Q) AS disk\n" + " WHERE lsmode(mode) NOT LIKE '?%%'%s;" + , "REPLACE INTO %s(name,mode,mtime,data)\n" " SELECT\n" " %s,\n" " mode,\n" " mtime,\n" " data\n" - " FROM fsdir(%Q,%Q)\n" - " WHERE lsmode(mode) NOT LIKE '?%%';" + " FROM fsdir(%Q,%Q) AS disk\n" + " WHERE lsmode(mode) NOT LIKE '?%%'%s;" }; int i; /* For iterating through azFile[] */ int rc; /* Return code */ const char *zTab = 0; /* SQL table into which to insert */ char *zSql; char zTemp[50]; + char *zExists = 0; arExecSql(pAr, "PRAGMA page_size=512"); rc = arExecSql(pAr, "SAVEPOINT ar;"); @@ -13476,10 +13566,21 @@ static int arCreateOrUpdateCommand( } rc = arExecSql(pAr, zCreate); } + if( bOnlyIfChanged ){ + zExists = sqlite3_mprintf( + " AND NOT EXISTS(" + "SELECT 1 FROM %s AS mem" + " WHERE mem.name=disk.name" + " AND mem.mtime=disk.mtime" + " AND mem.mode=disk.mode)", zTab); + }else{ + zExists = sqlite3_mprintf(""); + } + if( zExists==0 ) rc = SQLITE_NOMEM; for(i=0; inArg && rc==SQLITE_OK; i++){ char *zSql2 = sqlite3_mprintf(zInsertFmt[pAr->bZip], zTab, pAr->bVerbose ? "shell_putsnl(name)" : "name", - pAr->azArg[i], pAr->zDir); + pAr->azArg[i], pAr->zDir, zExists); rc = arExecSql(pAr, zSql2); sqlite3_free(zSql2); } @@ -13494,6 +13595,7 @@ end_ar_transaction: sqlite3_free(zSql); } } + sqlite3_free(zExists); return rc; } @@ -13532,7 +13634,8 @@ static int arDotCommand( }else if( cmd.zFile ){ int flags; if( cmd.bAppend ) eDbType = SHELL_OPEN_APPENDVFS; - if( cmd.eCmd==AR_CMD_CREATE || cmd.eCmd==AR_CMD_UPDATE ){ + if( cmd.eCmd==AR_CMD_CREATE || cmd.eCmd==AR_CMD_INSERT + || cmd.eCmd==AR_CMD_UPDATE ){ flags = SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE; }else{ flags = SQLITE_OPEN_READONLY; @@ -13569,7 +13672,7 @@ static int arDotCommand( switch( cmd.eCmd ){ case AR_CMD_CREATE: - rc = arCreateOrUpdateCommand(&cmd, 0); + rc = arCreateOrUpdateCommand(&cmd, 0, 0); break; case AR_CMD_EXTRACT: @@ -13584,9 +13687,13 @@ static int arDotCommand( arUsage(pState->out); break; + case AR_CMD_INSERT: + rc = arCreateOrUpdateCommand(&cmd, 1, 0); + break; + default: assert( cmd.eCmd==AR_CMD_UPDATE ); - rc = arCreateOrUpdateCommand(&cmd, 1); + rc = arCreateOrUpdateCommand(&cmd, 1, 1); break; } } @@ -14709,6 +14816,114 @@ static int do_meta_command(char *zLine, ShellState *p) sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", zFile); } } + }else + + if( c=='p' && n>=3 && strncmp(azArg[0], "parameter", n)==0 ){ + open_db(p,0); + if( nArg<=1 ) goto parameter_syntax_error; + + /* .parameter clear + ** Clear all bind parameters by dropping the TEMP table that holds them. + */ + if( nArg==2 && strcmp(azArg[1],"clear")==0 ){ + int wrSchema = 0; + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); + sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp.sqlite_parameters;", + 0, 0, 0); + sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); + }else + + /* .parameter list + ** List all bind parameters. + */ + if( nArg==2 && strcmp(azArg[1],"list")==0 ){ + sqlite3_stmt *pStmt = 0; + int rx; + int len = 0; + rx = sqlite3_prepare_v2(p->db, + "SELECT max(length(key)) " + "FROM temp.sqlite_parameters;", -1, &pStmt, 0); + if( rx==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ + len = sqlite3_column_int(pStmt, 0); + if( len>40 ) len = 40; + } + sqlite3_finalize(pStmt); + pStmt = 0; + if( len ){ + rx = sqlite3_prepare_v2(p->db, + "SELECT key, quote(value) " + "FROM temp.sqlite_parameters;", -1, &pStmt, 0); + while( sqlite3_step(pStmt)==SQLITE_ROW ){ + utf8_printf(p->out, "%-*s %s\n", len, sqlite3_column_text(pStmt,0), + sqlite3_column_text(pStmt,1)); + } + sqlite3_finalize(pStmt); + } + }else + + /* .parameter init + ** Make sure the TEMP table used to hold bind parameters exists. + ** Create it if necessary. + */ + if( nArg==2 && strcmp(azArg[1],"init")==0 ){ + bind_table_init(p); + }else + + /* .parameter set NAME VALUE + ** Set or reset a bind parameter. NAME should be the full parameter + ** name exactly as it appears in the query. (ex: $abc, @def). The + ** VALUE can be in either SQL literal notation, or if not it will be + ** understood to be a text string. + */ + if( nArg==4 && strcmp(azArg[1],"set")==0 ){ + int rx; + char *zSql; + sqlite3_stmt *pStmt; + const char *zKey = azArg[2]; + const char *zValue = azArg[3]; + bind_table_init(p); + zSql = sqlite3_mprintf( + "REPLACE INTO temp.sqlite_parameters(key,value)" + "VALUES(%Q,%s);", zKey, zValue); + if( zSql==0 ) shell_out_of_memory(); + pStmt = 0; + rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); + sqlite3_free(zSql); + if( rx!=SQLITE_OK ){ + sqlite3_finalize(pStmt); + pStmt = 0; + zSql = sqlite3_mprintf( + "REPLACE INTO temp.sqlite_parameters(key,value)" + "VALUES(%Q,%Q);", zKey, zValue); + if( zSql==0 ) shell_out_of_memory(); + rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); + sqlite3_free(zSql); + if( rx!=SQLITE_OK ){ + utf8_printf(p->out, "Error: %s\n", sqlite3_errmsg(p->db)); + sqlite3_finalize(pStmt); + pStmt = 0; + rc = 1; + } + } + sqlite3_step(pStmt); + sqlite3_finalize(pStmt); + }else + + /* .parameter unset NAME + ** Remove the NAME binding from the parameter binding table, if it + ** exists. + */ + if( nArg==3 && strcmp(azArg[1],"unset")==0 ){ + char *zSql = sqlite3_mprintf( + "DELETE FROM temp.sqlite_parameters WHERE key=%Q", azArg[2]); + if( zSql==0 ) shell_out_of_memory(); + sqlite3_exec(p->db, zSql, 0, 0, 0); + sqlite3_free(zSql); + }else + /* If no command name matches, show a syntax error */ + parameter_syntax_error: + showHelp(p->out, "parameter"); }else if( c=='p' && n>=3 && strncmp(azArg[0], "print", n)==0 ){ Modified: stable/12/contrib/sqlite3/sqlite3.c ============================================================================== --- stable/12/contrib/sqlite3/sqlite3.c Wed May 8 15:44:53 2019 (r347346) +++ stable/12/contrib/sqlite3/sqlite3.c Wed May 8 15:48:55 2019 (r347347) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.27.2. By combining all the individual C code files into this +** version 3.28.0. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1162,9 +1162,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.27.2" -#define SQLITE_VERSION_NUMBER 3027002 -#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7" +#define SQLITE_VERSION "3.28.0" +#define SQLITE_VERSION_NUMBER 3028000 +#define SQLITE_SOURCE_ID "2019-04-16 19:49:53 884b4b7e502b4e991677b53971277adfaf0a04a284f8e483e2553d0f83156b50" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1228,6 +1228,9 @@ SQLITE_API int sqlite3_libversion_number(void); #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS SQLITE_API int sqlite3_compileoption_used(const char *zOptName); SQLITE_API const char *sqlite3_compileoption_get(int N); +#else +# define sqlite3_compileoption_used(X) 0 +# define sqlite3_compileoption_get(X) ((void*)0) #endif /* @@ -3125,8 +3128,8 @@ struct sqlite3_mem_methods { ** ** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]] **
    SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
    -**
    ^This option is used to enable or disable the two-argument -** version of the [fts3_tokenizer()] function which is part of the +**
    ^This option is used to enable or disable the +** [fts3_tokenizer()] function which is part of the ** [FTS3] full-text search engine extension. ** There should be two additional arguments. ** The first argument is an integer which is 0 to disable fts3_tokenizer() or @@ -3238,6 +3241,17 @@ struct sqlite3_mem_methods { **
  • Direct writes to [shadow tables]. ** **
  • +** +** [[SQLITE_DBCONFIG_WRITABLE_SCHEMA]]
    SQLITE_DBCONFIG_WRITABLE_SCHEMA
    +**
    The SQLITE_DBCONFIG_WRITABLE_SCHEMA option activates or deactivates the +** "writable_schema" flag. This has the same effect and is logically equivalent +** to setting [PRAGMA writable_schema=ON] or [PRAGMA writable_schema=OFF]. +** The first argument to this setting is an integer which is 0 to disable +** the writable_schema, positive to enable writable_schema, or negative to +** leave the setting unchanged. The second parameter is a pointer to an +** integer into which is written 0 or 1 to indicate whether the writable_schema +** is enabled or disabled following this call. +**
    ** */ #define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ @@ -3251,7 +3265,8 @@ struct sqlite3_mem_methods { #define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */ #define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */ #define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */ -#define SQLITE_DBCONFIG_MAX 1010 /* Largest DBCONFIG */ +#define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */ +#define SQLITE_DBCONFIG_MAX 1011 /* Largest DBCONFIG */ /* ** CAPI3REF: Enable Or Disable Extended Result Codes @@ -4934,6 +4949,18 @@ SQLITE_API const char *sqlite3_normalized_sql(sqlite3_ SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); /* +** CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement +** METHOD: sqlite3_stmt +** +** ^The sqlite3_stmt_isexplain(S) interface returns 1 if the +** prepared statement S is an EXPLAIN statement, or 2 if the +** statement S is an EXPLAIN QUERY PLAN. +** ^The sqlite3_stmt_isexplain(S) interface returns 0 if S is +** an ordinary statement or a NULL pointer. +*/ +SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt); + +/* ** CAPI3REF: Determine If A Prepared Statement Has Been Reset ** METHOD: sqlite3_stmt ** @@ -5072,7 +5099,9 @@ typedef struct sqlite3_context sqlite3_context; ** ^The fifth argument to the BLOB and string binding interfaces ** is a destructor used to dispose of the BLOB or ** string after SQLite has finished with it. ^The destructor is called -** to dispose of the BLOB or string even if the call to bind API fails. +** to dispose of the BLOB or string even if the call to the bind API fails, +** except the destructor is not called if the third parameter is a NULL +** pointer or the fourth parameter is negative. ** ^If the fifth argument is ** the special value [SQLITE_STATIC], then SQLite assumes that the ** information is in static, unmanaged space and does not need to be freed. @@ -5989,6 +6018,8 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm( ** sqlite3_value_nochange   ** →  True if the column is unchanged in an UPDATE ** against a virtual table. +** sqlite3_value_frombind   +** →  True if value originated from a [bound parameter] ** ** ** Details: @@ -6050,6 +6081,11 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm( ** than within an [xUpdate] method call for an UPDATE statement, then ** the return value is arbitrary and meaningless. ** +** ^The sqlite3_value_frombind(X) interface returns non-zero if the +** value X originated from one of the [sqlite3_bind_int|sqlite3_bind()] +** interfaces. ^If X comes from an SQL literal value, or a table column, +** and expression, then sqlite3_value_frombind(X) returns zero. +** ** Please pay particular attention to the fact that the pointer returned ** from [sqlite3_value_blob()], [sqlite3_value_text()], or ** [sqlite3_value_text16()] can be invalidated by a subsequent call to @@ -6095,6 +6131,7 @@ SQLITE_API int sqlite3_value_bytes16(sqlite3_value*); SQLITE_API int sqlite3_value_type(sqlite3_value*); SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*); SQLITE_API int sqlite3_value_nochange(sqlite3_value*); +SQLITE_API int sqlite3_value_frombind(sqlite3_value*); /* ** CAPI3REF: Finding The Subtype Of SQL Values @@ -6830,7 +6867,7 @@ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); ** associated with database N of connection D. ^The main database file ** has the name "main". If there is no attached database N on the database ** connection D, or if database N is a temporary or in-memory database, then -** a NULL pointer is returned. +** this function will return either a NULL pointer or an empty string. ** ** ^The filename returned by this function is the output of the ** xFullPathname method of the [VFS]. ^In other words, the filename @@ -11931,7 +11968,7 @@ SQLITE_API int sqlite3rebaser_configure( ** in size. This function allocates and populates a buffer with a copy ** of the changeset rebased rebased according to the configuration of the ** rebaser object passed as the first argument. If successful, (*ppOut) -** is set to point to the new buffer containing the rebased changset and +** is set to point to the new buffer containing the rebased changeset and ** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the ** responsibility of the caller to eventually free the new buffer using ** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut) @@ -12340,7 +12377,7 @@ struct Fts5PhraseIter { ** Save the pointer passed as the second argument as the extension functions ** "auxiliary data". The pointer may then be retrieved by the current or any ** future invocation of the same fts5 extension function made as part of -** of the same MATCH query using the xGetAuxdata() API. +** the same MATCH query using the xGetAuxdata() API. ** ** Each extension function is allocated a single auxiliary data slot for ** each FTS query (MATCH expression). If the extension function is invoked @@ -12355,7 +12392,7 @@ struct Fts5PhraseIter { ** The xDelete callback, if one is specified, is also invoked on the ** auxiliary data pointer after the FTS5 query has finished. ** -** If an error (e.g. an OOM condition) occurs within this function, an +** If an error (e.g. an OOM condition) occurs within this function, ** the auxiliary data is set to NULL and an error code returned. If the ** xDelete parameter was not NULL, it is invoked on the auxiliary data ** pointer before returning. @@ -13381,7 +13418,7 @@ struct Hash { unsigned int count; /* Number of entries in this table */ HashElem *first; /* The first element of the array */ struct _ht { /* the hash table */ - int count; /* Number of entries with this hash */ + unsigned int count; /* Number of entries with this hash */ HashElem *chain; /* Pointer to first entry with this hash */ } *ht; }; @@ -13522,100 +13559,95 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*); #define TK_PRECEDING 85 #define TK_RANGE 86 #define TK_UNBOUNDED 87 -#define TK_REINDEX 88 -#define TK_RENAME 89 -#define TK_CTIME_KW 90 -#define TK_ANY 91 -#define TK_BITAND 92 -#define TK_BITOR 93 -#define TK_LSHIFT 94 -#define TK_RSHIFT 95 -#define TK_PLUS 96 -#define TK_MINUS 97 -#define TK_STAR 98 -#define TK_SLASH 99 -#define TK_REM 100 -#define TK_CONCAT 101 -#define TK_COLLATE 102 -#define TK_BITNOT 103 -#define TK_ON 104 -#define TK_INDEXED 105 -#define TK_STRING 106 -#define TK_JOIN_KW 107 -#define TK_CONSTRAINT 108 -#define TK_DEFAULT 109 -#define TK_NULL 110 -#define TK_PRIMARY 111 -#define TK_UNIQUE 112 -#define TK_CHECK 113 -#define TK_REFERENCES 114 -#define TK_AUTOINCR 115 -#define TK_INSERT 116 -#define TK_DELETE 117 -#define TK_UPDATE 118 -#define TK_SET 119 -#define TK_DEFERRABLE 120 -#define TK_FOREIGN 121 -#define TK_DROP 122 -#define TK_UNION 123 -#define TK_ALL 124 -#define TK_EXCEPT 125 -#define TK_INTERSECT 126 -#define TK_SELECT 127 -#define TK_VALUES 128 -#define TK_DISTINCT 129 -#define TK_DOT 130 -#define TK_FROM 131 -#define TK_JOIN 132 -#define TK_USING 133 -#define TK_ORDER 134 -#define TK_GROUP 135 -#define TK_HAVING 136 -#define TK_LIMIT 137 -#define TK_WHERE 138 -#define TK_INTO 139 -#define TK_NOTHING 140 -#define TK_FLOAT 141 -#define TK_BLOB 142 -#define TK_INTEGER 143 -#define TK_VARIABLE 144 -#define TK_CASE 145 -#define TK_WHEN 146 -#define TK_THEN 147 -#define TK_ELSE 148 -#define TK_INDEX 149 -#define TK_ALTER 150 -#define TK_ADD 151 -#define TK_WINDOW 152 -#define TK_OVER 153 -#define TK_FILTER 154 -#define TK_TRUEFALSE 155 -#define TK_ISNOT 156 -#define TK_FUNCTION 157 -#define TK_COLUMN 158 -#define TK_AGG_FUNCTION 159 -#define TK_AGG_COLUMN 160 -#define TK_UMINUS 161 -#define TK_UPLUS 162 -#define TK_TRUTH 163 -#define TK_REGISTER 164 -#define TK_VECTOR 165 -#define TK_SELECT_COLUMN 166 -#define TK_IF_NULL_ROW 167 -#define TK_ASTERISK 168 -#define TK_SPAN 169 -#define TK_END_OF_FILE 170 -#define TK_UNCLOSED_STRING 171 -#define TK_SPACE 172 -#define TK_ILLEGAL 173 +#define TK_EXCLUDE 88 +#define TK_GROUPS 89 +#define TK_OTHERS 90 +#define TK_TIES 91 +#define TK_REINDEX 92 +#define TK_RENAME 93 +#define TK_CTIME_KW 94 +#define TK_ANY 95 +#define TK_BITAND 96 +#define TK_BITOR 97 +#define TK_LSHIFT 98 +#define TK_RSHIFT 99 +#define TK_PLUS 100 +#define TK_MINUS 101 +#define TK_STAR 102 +#define TK_SLASH 103 +#define TK_REM 104 +#define TK_CONCAT 105 +#define TK_COLLATE 106 +#define TK_BITNOT 107 +#define TK_ON 108 +#define TK_INDEXED 109 +#define TK_STRING 110 +#define TK_JOIN_KW 111 +#define TK_CONSTRAINT 112 +#define TK_DEFAULT 113 +#define TK_NULL 114 +#define TK_PRIMARY 115 +#define TK_UNIQUE 116 +#define TK_CHECK 117 +#define TK_REFERENCES 118 +#define TK_AUTOINCR 119 +#define TK_INSERT 120 +#define TK_DELETE 121 +#define TK_UPDATE 122 +#define TK_SET 123 +#define TK_DEFERRABLE 124 +#define TK_FOREIGN 125 +#define TK_DROP 126 +#define TK_UNION 127 +#define TK_ALL 128 +#define TK_EXCEPT 129 +#define TK_INTERSECT 130 +#define TK_SELECT 131 +#define TK_VALUES 132 +#define TK_DISTINCT 133 +#define TK_DOT 134 +#define TK_FROM 135 +#define TK_JOIN 136 +#define TK_USING 137 +#define TK_ORDER 138 +#define TK_GROUP 139 +#define TK_HAVING 140 +#define TK_LIMIT 141 +#define TK_WHERE 142 +#define TK_INTO 143 +#define TK_NOTHING 144 +#define TK_FLOAT 145 +#define TK_BLOB 146 +#define TK_INTEGER 147 +#define TK_VARIABLE 148 +#define TK_CASE 149 +#define TK_WHEN 150 +#define TK_THEN 151 +#define TK_ELSE 152 +#define TK_INDEX 153 +#define TK_ALTER 154 +#define TK_ADD 155 +#define TK_WINDOW 156 +#define TK_OVER 157 +#define TK_FILTER 158 +#define TK_TRUEFALSE 159 +#define TK_ISNOT 160 +#define TK_FUNCTION 161 +#define TK_COLUMN 162 +#define TK_AGG_FUNCTION 163 +#define TK_AGG_COLUMN 164 +#define TK_UMINUS 165 +#define TK_UPLUS 166 +#define TK_TRUTH 167 +#define TK_REGISTER 168 +#define TK_VECTOR 169 +#define TK_SELECT_COLUMN 170 +#define TK_IF_NULL_ROW 171 +#define TK_ASTERISK 172 +#define TK_SPAN 173 +#define TK_SPACE 174 +#define TK_ILLEGAL 175 -/* The token codes above must all fit in 8 bits */ -#define TKFLG_MASK 0xff - -/* Flags that can be added to a token code when it is not -** being stored in a u8: */ -#define TKFLG_DONTFOLD 0x100 /* Omit constant folding optimizations */ - /************** End of parse.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ #include @@ -14546,9 +14578,6 @@ struct BtreePayload { SQLITE_PRIVATE int sqlite3BtreeInsert(BtCursor*, const BtreePayload *pPayload, int flags, int seekResult); SQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor*, int *pRes); -#ifndef SQLITE_OMIT_WINDOWFUNC -SQLITE_PRIVATE void sqlite3BtreeSkipNext(BtCursor*); -#endif SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor*, int *pRes); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 8 16:02:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53CA6158B947; Wed, 8 May 2019 16:02:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC331823E7; Wed, 8 May 2019 16:01:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACD48815F; Wed, 8 May 2019 16:01:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48G1xgl023475; Wed, 8 May 2019 16:01:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48G1x1l023474; Wed, 8 May 2019 16:01:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905081601.x48G1x1l023474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 May 2019 16:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347348 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 347348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC331823E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 16:02:00 -0000 Author: markj Date: Wed May 8 16:01:59 2019 New Revision: 347348 URL: https://svnweb.freebsd.org/changeset/base/347348 Log: MFC r346888: Stop checking TD_IDLETHREAD() in buffer cache routines. Modified: stable/12/sys/kern/vfs_bio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_bio.c ============================================================================== --- stable/12/sys/kern/vfs_bio.c Wed May 8 15:48:55 2019 (r347347) +++ stable/12/sys/kern/vfs_bio.c Wed May 8 16:01:59 2019 (r347348) @@ -2083,8 +2083,11 @@ breada(struct vnode * vp, daddr_t * rablkno, int * rab struct ucred * cred, int flags, void (*ckhashfunc)(struct buf *)) { struct buf *rabp; + struct thread *td; int i; + td = curthread; + for (i = 0; i < cnt; i++, rablkno++, rabsize++) { if (inmem(vp, *rablkno)) continue; @@ -2093,16 +2096,14 @@ breada(struct vnode * vp, daddr_t * rablkno, int * rab brelse(rabp); continue; } - if (!TD_IS_IDLETHREAD(curthread)) { #ifdef RACCT - if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, rabp, 0); - PROC_UNLOCK(curproc); - } -#endif /* RACCT */ - curthread->td_ru.ru_inblock++; + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_buf(curproc, rabp, 0); + PROC_UNLOCK(curproc); } +#endif /* RACCT */ + td->td_ru.ru_inblock++; rabp->b_flags |= B_ASYNC; rabp->b_flags &= ~B_INVAL; if ((flags & GB_CKHASH) != 0) { @@ -2158,16 +2159,14 @@ breadn_flags(struct vnode *vp, daddr_t blkno, int size */ readwait = 0; if ((bp->b_flags & B_CACHE) == 0) { - if (!TD_IS_IDLETHREAD(td)) { #ifdef RACCT - if (racct_enable) { - PROC_LOCK(td->td_proc); - racct_add_buf(td->td_proc, bp, 0); - PROC_UNLOCK(td->td_proc); - } -#endif /* RACCT */ - td->td_ru.ru_inblock++; + if (racct_enable) { + PROC_LOCK(td->td_proc); + racct_add_buf(td->td_proc, bp, 0); + PROC_UNLOCK(td->td_proc); } +#endif /* RACCT */ + td->td_ru.ru_inblock++; bp->b_iocmd = BIO_READ; bp->b_flags &= ~B_INVAL; if ((flags & GB_CKHASH) != 0) { @@ -2268,16 +2267,14 @@ bufwrite(struct buf *bp) bp->b_runningbufspace = bp->b_bufsize; space = atomic_fetchadd_long(&runningbufspace, bp->b_runningbufspace); - if (!TD_IS_IDLETHREAD(curthread)) { #ifdef RACCT - if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, bp, 1); - PROC_UNLOCK(curproc); - } -#endif /* RACCT */ - curthread->td_ru.ru_oublock++; + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_buf(curproc, bp, 1); + PROC_UNLOCK(curproc); } +#endif /* RACCT */ + curthread->td_ru.ru_oublock++; if (oldflags & B_ASYNC) BUF_KERNPROC(bp); bp->b_iooffset = dbtob(bp->b_blkno); @@ -4029,9 +4026,6 @@ loop: */ if (flags & GB_NOCREAT) return (EEXIST); - if (bdomain[bo->bo_domain].bd_freebuffers == 0 && - TD_IS_IDLETHREAD(curthread)) - return (EBUSY); bsize = vn_isdisk(vp, NULL) ? DEV_BSIZE : bo->bo_bsize; KASSERT(bsize != 0, ("bsize == 0, check bo->bo_bsize")); From owner-svn-src-all@freebsd.org Wed May 8 16:04:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24C8A158BA0C; Wed, 8 May 2019 16:04:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF46F82702; Wed, 8 May 2019 16:04:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB1458189; Wed, 8 May 2019 16:04:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48G4Xop024404; Wed, 8 May 2019 16:04:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48G4X4x024403; Wed, 8 May 2019 16:04:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905081604.x48G4X4x024403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 May 2019 16:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347349 - stable/12/usr.sbin/rtadvd X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/rtadvd X-SVN-Commit-Revision: 347349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF46F82702 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 16:04:34 -0000 Author: markj Date: Wed May 8 16:04:33 2019 New Revision: 347349 URL: https://svnweb.freebsd.org/changeset/base/347349 Log: MFC r346960: Retry upon NET_RT_IFLIST sysctl failure. PR: 195191 Modified: stable/12/usr.sbin/rtadvd/if.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/rtadvd/if.c ============================================================================== --- stable/12/usr.sbin/rtadvd/if.c Wed May 8 16:01:59 2019 (r347348) +++ stable/12/usr.sbin/rtadvd/if.c Wed May 8 16:04:33 2019 (r347349) @@ -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, &len, 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, &len, 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, &len, 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, &len, 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; From owner-svn-src-all@freebsd.org Wed May 8 16:05:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF162158BAA6; Wed, 8 May 2019 16:05:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86D9C82941; Wed, 8 May 2019 16:05:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58C1F818C; Wed, 8 May 2019 16:05:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48G5JRV024633; Wed, 8 May 2019 16:05:19 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48G5JdC024632; Wed, 8 May 2019 16:05:19 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905081605.x48G5JdC024632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 8 May 2019 16:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347350 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 347350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 86D9C82941 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 16:05:20 -0000 Author: jhibbits Date: Wed May 8 16:05:18 2019 New Revision: 347350 URL: https://svnweb.freebsd.org/changeset/base/347350 Log: powerpc/booke: Do as much work outside of TLB locks as possible Reduce the surface area of the TLB locks. Unfortunately the same trick for serializing the tlbie instruction on OEA64 cannot be used here to reduce the scope of the tlbivax mutex to the tlbsync only, as the mutex also serializes the TLB miss lock as a side effect, so contention on this lock may not be reducible any further. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed May 8 16:04:33 2019 (r347349) +++ head/sys/powerpc/booke/pmap.c Wed May 8 16:05:18 2019 (r347350) @@ -1382,7 +1382,7 @@ pte_enter(mmu_t mmu, pmap_t pmap, vm_page_t m, vm_offs unsigned int pp2d_idx = PP2D_IDX(va); unsigned int pdir_idx = PDIR_IDX(va); unsigned int ptbl_idx = PTBL_IDX(va); - pte_t *ptbl, *pte; + pte_t *ptbl, *pte, pte_tmp; pte_t **pdir; /* Get the page directory pointer. */ @@ -1400,12 +1400,13 @@ pte_enter(mmu_t mmu, pmap_t pmap, vm_page_t m, vm_offs KASSERT(nosleep, ("nosleep and NULL ptbl")); return (ENOMEM); } + pte = &ptbl[ptbl_idx]; } else { /* * Check if there is valid mapping for requested va, if there * is, remove it. */ - pte = &pdir[pdir_idx][ptbl_idx]; + pte = &ptbl[ptbl_idx]; if (PTE_ISVALID(pte)) { pte_remove(mmu, pmap, va, PTBL_HOLD); } else { @@ -1437,14 +1438,16 @@ pte_enter(mmu_t mmu, pmap_t pmap, vm_page_t m, vm_offs pv_insert(pmap, va, m); } + pmap->pm_stats.resident_count++; + + pte_tmp = PTE_RPN_FROM_PA(VM_PAGE_TO_PHYS(m)); + pte_tmp |= (PTE_VALID | flags); + mtx_lock_spin(&tlbivax_mutex); tlb_miss_lock(); tlb0_flush_entry(va); - pmap->pm_stats.resident_count++; - pte = &pdir[pdir_idx][ptbl_idx]; - *pte = PTE_RPN_FROM_PA(VM_PAGE_TO_PHYS(m)); - *pte |= (PTE_VALID | flags); + *pte = pte_tmp; tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); @@ -1583,7 +1586,7 @@ pte_enter(mmu_t mmu, pmap_t pmap, vm_page_t m, vm_offs { unsigned int pdir_idx = PDIR_IDX(va); unsigned int ptbl_idx = PTBL_IDX(va); - pte_t *ptbl, *pte; + pte_t *ptbl, *pte, pte_tmp; CTR4(KTR_PMAP, "%s: su = %d pmap = %p va = %p", __func__, pmap == kernel_pmap, pmap, va); @@ -1598,6 +1601,8 @@ pte_enter(mmu_t mmu, pmap_t pmap, vm_page_t m, vm_offs KASSERT(nosleep, ("nosleep and NULL ptbl")); return (ENOMEM); } + pmap->pm_pdir[pdir_idx] = ptbl; + pte = &ptbl[ptbl_idx]; } else { /* * Check if there is valid mapping for requested @@ -1629,20 +1634,14 @@ pte_enter(mmu_t mmu, pmap_t pmap, vm_page_t m, vm_offs pmap->pm_stats.resident_count++; + pte_tmp = PTE_RPN_FROM_PA(VM_PAGE_TO_PHYS(m)); + pte_tmp |= (PTE_VALID | flags | PTE_PS_4KB); /* 4KB pages only */ + mtx_lock_spin(&tlbivax_mutex); tlb_miss_lock(); tlb0_flush_entry(va); - if (pmap->pm_pdir[pdir_idx] == NULL) { - /* - * If we just allocated a new page table, hook it in - * the pdir. - */ - pmap->pm_pdir[pdir_idx] = ptbl; - } - pte = &(pmap->pm_pdir[pdir_idx][ptbl_idx]); - *pte = PTE_RPN_FROM_PA(VM_PAGE_TO_PHYS(m)); - *pte |= (PTE_VALID | flags | PTE_PS_4KB); /* 4KB pages only */ + *pte = pte_tmp; tlb_miss_unlock(); mtx_unlock_spin(&tlbivax_mutex); From owner-svn-src-all@freebsd.org Wed May 8 16:06:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52991158BC80; Wed, 8 May 2019 16:06:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB04882C1A; Wed, 8 May 2019 16:06:54 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C43D48195; Wed, 8 May 2019 16:06:54 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48G6sK0025982; Wed, 8 May 2019 16:06:54 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48G6su7025981; Wed, 8 May 2019 16:06:54 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905081606.x48G6su7025981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 8 May 2019 16:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347351 - in head/sys: conf riscv/conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf riscv/conf X-SVN-Commit-Revision: 347351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB04882C1A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 16:06:55 -0000 Author: br Date: Wed May 8 16:06:54 2019 New Revision: 347351 URL: https://svnweb.freebsd.org/changeset/base/347351 Log: Connect Xilinx AXI drivers and Cadence Ethernet MAC to the RISC-V build. Sponsored by: DARPA, AFRL Modified: head/sys/conf/files.riscv head/sys/riscv/conf/GENERIC Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Wed May 8 16:05:18 2019 (r347350) +++ head/sys/conf/files.riscv Wed May 8 16:06:54 2019 (r347351) @@ -5,10 +5,13 @@ cddl/dev/dtrace/riscv/dtrace_subr.c optional dtrace cddl/dev/fbt/riscv/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb +dev/cadence/if_cgem.c optional cgem dev/ofw/ofw_cpu.c optional fdt dev/uart/uart_cpu_fdt.c optional uart fdt dev/uart/uart_dev_lowrisc.c optional uart_lowrisc dev/xilinx/axi_quad_spi.c optional xilinx_spi +dev/xilinx/axidma.c optional axidma xdma +dev/xilinx/if_xae.c optional xae kern/kern_clocksource.c standard kern/msi_if.m standard kern/pic_if.m standard Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Wed May 8 16:05:18 2019 (r347350) +++ head/sys/riscv/conf/GENERIC Wed May 8 16:06:54 2019 (r347351) @@ -102,6 +102,16 @@ device uart # Generic UART driver device uart_lowrisc # lowRISC UART driver device uart_ns8250 # ns8250-type UART driver + +# Ethernet drivers +device miibus # MII bus support +device cgem # Cadence Gigabit Ethernet MAC +device xae # Xilinx AXI Ethernet MAC + +# DMA support +device xdma # DMA interface +device axidma # Xilinx AXI DMA Controller + # Uncomment for memory disk # options MD_ROOT # options MD_ROOT_SIZE=32768 # 32MB ram disk From owner-svn-src-all@freebsd.org Wed May 8 16:07:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEC94158BCE4; Wed, 8 May 2019 16:07:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EDA682CCC; Wed, 8 May 2019 16:07:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F85E8196; Wed, 8 May 2019 16:07:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48G72R9026036; Wed, 8 May 2019 16:07:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48G722G026035; Wed, 8 May 2019 16:07:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905081607.x48G722G026035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 May 2019 16:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347352 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 347352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7EDA682CCC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 16:07:05 -0000 Author: kib Date: Wed May 8 16:07:01 2019 New Revision: 347352 URL: https://svnweb.freebsd.org/changeset/base/347352 Log: MFC r346990: Fix another race between vm_map_protect() and vm_map_wire(). Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Wed May 8 16:06:54 2019 (r347351) +++ stable/11/sys/vm/vm_map.c Wed May 8 16:07:01 2019 (r347352) @@ -2003,7 +2003,7 @@ int vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end, vm_prot_t new_prot, boolean_t set_max) { - vm_map_entry_t current, entry; + vm_map_entry_t current, entry, in_tran; vm_object_t obj; struct ucred *cred; vm_prot_t old_prot; @@ -2011,6 +2011,8 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off if (start == end) return (KERN_SUCCESS); +again: + in_tran = NULL; vm_map_lock(map); /* @@ -2043,6 +2045,22 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off vm_map_unlock(map); return (KERN_PROTECTION_FAILURE); } + if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0) + in_tran = entry; + } + + /* + * Postpone the operation until all in transition map entries + * are stabilized. In-transition entry might already have its + * pages wired and wired_count incremented, but + * MAP_ENTRY_USER_WIRED flag not yet set, and visible to other + * threads because the map lock is dropped. In this case we + * would miss our call to vm_fault_copy_entry(). + */ + if (in_tran != NULL) { + in_tran->eflags |= MAP_ENTRY_NEEDS_WAKEUP; + vm_map_unlock_and_wait(map, 0); + goto again; } /* From owner-svn-src-all@freebsd.org Wed May 8 16:07:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B9EB158BD8B; Wed, 8 May 2019 16:07:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D476782ECA; Wed, 8 May 2019 16:07:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2C078197; Wed, 8 May 2019 16:07:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48G7hIj026118; Wed, 8 May 2019 16:07:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48G7hTZ026117; Wed, 8 May 2019 16:07:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905081607.x48G7hTZ026117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 May 2019 16:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347353 - stable/11/usr.sbin/rtadvd X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/usr.sbin/rtadvd X-SVN-Commit-Revision: 347353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D476782ECA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 16:07:44 -0000 Author: markj Date: Wed May 8 16:07:43 2019 New Revision: 347353 URL: https://svnweb.freebsd.org/changeset/base/347353 Log: MFC r346960: Retry upon NET_RT_IFLIST sysctl failure. PR: 195191 Modified: stable/11/usr.sbin/rtadvd/if.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/rtadvd/if.c ============================================================================== --- stable/11/usr.sbin/rtadvd/if.c Wed May 8 16:07:01 2019 (r347352) +++ stable/11/usr.sbin/rtadvd/if.c Wed May 8 16:07:43 2019 (r347353) @@ -406,6 +406,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) { @@ -417,26 +419,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, &len, 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, &len, 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, &len, 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, &len, 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; From owner-svn-src-all@freebsd.org Wed May 8 16:15:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FFA2158C2FE; Wed, 8 May 2019 16:15:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 274B1836A3; Wed, 8 May 2019 16:15:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3E98833F; Wed, 8 May 2019 16:15:28 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48GFSnS031290; Wed, 8 May 2019 16:15:28 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48GFScU031289; Wed, 8 May 2019 16:15:28 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905081615.x48GFScU031289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 8 May 2019 16:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347354 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 347354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 274B1836A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 16:15:29 -0000 Author: jhibbits Date: Wed May 8 16:15:28 2019 New Revision: 347354 URL: https://svnweb.freebsd.org/changeset/base/347354 Log: powerpc/booke: Rewrite pmap_sync_icache() a bit * Make mmu_booke_sync_icache() use the DMAP on 64-bit prcoesses, no need to map the page into the user's address space. This removes the pvh_global_lock from the equation on 64-bit. * Don't map the page with user-readability on 32-bit. I don't know what the chance of a given user process being able to access the NULL page when another process's page is added there, but it doesn't seem like a good idea to map it to NULL with user read permissions. * Only sync as much as we need to. There are only two significant places where pmap_sync_icache is used: proc_rwmem(), and the SIGILL second-chance for powerpc. The SIGILL second chance is likely the most common, and only syncs 4 bytes, so avoid the other 127 loop iterations (4096 / 32 byte cacheline) in __syncicache(). Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed May 8 16:07:43 2019 (r347353) +++ head/sys/powerpc/booke/pmap.c Wed May 8 16:15:28 2019 (r347354) @@ -2871,18 +2871,20 @@ static void mmu_booke_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz) { pte_t *pte; + vm_paddr_t pa = 0; + int sync_sz, valid; +#ifndef __powerpc64__ pmap_t pmap; vm_page_t m; vm_offset_t addr; - vm_paddr_t pa = 0; - int active, valid; + int active; +#endif - va = trunc_page(va); - sz = round_page(sz); - +#ifndef __powerpc64__ rw_wlock(&pvh_global_lock); pmap = PCPU_GET(curpmap); active = (pm == kernel_pmap || pm == pmap) ? 1 : 0; +#endif while (sz > 0) { PMAP_LOCK(pm); pte = pte_find(mmu, pm, va); @@ -2890,24 +2892,34 @@ mmu_booke_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_ if (valid) pa = PTE_PA(pte); PMAP_UNLOCK(pm); + sync_sz = PAGE_SIZE - (va & PAGE_MASK); + sync_sz = min(sync_sz, sz); if (valid) { +#ifdef __powerpc64__ + pa += (va & PAGE_MASK); + __syncicache((void *)PHYS_TO_DMAP(pa), sync_sz); +#else if (!active) { /* Create a mapping in the active pmap. */ addr = 0; m = PHYS_TO_VM_PAGE(pa); PMAP_LOCK(pmap); pte_enter(mmu, pmap, m, addr, - PTE_SR | PTE_VALID | PTE_UR, FALSE); - __syncicache((void *)addr, PAGE_SIZE); + PTE_SR | PTE_VALID, FALSE); + addr += (va & PAGE_MASK); + __syncicache((void *)addr, sync_sz); pte_remove(mmu, pmap, addr, PTBL_UNHOLD); PMAP_UNLOCK(pmap); } else - __syncicache((void *)va, PAGE_SIZE); + __syncicache((void *)va, sync_sz); +#endif } - va += PAGE_SIZE; - sz -= PAGE_SIZE; + va += sync_sz; + sz -= sync_sz; } +#ifndef __powerpc64__ rw_wunlock(&pvh_global_lock); +#endif } /* From owner-svn-src-all@freebsd.org Wed May 8 16:30:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C88EA158CB37; Wed, 8 May 2019 16:30:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D78C84215; Wed, 8 May 2019 16:30:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E2178510; Wed, 8 May 2019 16:30:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48GUdHf037279; Wed, 8 May 2019 16:30:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48GUcv0037275; Wed, 8 May 2019 16:30:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905081630.x48GUcv0037275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 8 May 2019 16:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347355 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 347355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D78C84215 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 16:30:40 -0000 Author: mjg Date: Wed May 8 16:30:38 2019 New Revision: 347355 URL: https://svnweb.freebsd.org/changeset/base/347355 Log: Reduce umtx-related work on exec and exit - there is no need to take the process lock to iterate the thread list after single-threading is enforced - typically there are no mutexes to clean up (testable without taking the global umtx lock) - typically there is no need to adjust the priority (testable without taking thread lock) Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20160 Modified: head/sys/kern/kern_umtx.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/sys/sched.h Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Wed May 8 16:15:28 2019 (r347354) +++ head/sys/kern/kern_umtx.c Wed May 8 16:30:38 2019 (r347355) @@ -4411,20 +4411,20 @@ umtx_exec_hook(void *arg __unused, struct proc *p, struct thread *td; KASSERT(p == curproc, ("need curproc")); - PROC_LOCK(p); KASSERT((p->p_flag & P_HADTHREADS) == 0 || (p->p_flag & P_STOPPED_SINGLE) != 0, ("curproc must be single-threaded")); + /* + * There is no need to lock the list as only this thread can be + * running. + */ FOREACH_THREAD_IN_PROC(p, td) { KASSERT(td == curthread || ((td->td_flags & TDF_BOUNDARY) != 0 && TD_IS_SUSPENDED(td)), ("running thread %p %p", p, td)); - PROC_UNLOCK(p); umtx_thread_cleanup(td); - PROC_LOCK(p); td->td_rb_list = td->td_rbp_list = td->td_rb_inact = 0; } - PROC_UNLOCK(p); } /* @@ -4541,17 +4541,21 @@ umtx_thread_cleanup(struct thread *td) */ uq = td->td_umtxq; if (uq != NULL) { - mtx_lock(&umtx_lock); - uq->uq_inherited_pri = PRI_MAX; - while ((pi = TAILQ_FIRST(&uq->uq_pi_contested)) != NULL) { - pi->pi_owner = NULL; - TAILQ_REMOVE(&uq->uq_pi_contested, pi, pi_link); + if (uq->uq_inherited_pri != PRI_MAX || + !TAILQ_EMPTY(&uq->uq_pi_contested)) { + mtx_lock(&umtx_lock); + uq->uq_inherited_pri = PRI_MAX; + while ((pi = TAILQ_FIRST(&uq->uq_pi_contested)) != NULL) { + pi->pi_owner = NULL; + TAILQ_REMOVE(&uq->uq_pi_contested, pi, pi_link); + } + mtx_unlock(&umtx_lock); } - mtx_unlock(&umtx_lock); - thread_lock(td); - sched_lend_user_prio(td, PRI_MAX); - thread_unlock(td); + sched_lend_user_prio_cond(td, PRI_MAX); } + + if (td->td_rb_inact == 0 && td->td_rb_list == 0 && td->td_rbp_list == 0) + return; /* * Handle terminated robust mutexes. Must be done after Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Wed May 8 16:15:28 2019 (r347354) +++ head/sys/kern/sched_4bsd.c Wed May 8 16:30:38 2019 (r347355) @@ -930,6 +930,27 @@ sched_lend_user_prio(struct thread *td, u_char prio) td->td_flags |= TDF_NEEDRESCHED; } +/* + * Like the above but first check if there is anything to do. + */ +void +sched_lend_user_prio_cond(struct thread *td, u_char prio) +{ + + if (td->td_lend_user_pri != prio) + goto lend; + if (td->td_user_pri != min(prio, td->td_base_user_pri)) + goto lend; + if (td->td_priority >= td->td_user_pri) + goto lend; + return; + +lend: + thread_lock(td); + sched_lend_user_prio(td, prio); + thread_unlock(td); +} + void sched_sleep(struct thread *td, int pri) { Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed May 8 16:15:28 2019 (r347354) +++ head/sys/kern/sched_ule.c Wed May 8 16:30:38 2019 (r347355) @@ -1861,6 +1861,27 @@ sched_lend_user_prio(struct thread *td, u_char prio) td->td_flags |= TDF_NEEDRESCHED; } +/* + * Like the above but first check if there is anything to do. + */ +void +sched_lend_user_prio_cond(struct thread *td, u_char prio) +{ + + if (td->td_lend_user_pri != prio) + goto lend; + if (td->td_user_pri != min(prio, td->td_base_user_pri)) + goto lend; + if (td->td_priority >= td->td_user_pri) + goto lend; + return; + +lend: + thread_lock(td); + sched_lend_user_prio(td, prio); + thread_unlock(td); +} + #ifdef SMP /* * This tdq is about to idle. Try to steal a thread from another CPU before Modified: head/sys/sys/sched.h ============================================================================== --- head/sys/sys/sched.h Wed May 8 16:15:28 2019 (r347354) +++ head/sys/sys/sched.h Wed May 8 16:30:38 2019 (r347355) @@ -96,6 +96,7 @@ u_int sched_estcpu(struct thread *td); void sched_fork_thread(struct thread *td, struct thread *child); void sched_lend_prio(struct thread *td, u_char prio); void sched_lend_user_prio(struct thread *td, u_char pri); +void sched_lend_user_prio_cond(struct thread *td, u_char pri); fixpt_t sched_pctcpu(struct thread *td); void sched_prio(struct thread *td, u_char prio); void sched_sleep(struct thread *td, int prio); From owner-svn-src-all@freebsd.org Wed May 8 17:47:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6196C158F0D4; Wed, 8 May 2019 17:47:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C94AE86F15; Wed, 8 May 2019 17:46:59 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E7FD9279; Wed, 8 May 2019 17:46:59 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48HkxDw079607; Wed, 8 May 2019 17:46:59 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Hkxsl079606; Wed, 8 May 2019 17:46:59 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905081746.x48Hkxsl079606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 May 2019 17:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347356 - head/etc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 347356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C94AE86F15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 17:47:00 -0000 Author: manu Date: Wed May 8 17:46:59 2019 New Revision: 347356 URL: https://svnweb.freebsd.org/changeset/base/347356 Log: pkgbase: Deal with the last etc files Add tags=package=runtime for password related files. Add tags=package=sendmail for rc.sendmail Add tags=package=ipfw for rc.firewall Reviewed by: bapt MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20173 Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed May 8 16:30:38 2019 (r347355) +++ head/etc/Makefile Wed May 8 17:46:59 2019 (r347356) @@ -18,15 +18,10 @@ BIN1= \ group \ login.access \ rc.bsdextended \ - rc.firewall \ termcap.small # NB: keep these sorted by MK_* knobs -.if ${MK_SENDMAIL} != "no" -BIN1+= rc.sendmail -.endif - .if ${MK_SENDMAIL} == "no" ETCMAIL=mailer.conf aliases .else @@ -63,10 +58,20 @@ distribution: @echo "set DESTDIR before running \"make ${.TARGET}\"" @false .endif +.if ${MK_SENDMAIL} != "no" cd ${.CURDIR}; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 -T "tags=package=sendmail"\ + rc.sendmail ${DESTDIR}/etc; +.endif +.if ${MK_IPFW} != "no" + cd ${.CURDIR}; \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 -T "tags=package=ipfw"\ + rc.firewall ${DESTDIR}/etc; +.endif + cd ${.CURDIR}; \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 -T "tags=package=runtime"\ ${BIN1} ${DESTDIR}/etc; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 -T "tags=package=runtime"\ master.passwd ${DESTDIR}/etc; .if ${MK_TCSH} == "no" @@ -78,6 +83,7 @@ distribution: echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \ echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ + ) | ${METALOG.add} .endif ${_+_}cd ${.CURDIR}/gss; ${MAKE} install From owner-svn-src-all@freebsd.org Wed May 8 18:10:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48C8A158F6A1; Wed, 8 May 2019 18:10:20 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFB4A8789D; Wed, 8 May 2019 18:10:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0AB195CE; Wed, 8 May 2019 18:10:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48IAJJ8090128; Wed, 8 May 2019 18:10:19 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48IAJws090127; Wed, 8 May 2019 18:10:19 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201905081810.x48IAJws090127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 8 May 2019 18:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347357 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 347357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DFB4A8789D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 18:10:20 -0000 Author: mmacy Date: Wed May 8 18:10:19 2019 New Revision: 347357 URL: https://svnweb.freebsd.org/changeset/base/347357 Log: Enable sys/disk.h consumers to avoid pulling in networking headers. The networking headers break ZoF. Modified: head/sys/sys/disk.h Modified: head/sys/sys/disk.h ============================================================================== --- head/sys/sys/disk.h Wed May 8 17:46:59 2019 (r347356) +++ head/sys/sys/disk.h Wed May 8 18:10:19 2019 (r347357) @@ -21,9 +21,6 @@ #include #include -#include -#include - #ifdef _KERNEL #ifndef _SYS_CONF_H_ @@ -158,6 +155,10 @@ struct diocskerneldump_arg_freebsd12 { #define DIOCSKERNELDUMP_FREEBSD12 \ _IOW('d', 144, struct diocskerneldump_arg_freebsd12) +#ifndef WITHOUT_NETDUMP +#include +#include + union kd_ip { struct in_addr in4; struct in6_addr in6; @@ -208,5 +209,6 @@ _Static_assert(__offsetof(struct diocskerneldump_arg, /* * Get current kernel netdump configuration details for a given index. */ +#endif #endif /* _SYS_DISK_H_ */ From owner-svn-src-all@freebsd.org Wed May 8 18:33:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7724B159057A; Wed, 8 May 2019 18:33:07 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A39788D7A; Wed, 8 May 2019 18:33:06 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-ed1-f66.google.com with SMTP id e56so22958668ede.7; Wed, 08 May 2019 11:33:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qLaeN4i0mQ/b9u6ZkXK+V6iAppCPXbBVZx0QmnVba14=; b=sZf+e6BpJfszuLFs3JKzCZdjFyN1Oe3TuOSR+jO8IcRA5qBiWh0hRWk/RVeGnrN6DJ kbtNGUE31DIrTHWzbxXxjT/MACE3HUgMJm1C3b2H+9kwAKWLzJo53dLowzODbH3naXJi dSn0uX5Dq4mcEr5Tymn0MOO1iCV1CJ+IahnEy5prVSts2bZrKs8vZtjiDSub+L24vY+F O97wyEMtKba2PTREBT6EO+qTkD7MbmGzlfThaKt7kMAyZkta5B4Ujp8cIIVBXSm+r/7V MTm5sUPZegWyyHydkjNrIBmAA+MeIvXpgCYmKir7sD6nrF9blae+AFeOrhacbi0gEANV 6O0A== X-Gm-Message-State: APjAAAVxeMwRuxpCRJQQVJhAKK4n+5VRISv2YYdpP5xnTNHzgKHMAZ1j Lt0OuD1FzDTUxbvU1Fz6fky8BX0pzp+be3j60lU= X-Google-Smtp-Source: APXvYqwR0lmW3BZ5OyDC6ASyaTQ++rv/srt1Wh67YL7r3RgvwSigBv8oK/Fi4zB/+hPJY8CwsIFW+Pg5sp2Jfj+oDCE= X-Received: by 2002:a17:906:1146:: with SMTP id i6mr30288440eja.21.1557340385576; Wed, 08 May 2019 11:33:05 -0700 (PDT) MIME-Version: 1.0 References: <201905081517.x48FHaeV096921@repo.freebsd.org> In-Reply-To: From: Antoine Brodin Date: Wed, 8 May 2019 20:32:54 +0200 Message-ID: Subject: Re: svn commit: r347334 - head To: Enji Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 0A39788D7A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 18:33:07 -0000 On Wed, May 8, 2019 at 5:21 PM Enji Cooper wrote: > > On May 8, 2019, at 08:17, Antoine Brodin wrote: > > > > Author: antoine > > Date: Wed May 8 15:17:36 2019 > > New Revision: 347334 > > URL: https://svnweb.freebsd.org/changeset/base/347334 > > > > Log: > > Add wc(1) to native-xtools so that it can be used in qemu-user jails > > > > Modified: > > head/Makefile.inc1 > > Hi Antoine, > Quick question: doesn=E2=80=99t wc(1) require libxo in order to funct= ion today? Was that expressed in the dependencies? Hi, native-xtools builds almost all libraries (including libxo). Antoine From owner-svn-src-all@freebsd.org Wed May 8 18:46:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B16E159094C; Wed, 8 May 2019 18:46:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B48089449; Wed, 8 May 2019 18:46:14 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71C9C9C71; Wed, 8 May 2019 18:46:14 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48IkEWd012184; Wed, 8 May 2019 18:46:14 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48IkCCp012175; Wed, 8 May 2019 18:46:12 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201905081846.x48IkCCp012175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 8 May 2019 18:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347359 - head/contrib/libxo/tests/core/saved X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/libxo/tests/core/saved X-SVN-Commit-Revision: 347359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B48089449 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 18:46:15 -0000 Author: lwhsu Date: Wed May 8 18:46:12 2019 New Revision: 347359 URL: https://svnweb.freebsd.org/changeset/base/347359 Log: Fix expected output after r347207 While phil is working on fixing in libxo general test parts, updating these files to stop the test failure warnings Approved by: phil MFC with: r347207 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20188 Modified: head/contrib/libxo/tests/core/saved/test_02.E.err head/contrib/libxo/tests/core/saved/test_02.H.err head/contrib/libxo/tests/core/saved/test_02.HIPx.err head/contrib/libxo/tests/core/saved/test_02.HP.err head/contrib/libxo/tests/core/saved/test_02.J.err head/contrib/libxo/tests/core/saved/test_02.JP.err head/contrib/libxo/tests/core/saved/test_02.T.err head/contrib/libxo/tests/core/saved/test_02.X.err head/contrib/libxo/tests/core/saved/test_02.XP.err Modified: head/contrib/libxo/tests/core/saved/test_02.E.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.E.err Wed May 8 18:12:38 2019 (r347358) +++ head/contrib/libxo/tests/core/saved/test_02.E.err Wed May 8 18:46:12 2019 (r347359) @@ -1 +1 @@ -test_02.test: key field emitted after normal value field: 'name' +test_02: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.H.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.H.err Wed May 8 18:12:38 2019 (r347358) +++ head/contrib/libxo/tests/core/saved/test_02.H.err Wed May 8 18:46:12 2019 (r347359) @@ -1 +1 @@ -test_02.test: key field emitted after normal value field: 'name' +test_02: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.HIPx.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.HIPx.err Wed May 8 18:12:38 2019 (r347358) +++ head/contrib/libxo/tests/core/saved/test_02.HIPx.err Wed May 8 18:46:12 2019 (r347359) @@ -1 +1 @@ -test_02.test: key field emitted after normal value field: 'name' +test_02: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.HP.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.HP.err Wed May 8 18:12:38 2019 (r347358) +++ head/contrib/libxo/tests/core/saved/test_02.HP.err Wed May 8 18:46:12 2019 (r347359) @@ -1 +1 @@ -test_02.test: key field emitted after normal value field: 'name' +test_02: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.J.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.J.err Wed May 8 18:12:38 2019 (r347358) +++ head/contrib/libxo/tests/core/saved/test_02.J.err Wed May 8 18:46:12 2019 (r347359) @@ -1 +1 @@ -test_02.test: key field emitted after normal value field: 'name' +test_02: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.JP.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.JP.err Wed May 8 18:12:38 2019 (r347358) +++ head/contrib/libxo/tests/core/saved/test_02.JP.err Wed May 8 18:46:12 2019 (r347359) @@ -1 +1 @@ -test_02.test: key field emitted after normal value field: 'name' +test_02: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.T.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.T.err Wed May 8 18:12:38 2019 (r347358) +++ head/contrib/libxo/tests/core/saved/test_02.T.err Wed May 8 18:46:12 2019 (r347359) @@ -1,2 +1,2 @@ -test_02.test: key field emitted after normal value field: 'name' +test_02: key field emitted after normal value field: 'name' Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> Modified: head/contrib/libxo/tests/core/saved/test_02.X.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.X.err Wed May 8 18:12:38 2019 (r347358) +++ head/contrib/libxo/tests/core/saved/test_02.X.err Wed May 8 18:46:12 2019 (r347359) @@ -1 +1 @@ -test_02.test: key field emitted after normal value field: 'name' +test_02: key field emitted after normal value field: 'name' Modified: head/contrib/libxo/tests/core/saved/test_02.XP.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.XP.err Wed May 8 18:12:38 2019 (r347358) +++ head/contrib/libxo/tests/core/saved/test_02.XP.err Wed May 8 18:46:12 2019 (r347359) @@ -1 +1 @@ -test_02.test: key field emitted after normal value field: 'name' +test_02: key field emitted after normal value field: 'name' From owner-svn-src-all@freebsd.org Wed May 8 18:47:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D450015909AA; Wed, 8 May 2019 18:47:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A90B8959A; Wed, 8 May 2019 18:47:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53F229C74; Wed, 8 May 2019 18:47:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48Il1bE012266; Wed, 8 May 2019 18:47:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48Il1fW012265; Wed, 8 May 2019 18:47:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905081847.x48Il1fW012265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 8 May 2019 18:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347360 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 347360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7A90B8959A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 18:47:02 -0000 Author: trasz Date: Wed May 8 18:47:00 2019 New Revision: 347360 URL: https://svnweb.freebsd.org/changeset/base/347360 Log: Mark inline functions with __unused; prevents compiler warning when they end up being unused. Reviewed by: kib Obtained from: OpenBSD MFC after: 2 weeks Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D20185 Modified: head/sys/sys/tree.h Modified: head/sys/sys/tree.h ============================================================================== --- head/sys/sys/tree.h Wed May 8 18:46:12 2019 (r347359) +++ head/sys/sys/tree.h Wed May 8 18:47:00 2019 (r347360) @@ -125,7 +125,7 @@ struct type *name##_SPLAY_INSERT(struct name *, struct struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \ \ /* Finds the node with the same key as elm */ \ -static __inline struct type * \ +static __unused __inline struct type * \ name##_SPLAY_FIND(struct name *head, struct type *elm) \ { \ if (SPLAY_EMPTY(head)) \ @@ -136,7 +136,7 @@ name##_SPLAY_FIND(struct name *head, struct type *elm) return (NULL); \ } \ \ -static __inline struct type * \ +static __unused __inline struct type * \ name##_SPLAY_NEXT(struct name *head, struct type *elm) \ { \ name##_SPLAY(head, elm); \ @@ -150,7 +150,7 @@ name##_SPLAY_NEXT(struct name *head, struct type *elm) return (elm); \ } \ \ -static __inline struct type * \ +static __unused __inline struct type * \ name##_SPLAY_MIN_MAX(struct name *head, int val) \ { \ name##_SPLAY_MINMAX(head, val); \ From owner-svn-src-all@freebsd.org Wed May 8 18:50:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 432911590A7B; Wed, 8 May 2019 18:50:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA90989736; Wed, 8 May 2019 18:49:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB6BC9C79; Wed, 8 May 2019 18:49:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48InxSi012461; Wed, 8 May 2019 18:49:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48InxfL012460; Wed, 8 May 2019 18:49:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905081849.x48InxfL012460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 8 May 2019 18:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347361 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 347361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA90989736 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 18:50:00 -0000 Author: trasz Date: Wed May 8 18:49:59 2019 New Revision: 347361 URL: https://svnweb.freebsd.org/changeset/base/347361 Log: Add usage example to tree(3). Obtained from: OpenBSD MFC after: 2 weeks Sponsored by: Klara Inc. Modified: head/share/man/man3/tree.3 Modified: head/share/man/man3/tree.3 ============================================================================== --- head/share/man/man3/tree.3 Wed May 8 18:47:00 2019 (r347360) +++ head/share/man/man3/tree.3 Wed May 8 18:49:59 2019 (r347361) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2015 +.Dd May 8, 2019 .Dt TREE 3 .Os .Sh NAME @@ -559,6 +559,80 @@ and will be overwritten to provide safe traversal. The .Fn RB_EMPTY macro should be used to check whether a red-black tree is empty. +.Sh EXAMPLES +The following example demonstrates how to declare a red-black tree +holding integers. +Values are inserted into it and the contents of the tree are printed +in order. +Lastly, the internal structure of the tree is printed. +.Bd -literal -offset 3n +#include +#include +#include +#include + +struct node { + RB_ENTRY(node) entry; + int i; +}; + +int +intcmp(struct node *e1, struct node *e2) +{ + return (e1->i < e2->i ? -1 : e1->i > e2->i); +} + +RB_HEAD(inttree, node) head = RB_INITIALIZER(&head); +RB_GENERATE(inttree, node, entry, intcmp) + +int testdata[] = { + 20, 16, 17, 13, 3, 6, 1, 8, 2, 4, 10, 19, 5, 9, 12, 15, 18, + 7, 11, 14 +}; + +void +print_tree(struct node *n) +{ + struct node *left, *right; + + if (n == NULL) { + printf("nil"); + return; + } + left = RB_LEFT(n, entry); + right = RB_RIGHT(n, entry); + if (left == NULL && right == NULL) + printf("%d", n->i); + else { + printf("%d(", n->i); + print_tree(left); + printf(","); + print_tree(right); + printf(")"); + } +} + +int +main(void) +{ + int i; + struct node *n; + + for (i = 0; i < sizeof(testdata) / sizeof(testdata[0]); i++) { + if ((n = malloc(sizeof(struct node))) == NULL) + err(1, NULL); + n->i = testdata[i]; + RB_INSERT(inttree, &head, n); + } + + RB_FOREACH(n, inttree, &head) { + printf("%d\en", n->i); + } + print_tree(RB_ROOT(&head)); + printf("\en"); + return (0); +} +.Ed .Sh NOTES Trying to free a tree in the following way is a common error: .Bd -literal -offset indent From owner-svn-src-all@freebsd.org Wed May 8 18:56:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1CB01590CB4; Wed, 8 May 2019 18:56:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 457B089BA8; Wed, 8 May 2019 18:56:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 153B99E3A; Wed, 8 May 2019 18:56:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48IuOCY017388; Wed, 8 May 2019 18:56:24 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48IuOGd017387; Wed, 8 May 2019 18:56:24 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905081856.x48IuOGd017387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 May 2019 18:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347362 - head/sys/modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/modules/dtb/allwinner X-SVN-Commit-Revision: 347362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 457B089BA8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 18:56:25 -0000 Author: manu Date: Wed May 8 18:56:24 2019 New Revision: 347362 URL: https://svnweb.freebsd.org/changeset/base/347362 Log: dtb: allwinner: Add the pinebook dtb to the build Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Wed May 8 18:49:59 2019 (r347361) +++ head/sys/modules/dtb/allwinner/Makefile Wed May 8 18:56:24 2019 (r347362) @@ -43,6 +43,7 @@ DTS= \ allwinner/sun50i-a64-pine64-lts.dts \ allwinner/sun50i-a64-pine64-plus.dts \ allwinner/sun50i-a64-pine64.dts \ + allwinner/sun50i-a64-pinebook.dts \ allwinner/sun50i-a64-sopine-baseboard.dts \ allwinner/sun50i-h5-orangepi-pc2.dts \ allwinner/sun50i-h5-nanopi-neo2.dts From owner-svn-src-all@freebsd.org Wed May 8 19:00:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D74781590E1E; Wed, 8 May 2019 19:00:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 864FE89E58; Wed, 8 May 2019 19:00:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 617489E59; Wed, 8 May 2019 19:00:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48J0o8l018439; Wed, 8 May 2019 19:00:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48J0lRY018422; Wed, 8 May 2019 19:00:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905081900.x48J0lRY018422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 May 2019 19:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347363 - in vendor/device-tree/dist: Bindings Bindings/arm Bindings/arm/bcm Bindings/arm/freescale Bindings/arm/socionext Bindings/bus Bindings/clock Bindings/cpufreq Bindings/crypto B... X-SVN-Group: vendor X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in vendor/device-tree/dist: Bindings Bindings/arm Bindings/arm/bcm Bindings/arm/freescale Bindings/arm/socionext Bindings/bus Bindings/clock Bindings/cpufreq Bindings/crypto Bindings/display Bindings/... X-SVN-Commit-Revision: 347363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 864FE89E58 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 19:00:51 -0000 Author: manu Date: Wed May 8 19:00:46 2019 New Revision: 347363 URL: https://svnweb.freebsd.org/changeset/base/347363 Log: Import Linux 5.1 DTS files Added: vendor/device-tree/dist/Bindings/arm/bitmain.yaml vendor/device-tree/dist/Bindings/arm/freescale/fsl,imx7ulp-sim.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/fsl.yaml vendor/device-tree/dist/Bindings/arm/l2c2x0.yaml vendor/device-tree/dist/Bindings/arm/pmu.yaml vendor/device-tree/dist/Bindings/arm/renesas.yaml vendor/device-tree/dist/Bindings/arm/socionext/milbeaut.yaml vendor/device-tree/dist/Bindings/clock/fixed-clock.yaml vendor/device-tree/dist/Bindings/clock/fixed-factor-clock.yaml vendor/device-tree/dist/Bindings/clock/fixed-mmio-clock.txt (contents, props changed) vendor/device-tree/dist/Bindings/clock/imx8mm-clock.txt (contents, props changed) vendor/device-tree/dist/Bindings/crypto/samsung-slimsss.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/amlogic,simple-framebuffer.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/arm,komeda.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/bridge/ti,ds90c185.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/msm/gmu.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/auo,g101evn010.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/innolux,ee101ia-01d.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/lemaker,bl035-rgb-002.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/pda,91-00156-a0.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/sitronix,st7701.txt (contents, props changed) vendor/device-tree/dist/Bindings/dma/fsl-qdma.txt (contents, props changed) vendor/device-tree/dist/Bindings/edac/aspeed-sdram-edac.txt (contents, props changed) vendor/device-tree/dist/Bindings/extcon/extcon-ptn5150.txt (contents, props changed) vendor/device-tree/dist/Bindings/firmware/nvidia,tegra210-bpmp.txt (contents, props changed) vendor/device-tree/dist/Bindings/gnss/mediatek.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpio/gateworks,pld-gpio.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpio/intel,ixp4xx-gpio.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/ad741x.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/dps650ab.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/hih6130.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/lm75.txt (contents, props changed) vendor/device-tree/dist/Bindings/i2c/i2c-iop3xx.txt (contents, props changed) vendor/device-tree/dist/Bindings/i2c/i2c-mt65xx.txt (contents, props changed) vendor/device-tree/dist/Bindings/i2c/i2c-stu300.txt (contents, props changed) vendor/device-tree/dist/Bindings/i2c/i2c-sun6i-p2wi.txt (contents, props changed) vendor/device-tree/dist/Bindings/i2c/i2c-wmt.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/adi,ad7606.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/adi,ad7768-1.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/ingenic,adc.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/lpc32xx-adc.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/nuvoton,npcm-adc.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/stmpe-adc.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/ti-ads124s08.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/chemical/bme680.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/chemical/plantower,pms7003.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/chemical/sensirion,sgp30.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/chemical/sensirion,sps30.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/dac/ti,dac7612.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/impedance-analyzer/ vendor/device-tree/dist/Bindings/iio/impedance-analyzer/ad5933.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/light/max44009.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/ilitek,ili2xxx.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/msm-vibrator.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/st,stpmic1-onkey.txt (contents, props changed) vendor/device-tree/dist/Bindings/interconnect/ vendor/device-tree/dist/Bindings/interconnect/interconnect.txt (contents, props changed) vendor/device-tree/dist/Bindings/interconnect/qcom,sdm845.txt (contents, props changed) vendor/device-tree/dist/Bindings/interrupt-controller/arm,gic-v3.yaml vendor/device-tree/dist/Bindings/interrupt-controller/arm,gic.yaml vendor/device-tree/dist/Bindings/interrupt-controller/loongson,ls1x-intc.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/leds-trigger-pattern.txt (contents, props changed) vendor/device-tree/dist/Bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/i2c/melexis,mlx90640.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/i2c/mt9m001.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/imx7-csi.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/imx7-mipi-csi2.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/si470x.txt (contents, props changed) vendor/device-tree/dist/Bindings/mfd/cirrus,lochnagar.txt (contents, props changed) vendor/device-tree/dist/Bindings/mfd/st,stpmic1.txt (contents, props changed) vendor/device-tree/dist/Bindings/misc/qcom,fastrpc.txt (contents, props changed) vendor/device-tree/dist/Bindings/mtd/amlogic,meson-nand.txt (contents, props changed) vendor/device-tree/dist/Bindings/mtd/stm32-fmc2-nand.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/fsl-enetc.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/mdio-mux-multiplexer.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/qcom,ethqos.txt (contents, props changed) vendor/device-tree/dist/Bindings/nvmem/xlnx,zynqmp-nvmem.txt (contents, props changed) vendor/device-tree/dist/Bindings/phy/cdns,dphy.txt (contents, props changed) vendor/device-tree/dist/Bindings/phy/phy-armada38x-comphy.txt (contents, props changed) vendor/device-tree/dist/Bindings/phy/phy-mvebu-utmi.txt (contents, props changed) vendor/device-tree/dist/Bindings/pinctrl/fsl,imx50-pinctrl.txt (contents, props changed) vendor/device-tree/dist/Bindings/pinctrl/fsl,imx8mm-pinctrl.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/qcom,rpmpd.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/reset/xlnx,zynqmp-power.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/xlnx,zynqmp-genpd.txt (contents, props changed) vendor/device-tree/dist/Bindings/regulator/fixed-regulator.yaml vendor/device-tree/dist/Bindings/regulator/max77650-regulator.txt (contents, props changed) vendor/device-tree/dist/Bindings/regulator/rohm,bd70528-regulator.txt (contents, props changed) vendor/device-tree/dist/Bindings/reset/brcm,brcmstb-reset.txt (contents, props changed) vendor/device-tree/dist/Bindings/reset/xlnx,zynqmp-reset.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/cdns,rtc.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/isil,isl1208.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/nxp,pcf85063.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/nxp,pcf8523.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/rtc-meson.txt (contents, props changed) vendor/device-tree/dist/Bindings/serial/milbeaut-uart.txt (contents, props changed) vendor/device-tree/dist/Bindings/serial/nvidia,tegra194-tcu.txt (contents, props changed) vendor/device-tree/dist/Bindings/serial/pl011.yaml vendor/device-tree/dist/Bindings/serial/snps-dw-apb-uart.yaml vendor/device-tree/dist/Bindings/soc/bcm/brcm,bcm2835-pm.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/cs35l36.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/cs4341.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/fsl,micfil.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/google,cros-ec-codec.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/ingenic,jz4725b-codec.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/ingenic,jz4740-codec.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/mt6358.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/mt8183-afe-pcm.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/mtk-btcvsd-snd.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/rockchip,rk3328-codec.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/sprd-pcm.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/xlnx,audio-formatter.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/xlnx,spdif.txt (contents, props changed) vendor/device-tree/dist/Bindings/spi/spi-fsl-qspi.txt (contents, props changed) vendor/device-tree/dist/Bindings/spi/spi-nxp-fspi.txt (contents, props changed) vendor/device-tree/dist/Bindings/spi/spi-sifive.txt (contents, props changed) vendor/device-tree/dist/Bindings/sram/milbeaut-smp-sram.txt (contents, props changed) vendor/device-tree/dist/Bindings/thermal/brcm,sr-thermal.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/nvidia,tegra210-timer.txt (contents, props changed) vendor/device-tree/dist/Bindings/timer/socionext,milbeaut-timer.txt (contents, props changed) vendor/device-tree/dist/Bindings/usb/ingenic,jz4740-musb.txt (contents, props changed) vendor/device-tree/dist/Bindings/watchdog/st,stpmic1-wdt.txt (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clk/lochnagar.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/actions,s500-cmu.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/g12a-aoclkc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/g12a-clkc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/imx8mm-clock.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/sifive-fu540-prci.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/iio/adc/ingenic,adc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/interconnect/ vendor/device-tree/dist/include/dt-bindings/interconnect/qcom,sdm845.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/mfd/st,stpmic1.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/pinctrl/lochnagar.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/qcom-rpmpd.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/xlnx-zynqmp-power.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/amlogic,meson-g12a-reset.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/g12a-aoclkc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/imx8mq-reset.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/xlnx-zynqmp-resets.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/soc/bcm2835-pm.h (contents, props changed) vendor/device-tree/dist/src/arm/am335x-guardian.dts (contents, props changed) vendor/device-tree/dist/src/arm/am3874-iceboard.dts (contents, props changed) vendor/device-tree/dist/src/arm/aspeed-bmc-inspur-on5263m5.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm2837-rpi-3-a-plus.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm47094-phicomm-k3.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6-logicpd-baseboard.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6-logicpd-som.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-yapp4-common.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-yapp4-draco.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-yapp4-hydra.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-yapp4-ursa.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-logicpd.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6ul-phytec-pcl063.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6ul-phytec-peb-eval-01.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6ul-phytec-phyboard-segin-full.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6ul-phytec-phyboard-segin.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/lpc4357-myd-lpc4357.dts (contents, props changed) vendor/device-tree/dist/src/arm/milbeaut-m10v-evb.dts (contents, props changed) vendor/device-tree/dist/src/arm/milbeaut-m10v.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/r7s9210-rza2mevb.dts (contents, props changed) vendor/device-tree/dist/src/arm/r7s9210.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/rv1108-elgin-r1.dts (contents, props changed) vendor/device-tree/dist/src/arm/socfpga_cyclone5_chameleon96.dts (contents, props changed) vendor/device-tree/dist/src/arm/vf610-zii-ssmb-dtu.dts (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-g12a-x96-max.dts (contents, props changed) vendor/device-tree/dist/src/arm64/arm/fvp-base-revc.dts (contents, props changed) vendor/device-tree/dist/src/arm64/arm/rtsm_ve-motherboard-rs2.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/bitmain/ vendor/device-tree/dist/src/arm64/bitmain/bm1880-sophon-edge.dts (contents, props changed) vendor/device-tree/dist/src/arm64/bitmain/bm1880.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/broadcom/bcm2837-rpi-3-a-plus.dts (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a-oxalis.dts (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/imx8mm-pinfunc.h (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/imx8qxp-mek.dts (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/imx8qxp.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/marvell/armada-3720-uDPU.dts (contents, props changed) vendor/device-tree/dist/src/arm64/nvidia/tegra210-p2894-0050-a08.dts (contents, props changed) vendor/device-tree/dist/src/arm64/nvidia/tegra210-p2894.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/cat875.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a774c0-cat874.dts (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a774c0-ek874.dts (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a774c0.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/rockchip/rk3399-nanopc-t4.dts (contents, props changed) vendor/device-tree/dist/src/arm64/rockchip/rk3399-nanopi-m4.dts (contents, props changed) vendor/device-tree/dist/src/arm64/rockchip/rk3399-nanopi4.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/rockchip/rk3399-rock-pi-4.dts (contents, props changed) Deleted: vendor/device-tree/dist/Bindings/arm/armadeus.txt vendor/device-tree/dist/Bindings/arm/bhf.txt vendor/device-tree/dist/Bindings/arm/compulab-boards.txt vendor/device-tree/dist/Bindings/arm/fsl.txt vendor/device-tree/dist/Bindings/arm/i2se.txt vendor/device-tree/dist/Bindings/arm/l2c2x0.txt vendor/device-tree/dist/Bindings/arm/olimex.txt vendor/device-tree/dist/Bindings/arm/pmu.txt vendor/device-tree/dist/Bindings/arm/shmobile.txt vendor/device-tree/dist/Bindings/arm/technologic.txt vendor/device-tree/dist/Bindings/clock/fixed-clock.txt vendor/device-tree/dist/Bindings/clock/fixed-factor-clock.txt vendor/device-tree/dist/Bindings/display/panel/auo,g101evn010 vendor/device-tree/dist/Bindings/i2c/i2c-mtk.txt vendor/device-tree/dist/Bindings/i2c/i2c-st-ddci2c.txt vendor/device-tree/dist/Bindings/i2c/i2c-sunxi-p2wi.txt vendor/device-tree/dist/Bindings/i2c/i2c-vt8500.txt vendor/device-tree/dist/Bindings/interrupt-controller/arm,gic-v3.txt vendor/device-tree/dist/Bindings/interrupt-controller/arm,gic.txt vendor/device-tree/dist/Bindings/iommu/nvidia,tegra20-gart.txt vendor/device-tree/dist/Bindings/mips/lantiq/rcu-gphy.txt vendor/device-tree/dist/Bindings/mtd/fsl-quadspi.txt vendor/device-tree/dist/Bindings/regulator/fixed-regulator.txt vendor/device-tree/dist/Bindings/rtc/isil,isl1219.txt vendor/device-tree/dist/Bindings/serial/pl011.txt vendor/device-tree/dist/Bindings/serial/renesas,rzn1-uart.txt vendor/device-tree/dist/Bindings/serial/snps-dw-apb-uart.txt vendor/device-tree/dist/Bindings/sound/audio-graph-scu-card.txt vendor/device-tree/dist/Bindings/sound/simple-scu-card.txt vendor/device-tree/dist/Bindings/staging/iio/adc/lpc32xx-adc.txt vendor/device-tree/dist/src/arm/skeleton.dtsi vendor/device-tree/dist/src/arm/skeleton64.dtsi Modified: vendor/device-tree/dist/Bindings/Makefile vendor/device-tree/dist/Bindings/arm/amlogic.txt vendor/device-tree/dist/Bindings/arm/atmel-sysregs.txt vendor/device-tree/dist/Bindings/arm/bcm/brcm,bcm2835.txt vendor/device-tree/dist/Bindings/arm/cpus.yaml vendor/device-tree/dist/Bindings/arm/freescale/fsl,scu.txt vendor/device-tree/dist/Bindings/arm/mediatek.txt vendor/device-tree/dist/Bindings/arm/rockchip.yaml vendor/device-tree/dist/Bindings/arm/tegra.yaml vendor/device-tree/dist/Bindings/bus/imx-weim.txt vendor/device-tree/dist/Bindings/clock/actions,owl-cmu.txt vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-aoclkc.txt vendor/device-tree/dist/Bindings/clock/amlogic,gxbb-clkc.txt vendor/device-tree/dist/Bindings/clock/exynos5433-clock.txt vendor/device-tree/dist/Bindings/clock/nvidia,tegra124-dfll.txt vendor/device-tree/dist/Bindings/clock/qcom,rpmcc.txt vendor/device-tree/dist/Bindings/cpufreq/nvidia,tegra124-cpufreq.txt vendor/device-tree/dist/Bindings/display/bridge/cdns,dsi.txt vendor/device-tree/dist/Bindings/display/bridge/lvds-transmitter.txt vendor/device-tree/dist/Bindings/display/bridge/renesas,lvds.txt vendor/device-tree/dist/Bindings/display/bridge/thine,thc63lvdm83d.txt vendor/device-tree/dist/Bindings/display/msm/gpu.txt vendor/device-tree/dist/Bindings/display/renesas,du.txt vendor/device-tree/dist/Bindings/display/rockchip/rockchip-vop.txt vendor/device-tree/dist/Bindings/display/sitronix,st7735r.txt vendor/device-tree/dist/Bindings/display/ssd1307fb.txt vendor/device-tree/dist/Bindings/display/sunxi/sun4i-drm.txt vendor/device-tree/dist/Bindings/display/tegra/nvidia,tegra20-host1x.txt vendor/device-tree/dist/Bindings/dma/dma.txt vendor/device-tree/dist/Bindings/dma/k3dma.txt vendor/device-tree/dist/Bindings/dma/snps-dma.txt vendor/device-tree/dist/Bindings/dma/sprd-dma.txt vendor/device-tree/dist/Bindings/dma/xilinx/xilinx_dma.txt vendor/device-tree/dist/Bindings/eeprom/at24.txt vendor/device-tree/dist/Bindings/firmware/nvidia,tegra186-bpmp.txt vendor/device-tree/dist/Bindings/gnss/gnss.txt vendor/device-tree/dist/Bindings/gnss/sirfstar.txt vendor/device-tree/dist/Bindings/gpio/gpio-eic-sprd.txt vendor/device-tree/dist/Bindings/gpio/gpio-pca953x.txt vendor/device-tree/dist/Bindings/gpio/gpio.txt vendor/device-tree/dist/Bindings/gpu/arm,mali-utgard.txt vendor/device-tree/dist/Bindings/gpu/samsung-rotator.txt vendor/device-tree/dist/Bindings/hwmon/adc128d818.txt vendor/device-tree/dist/Bindings/hwmon/ina3221.txt vendor/device-tree/dist/Bindings/hwmon/pwm-fan.txt vendor/device-tree/dist/Bindings/iio/accel/mma8452.txt vendor/device-tree/dist/Bindings/iio/adc/amlogic,meson-saradc.txt vendor/device-tree/dist/Bindings/iio/adc/samsung,exynos-adc.txt vendor/device-tree/dist/Bindings/iio/imu/bmi160.txt vendor/device-tree/dist/Bindings/iio/imu/inv_mpu6050.txt vendor/device-tree/dist/Bindings/iio/st-sensors.txt vendor/device-tree/dist/Bindings/input/cypress,tm2-touchkey.txt vendor/device-tree/dist/Bindings/input/touchscreen/edt-ft5x06.txt vendor/device-tree/dist/Bindings/input/touchscreen/goodix.txt vendor/device-tree/dist/Bindings/input/touchscreen/sitronix-st1232.txt vendor/device-tree/dist/Bindings/input/touchscreen/stmpe.txt vendor/device-tree/dist/Bindings/input/touchscreen/sx8654.txt vendor/device-tree/dist/Bindings/input/touchscreen/ti-tsc-adc.txt vendor/device-tree/dist/Bindings/interrupt-controller/fsl,irqsteer.txt vendor/device-tree/dist/Bindings/interrupt-controller/mediatek,sysirq.txt vendor/device-tree/dist/Bindings/interrupt-controller/renesas,irqc.txt vendor/device-tree/dist/Bindings/leds/common.txt vendor/device-tree/dist/Bindings/media/i2c/adv748x.txt vendor/device-tree/dist/Bindings/media/i2c/ov5645.txt vendor/device-tree/dist/Bindings/media/mediatek-vcodec.txt vendor/device-tree/dist/Bindings/media/rcar_vin.txt vendor/device-tree/dist/Bindings/media/renesas,fcp.txt vendor/device-tree/dist/Bindings/media/renesas,rcar-csi2.txt vendor/device-tree/dist/Bindings/media/renesas,vsp1.txt vendor/device-tree/dist/Bindings/media/sun6i-csi.txt vendor/device-tree/dist/Bindings/memory-controllers/nvidia,tegra20-mc.txt vendor/device-tree/dist/Bindings/mfd/aspeed-lpc.txt vendor/device-tree/dist/Bindings/mfd/rohm,bd71837-pmic.txt vendor/device-tree/dist/Bindings/mfd/stmpe.txt vendor/device-tree/dist/Bindings/mips/lantiq/rcu.txt vendor/device-tree/dist/Bindings/mmc/fsl-imx-esdhc.txt vendor/device-tree/dist/Bindings/mmc/mmc.txt vendor/device-tree/dist/Bindings/mmc/nvidia,tegra20-sdhci.txt vendor/device-tree/dist/Bindings/mmc/ti-omap.txt vendor/device-tree/dist/Bindings/mtd/cadence-quadspi.txt vendor/device-tree/dist/Bindings/mtd/mtk-quadspi.txt vendor/device-tree/dist/Bindings/net/btusb.txt vendor/device-tree/dist/Bindings/net/cpsw-phy-sel.txt vendor/device-tree/dist/Bindings/net/davinci_emac.txt vendor/device-tree/dist/Bindings/net/dsa/dsa.txt vendor/device-tree/dist/Bindings/net/dsa/ksz.txt vendor/device-tree/dist/Bindings/net/dsa/mt7530.txt vendor/device-tree/dist/Bindings/net/dsa/qca8k.txt vendor/device-tree/dist/Bindings/net/ethernet.txt vendor/device-tree/dist/Bindings/net/macb.txt vendor/device-tree/dist/Bindings/net/marvell-armada-370-neta.txt vendor/device-tree/dist/Bindings/net/mediatek-bluetooth.txt vendor/device-tree/dist/Bindings/net/nixge.txt vendor/device-tree/dist/Bindings/net/stm32-dwmac.txt vendor/device-tree/dist/Bindings/net/wireless/mediatek,mt76.txt vendor/device-tree/dist/Bindings/nvmem/imx-ocotp.txt vendor/device-tree/dist/Bindings/opp/opp.txt vendor/device-tree/dist/Bindings/pci/altera-pcie.txt vendor/device-tree/dist/Bindings/pci/fsl,imx6q-pcie.txt vendor/device-tree/dist/Bindings/pci/layerscape-pci.txt vendor/device-tree/dist/Bindings/pci/rcar-pci.txt vendor/device-tree/dist/Bindings/pci/ti-pci.txt vendor/device-tree/dist/Bindings/phy/phy-mvebu-comphy.txt vendor/device-tree/dist/Bindings/phy/phy-rockchip-inno-usb2.txt vendor/device-tree/dist/Bindings/phy/qcom-qmp-phy.txt vendor/device-tree/dist/Bindings/phy/qcom-qusb2-phy.txt vendor/device-tree/dist/Bindings/phy/rcar-gen3-phy-usb2.txt vendor/device-tree/dist/Bindings/phy/ti-phy.txt vendor/device-tree/dist/Bindings/pinctrl/atmel,at91-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/marvell,armada-37xx-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/meson,pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/qcom,pmic-gpio.txt vendor/device-tree/dist/Bindings/power/fsl,imx-gpcv2.txt vendor/device-tree/dist/Bindings/power/supply/battery.txt vendor/device-tree/dist/Bindings/power/supply/sc27xx-fg.txt vendor/device-tree/dist/Bindings/property-units.txt vendor/device-tree/dist/Bindings/ptp/ptp-qoriq.txt vendor/device-tree/dist/Bindings/pwm/atmel-pwm.txt vendor/device-tree/dist/Bindings/pwm/pwm-hibvt.txt vendor/device-tree/dist/Bindings/regulator/fan53555.txt vendor/device-tree/dist/Bindings/regulator/pfuze100.txt vendor/device-tree/dist/Bindings/regulator/rohm,bd71837-regulator.txt vendor/device-tree/dist/Bindings/regulator/st,stpmic1-regulator.txt vendor/device-tree/dist/Bindings/regulator/tps65218.txt vendor/device-tree/dist/Bindings/remoteproc/qcom,adsp-pil.txt vendor/device-tree/dist/Bindings/remoteproc/qcom,adsp.txt vendor/device-tree/dist/Bindings/remoteproc/qcom,q6v5.txt vendor/device-tree/dist/Bindings/reset/fsl,imx7-src.txt vendor/device-tree/dist/Bindings/rtc/abracon,abx80x.txt vendor/device-tree/dist/Bindings/rtc/rtc.txt vendor/device-tree/dist/Bindings/serial/8250.txt vendor/device-tree/dist/Bindings/serial/ingenic,uart.txt vendor/device-tree/dist/Bindings/serial/mtk-uart.txt vendor/device-tree/dist/Bindings/serial/omap_serial.txt vendor/device-tree/dist/Bindings/serial/renesas,sci-serial.txt vendor/device-tree/dist/Bindings/soc/amlogic/clk-measure.txt vendor/device-tree/dist/Bindings/soc/qcom/qcom,smd-rpm.txt vendor/device-tree/dist/Bindings/sound/adi,adau1977.txt vendor/device-tree/dist/Bindings/sound/ak4458.txt vendor/device-tree/dist/Bindings/sound/davinci-mcasp-audio.txt vendor/device-tree/dist/Bindings/sound/nvidia,tegra30-hda.txt vendor/device-tree/dist/Bindings/sound/qcom,msm8916-wcd-analog.txt vendor/device-tree/dist/Bindings/sound/qcom,wcd9335.txt vendor/device-tree/dist/Bindings/sound/sgtl5000.txt vendor/device-tree/dist/Bindings/spi/atmel-quadspi.txt vendor/device-tree/dist/Bindings/spi/fsl-imx-cspi.txt vendor/device-tree/dist/Bindings/spi/spi-sprd.txt vendor/device-tree/dist/Bindings/spi/spi-stm32.txt vendor/device-tree/dist/Bindings/sram/sunxi-sram.txt vendor/device-tree/dist/Bindings/thermal/mediatek-thermal.txt vendor/device-tree/dist/Bindings/timer/fsl,imxgpt.txt vendor/device-tree/dist/Bindings/timer/mediatek,mtk-timer.txt vendor/device-tree/dist/Bindings/timer/renesas,cmt.txt vendor/device-tree/dist/Bindings/timer/renesas,tmu.txt vendor/device-tree/dist/Bindings/trivial-devices.yaml vendor/device-tree/dist/Bindings/ufs/ufs-hisi.txt vendor/device-tree/dist/Bindings/ufs/ufshcd-pltfrm.txt vendor/device-tree/dist/Bindings/usb/ci-hdrc-usb2.txt vendor/device-tree/dist/Bindings/usb/keystone-usb.txt vendor/device-tree/dist/Bindings/usb/qcom,dwc3.txt vendor/device-tree/dist/Bindings/usb/renesas_usb3.txt vendor/device-tree/dist/Bindings/usb/renesas_usbhs.txt vendor/device-tree/dist/Bindings/usb/usb251xb.txt vendor/device-tree/dist/Bindings/vendor-prefixes.txt vendor/device-tree/dist/Bindings/watchdog/renesas-wdt.txt vendor/device-tree/dist/include/dt-bindings/clock/ath79-clk.h vendor/device-tree/dist/include/dt-bindings/clock/axg-aoclkc.h vendor/device-tree/dist/include/dt-bindings/clock/exynos5433.h vendor/device-tree/dist/include/dt-bindings/clock/gxbb-aoclkc.h vendor/device-tree/dist/include/dt-bindings/clock/imx5-clock.h vendor/device-tree/dist/include/dt-bindings/clock/imx8mq-clock.h vendor/device-tree/dist/include/dt-bindings/clock/marvell,mmp2.h vendor/device-tree/dist/include/dt-bindings/clock/meson8b-clkc.h vendor/device-tree/dist/include/dt-bindings/clock/mt2712-clk.h vendor/device-tree/dist/include/dt-bindings/clock/mt8173-clk.h vendor/device-tree/dist/include/dt-bindings/clock/qcom,rpmcc.h vendor/device-tree/dist/include/dt-bindings/clock/qcom,rpmh.h vendor/device-tree/dist/include/dt-bindings/clock/r8a774a1-cpg-mssr.h vendor/device-tree/dist/include/dt-bindings/clock/r8a774c0-cpg-mssr.h vendor/device-tree/dist/include/dt-bindings/clock/r8a7778-clock.h vendor/device-tree/dist/include/dt-bindings/clock/stm32mp1-clks.h vendor/device-tree/dist/include/dt-bindings/gpio/gpio.h vendor/device-tree/dist/include/dt-bindings/input/linux-event-codes.h vendor/device-tree/dist/include/dt-bindings/pinctrl/at91.h vendor/device-tree/dist/include/dt-bindings/power/mt8173-power.h vendor/device-tree/dist/src/arc/abilis_tb100.dtsi vendor/device-tree/dist/src/arc/abilis_tb100_dvk.dts vendor/device-tree/dist/src/arc/abilis_tb101.dtsi vendor/device-tree/dist/src/arc/abilis_tb101_dvk.dts vendor/device-tree/dist/src/arc/abilis_tb10x.dtsi vendor/device-tree/dist/src/arc/axc001.dtsi vendor/device-tree/dist/src/arc/axc003.dtsi vendor/device-tree/dist/src/arc/axc003_idu.dtsi vendor/device-tree/dist/src/arc/axs10x_mb.dtsi vendor/device-tree/dist/src/arc/hsdk.dts vendor/device-tree/dist/src/arc/vdk_axc003.dtsi vendor/device-tree/dist/src/arc/vdk_axc003_idu.dtsi vendor/device-tree/dist/src/arc/vdk_axs10x_mb.dtsi vendor/device-tree/dist/src/arm/alphascale-asm9260.dtsi vendor/device-tree/dist/src/arm/alpine.dtsi vendor/device-tree/dist/src/arm/am335x-baltos-ir2110.dts vendor/device-tree/dist/src/arm/am335x-baltos-ir3220.dts vendor/device-tree/dist/src/arm/am335x-baltos-ir5221.dts vendor/device-tree/dist/src/arm/am335x-chiliboard.dts vendor/device-tree/dist/src/arm/am335x-evm.dts vendor/device-tree/dist/src/arm/am335x-evmsk.dts vendor/device-tree/dist/src/arm/am335x-icev2.dts vendor/device-tree/dist/src/arm/am335x-igep0033.dtsi vendor/device-tree/dist/src/arm/am335x-lxm.dts vendor/device-tree/dist/src/arm/am335x-moxa-uc-2100-common.dtsi vendor/device-tree/dist/src/arm/am335x-moxa-uc-8100-me-t.dts vendor/device-tree/dist/src/arm/am335x-phycore-som.dtsi vendor/device-tree/dist/src/arm/am335x-shc.dts vendor/device-tree/dist/src/arm/am33xx-l4.dtsi vendor/device-tree/dist/src/arm/am437x-gp-evm.dts vendor/device-tree/dist/src/arm/am437x-l4.dtsi vendor/device-tree/dist/src/arm/am43x-epos-evm.dts vendor/device-tree/dist/src/arm/arm-realview-eb.dtsi vendor/device-tree/dist/src/arm/arm-realview-pb1176.dts vendor/device-tree/dist/src/arm/arm-realview-pb11mp.dts vendor/device-tree/dist/src/arm/arm-realview-pbx.dtsi vendor/device-tree/dist/src/arm/armada-370-rd.dts vendor/device-tree/dist/src/arm/armada-388-clearfog.dts vendor/device-tree/dist/src/arm/armada-388-clearfog.dtsi vendor/device-tree/dist/src/arm/armada-38x.dtsi vendor/device-tree/dist/src/arm/armada-39x.dtsi vendor/device-tree/dist/src/arm/armada-xp-linksys-mamba.dts vendor/device-tree/dist/src/arm/artpec6.dtsi vendor/device-tree/dist/src/arm/aspeed-bmc-arm-stardragon4800-rep2.dts vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-tiogapass.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-palmetto.dts vendor/device-tree/dist/src/arm/aspeed-bmc-quanta-q71l.dts vendor/device-tree/dist/src/arm/aspeed-g4.dtsi vendor/device-tree/dist/src/arm/aspeed-g5.dtsi vendor/device-tree/dist/src/arm/at91-nattis-2-natte-2.dts vendor/device-tree/dist/src/arm/at91-sama5d27_som1.dtsi vendor/device-tree/dist/src/arm/at91-sama5d27_som1_ek.dts vendor/device-tree/dist/src/arm/at91-wb45n.dts vendor/device-tree/dist/src/arm/at91-wb50n.dts vendor/device-tree/dist/src/arm/at91rm9200.dtsi vendor/device-tree/dist/src/arm/at91sam9260.dtsi vendor/device-tree/dist/src/arm/at91sam9261.dtsi vendor/device-tree/dist/src/arm/at91sam9263.dtsi vendor/device-tree/dist/src/arm/at91sam9g45.dtsi vendor/device-tree/dist/src/arm/at91sam9n12.dtsi vendor/device-tree/dist/src/arm/at91sam9rl.dtsi vendor/device-tree/dist/src/arm/at91sam9x5.dtsi vendor/device-tree/dist/src/arm/atlas6-evb.dts vendor/device-tree/dist/src/arm/atlas6.dtsi vendor/device-tree/dist/src/arm/atlas7.dtsi vendor/device-tree/dist/src/arm/axm55xx.dtsi vendor/device-tree/dist/src/arm/bcm-cygnus.dtsi vendor/device-tree/dist/src/arm/bcm-nsp.dtsi vendor/device-tree/dist/src/arm/bcm11351.dtsi vendor/device-tree/dist/src/arm/bcm21664-garnet.dts vendor/device-tree/dist/src/arm/bcm21664.dtsi vendor/device-tree/dist/src/arm/bcm23550-sparrow.dts vendor/device-tree/dist/src/arm/bcm23550.dtsi vendor/device-tree/dist/src/arm/bcm28155-ap.dts vendor/device-tree/dist/src/arm/bcm2835-rpi-a-plus.dts vendor/device-tree/dist/src/arm/bcm2835-rpi-b-plus.dts vendor/device-tree/dist/src/arm/bcm2835-rpi-b-rev2.dts vendor/device-tree/dist/src/arm/bcm2835-rpi-zero-w.dts vendor/device-tree/dist/src/arm/bcm2835-rpi-zero.dts vendor/device-tree/dist/src/arm/bcm2835-rpi.dtsi vendor/device-tree/dist/src/arm/bcm2836-rpi-2-b.dts vendor/device-tree/dist/src/arm/bcm2837-rpi-3-b-plus.dts vendor/device-tree/dist/src/arm/bcm2837-rpi-3-b.dts vendor/device-tree/dist/src/arm/bcm2837-rpi-cm3.dtsi vendor/device-tree/dist/src/arm/bcm283x.dtsi vendor/device-tree/dist/src/arm/bcm47081-asus-rt-n18u.dts vendor/device-tree/dist/src/arm/bcm47081-buffalo-wzr-600dhp2.dts vendor/device-tree/dist/src/arm/bcm47081-buffalo-wzr-900dhp.dts vendor/device-tree/dist/src/arm/bcm47081-luxul-xap-1410.dts vendor/device-tree/dist/src/arm/bcm47081-luxul-xwr-1200.dts vendor/device-tree/dist/src/arm/bcm47081-tplink-archer-c5-v2.dts vendor/device-tree/dist/src/arm/bcm47094-dlink-dir-885l.dts vendor/device-tree/dist/src/arm/bcm47094-linksys-panamera.dts vendor/device-tree/dist/src/arm/bcm47094-luxul-abr-4500.dts vendor/device-tree/dist/src/arm/bcm47094-luxul-xap-1610.dts vendor/device-tree/dist/src/arm/bcm47094-luxul-xbr-4500.dts vendor/device-tree/dist/src/arm/bcm47094-luxul-xwr-3100.dts vendor/device-tree/dist/src/arm/bcm47094-luxul-xwr-3150-v1.dts vendor/device-tree/dist/src/arm/bcm47094-netgear-r8500.dts vendor/device-tree/dist/src/arm/bcm47189-luxul-xap-1440.dts vendor/device-tree/dist/src/arm/bcm47189-luxul-xap-810.dts vendor/device-tree/dist/src/arm/bcm47189-tenda-ac9.dts vendor/device-tree/dist/src/arm/bcm5301x.dtsi vendor/device-tree/dist/src/arm/bcm53340-ubnt-unifi-switch8.dts vendor/device-tree/dist/src/arm/bcm53573.dtsi vendor/device-tree/dist/src/arm/bcm63138.dtsi vendor/device-tree/dist/src/arm/bcm7445.dtsi vendor/device-tree/dist/src/arm/bcm947189acdbmr.dts vendor/device-tree/dist/src/arm/bcm953012er.dts vendor/device-tree/dist/src/arm/bcm953012hr.dts vendor/device-tree/dist/src/arm/bcm953012k.dts vendor/device-tree/dist/src/arm/cx92755.dtsi vendor/device-tree/dist/src/arm/da850-lcdk.dts vendor/device-tree/dist/src/arm/dm814x.dtsi vendor/device-tree/dist/src/arm/dove.dtsi vendor/device-tree/dist/src/arm/dra7-l4.dtsi vendor/device-tree/dist/src/arm/ep7209.dtsi vendor/device-tree/dist/src/arm/ep7211-edb7211.dts vendor/device-tree/dist/src/arm/exynos3250.dtsi vendor/device-tree/dist/src/arm/exynos4412-odroid-common.dtsi vendor/device-tree/dist/src/arm/exynos4412-odroidx.dts vendor/device-tree/dist/src/arm/exynos5250-arndale.dts vendor/device-tree/dist/src/arm/exynos5422-odroid-core.dtsi vendor/device-tree/dist/src/arm/exynos5422-odroidxu3-audio.dtsi vendor/device-tree/dist/src/arm/exynos5422-odroidxu3-common.dtsi vendor/device-tree/dist/src/arm/exynos5422-odroidxu3-lite.dts vendor/device-tree/dist/src/arm/exynos5422-odroidxu4.dts vendor/device-tree/dist/src/arm/imx27.dtsi vendor/device-tree/dist/src/arm/imx28-cfa10036.dts vendor/device-tree/dist/src/arm/imx51-digi-connectcore-jsk.dts vendor/device-tree/dist/src/arm/imx51-digi-connectcore-som.dtsi vendor/device-tree/dist/src/arm/imx6dl-colibri-eval-v3.dts vendor/device-tree/dist/src/arm/imx6q-tbs2910.dts vendor/device-tree/dist/src/arm/imx6qdl-apalis.dtsi vendor/device-tree/dist/src/arm/imx6qdl-colibri.dtsi vendor/device-tree/dist/src/arm/imx6qdl-icore-rqs.dtsi vendor/device-tree/dist/src/arm/imx6qdl-phytec-pfla02.dtsi vendor/device-tree/dist/src/arm/imx6qdl-sabresd.dtsi vendor/device-tree/dist/src/arm/imx6sl.dtsi vendor/device-tree/dist/src/arm/imx6sx.dtsi vendor/device-tree/dist/src/arm/imx6ull-colibri.dtsi vendor/device-tree/dist/src/arm/imx6ull-pinfunc-snvs.h vendor/device-tree/dist/src/arm/imx6ull.dtsi vendor/device-tree/dist/src/arm/imx7d.dtsi vendor/device-tree/dist/src/arm/imx7ulp.dtsi vendor/device-tree/dist/src/arm/integrator.dtsi vendor/device-tree/dist/src/arm/integratorcp.dts vendor/device-tree/dist/src/arm/kirkwood-dir665.dts vendor/device-tree/dist/src/arm/kirkwood-linksys-viper.dts vendor/device-tree/dist/src/arm/kirkwood-mv88f6281gtw-ge.dts vendor/device-tree/dist/src/arm/kirkwood-rd88f6281-z0.dts vendor/device-tree/dist/src/arm/kirkwood-rd88f6281.dtsi vendor/device-tree/dist/src/arm/kirkwood.dtsi vendor/device-tree/dist/src/arm/lpc3250-ea3250.dts vendor/device-tree/dist/src/arm/lpc3250-phy3250.dts vendor/device-tree/dist/src/arm/lpc32xx.dtsi vendor/device-tree/dist/src/arm/lpc4350-hitex-eval.dts vendor/device-tree/dist/src/arm/lpc4357-ea4357-devkit.dts vendor/device-tree/dist/src/arm/ls1021a-moxa-uc-8410a.dts vendor/device-tree/dist/src/arm/ls1021a-qds.dts vendor/device-tree/dist/src/arm/ls1021a-twr.dts vendor/device-tree/dist/src/arm/ls1021a.dtsi vendor/device-tree/dist/src/arm/meson.dtsi vendor/device-tree/dist/src/arm/meson6-atv1200.dts vendor/device-tree/dist/src/arm/meson6.dtsi vendor/device-tree/dist/src/arm/meson8-minix-neo-x8.dts vendor/device-tree/dist/src/arm/meson8.dtsi vendor/device-tree/dist/src/arm/meson8b-ec100.dts vendor/device-tree/dist/src/arm/meson8b-mxq.dts vendor/device-tree/dist/src/arm/meson8b-odroidc1.dts vendor/device-tree/dist/src/arm/meson8b.dtsi vendor/device-tree/dist/src/arm/meson8m2-mxiii-plus.dts vendor/device-tree/dist/src/arm/meson8m2.dtsi vendor/device-tree/dist/src/arm/mmp2-brownstone.dts vendor/device-tree/dist/src/arm/mmp2.dtsi vendor/device-tree/dist/src/arm/moxart.dtsi vendor/device-tree/dist/src/arm/mps2.dtsi vendor/device-tree/dist/src/arm/mt2701-evb.dts vendor/device-tree/dist/src/arm/mt2701.dtsi vendor/device-tree/dist/src/arm/mt6580-evbp1.dts vendor/device-tree/dist/src/arm/mt6580.dtsi vendor/device-tree/dist/src/arm/mt6589-aquaris5.dts vendor/device-tree/dist/src/arm/mt6589.dtsi vendor/device-tree/dist/src/arm/mt6592-evb.dts vendor/device-tree/dist/src/arm/mt6592.dtsi vendor/device-tree/dist/src/arm/mt7623.dtsi vendor/device-tree/dist/src/arm/mt8127-moose.dts vendor/device-tree/dist/src/arm/mt8127.dtsi vendor/device-tree/dist/src/arm/mt8135-evbp1.dts vendor/device-tree/dist/src/arm/mt8135.dtsi vendor/device-tree/dist/src/arm/nspire.dtsi vendor/device-tree/dist/src/arm/omap3-evm-common.dtsi vendor/device-tree/dist/src/arm/omap3-evm-processor-common.dtsi vendor/device-tree/dist/src/arm/omap3-gta04.dtsi vendor/device-tree/dist/src/arm/omap3-gta04a5.dts vendor/device-tree/dist/src/arm/omap4-droid4-xt894.dts vendor/device-tree/dist/src/arm/omap4-panda-common.dtsi vendor/device-tree/dist/src/arm/omap4-sdp.dts vendor/device-tree/dist/src/arm/orion5x-lacie-d2-network.dts vendor/device-tree/dist/src/arm/orion5x-lacie-ethernet-disk-mini-v2.dts vendor/device-tree/dist/src/arm/orion5x-lswsgl.dts vendor/device-tree/dist/src/arm/orion5x-maxtor-shared-storage-2.dts vendor/device-tree/dist/src/arm/orion5x-netgear-wnr854t.dts vendor/device-tree/dist/src/arm/orion5x-rd88f5182-nas.dts vendor/device-tree/dist/src/arm/orion5x.dtsi vendor/device-tree/dist/src/arm/ox810se.dtsi vendor/device-tree/dist/src/arm/ox820.dtsi vendor/device-tree/dist/src/arm/picoxcell-pc3x2.dtsi vendor/device-tree/dist/src/arm/picoxcell-pc3x3.dtsi vendor/device-tree/dist/src/arm/prima2-evb.dts vendor/device-tree/dist/src/arm/prima2.dtsi vendor/device-tree/dist/src/arm/pxa168.dtsi vendor/device-tree/dist/src/arm/pxa2xx.dtsi vendor/device-tree/dist/src/arm/pxa910.dtsi vendor/device-tree/dist/src/arm/qcom-apq8060-dragonboard.dts vendor/device-tree/dist/src/arm/qcom-apq8064.dtsi vendor/device-tree/dist/src/arm/qcom-apq8084.dtsi vendor/device-tree/dist/src/arm/qcom-ipq4019.dtsi vendor/device-tree/dist/src/arm/qcom-ipq8064.dtsi vendor/device-tree/dist/src/arm/qcom-mdm9615-wp8548.dtsi vendor/device-tree/dist/src/arm/qcom-mdm9615.dtsi vendor/device-tree/dist/src/arm/qcom-msm8660.dtsi vendor/device-tree/dist/src/arm/qcom-msm8960.dtsi vendor/device-tree/dist/src/arm/qcom-msm8974-lge-nexus5-hammerhead.dts vendor/device-tree/dist/src/arm/qcom-msm8974.dtsi vendor/device-tree/dist/src/arm/qcom-pm8941.dtsi vendor/device-tree/dist/src/arm/qcom-pma8084.dtsi vendor/device-tree/dist/src/arm/r8a7743.dtsi vendor/device-tree/dist/src/arm/r8a7744.dtsi vendor/device-tree/dist/src/arm/r8a77470-iwg23s-sbc.dts vendor/device-tree/dist/src/arm/r8a7778.dtsi vendor/device-tree/dist/src/arm/r8a7779.dtsi vendor/device-tree/dist/src/arm/r8a7790-stout.dts vendor/device-tree/dist/src/arm/rk3036-kylin.dts vendor/device-tree/dist/src/arm/rk3036.dtsi vendor/device-tree/dist/src/arm/rk3066a-bqcurie2.dts vendor/device-tree/dist/src/arm/rk3066a-mk808.dts vendor/device-tree/dist/src/arm/rk3066a-rayeager.dts vendor/device-tree/dist/src/arm/rk3066a.dtsi vendor/device-tree/dist/src/arm/rk3188-bqedison2qc.dts vendor/device-tree/dist/src/arm/rk3188-px3-evb.dts vendor/device-tree/dist/src/arm/rk3229-evb.dts vendor/device-tree/dist/src/arm/rk3288-fennec.dts vendor/device-tree/dist/src/arm/rk3288-firefly-reload.dts vendor/device-tree/dist/src/arm/rk3288-miqi.dts vendor/device-tree/dist/src/arm/rk3288-popmetal.dts vendor/device-tree/dist/src/arm/rk3288-rock2-square.dts vendor/device-tree/dist/src/arm/rk3288-tinker-s.dts vendor/device-tree/dist/src/arm/rk3288-tinker.dtsi vendor/device-tree/dist/src/arm/rk3288-veyron.dtsi vendor/device-tree/dist/src/arm/rk3288-vyasa.dts vendor/device-tree/dist/src/arm/rk3288.dtsi vendor/device-tree/dist/src/arm/rv1108-evb.dts vendor/device-tree/dist/src/arm/rv1108.dtsi vendor/device-tree/dist/src/arm/s3c2416-smdk2416.dts vendor/device-tree/dist/src/arm/s5pv210-aries.dtsi vendor/device-tree/dist/src/arm/s5pv210-fascinate4g.dts vendor/device-tree/dist/src/arm/s5pv210-galaxys.dts vendor/device-tree/dist/src/arm/s5pv210.dtsi vendor/device-tree/dist/src/arm/sama5d2-pinfunc.h vendor/device-tree/dist/src/arm/sama5d2.dtsi vendor/device-tree/dist/src/arm/sama5d3.dtsi vendor/device-tree/dist/src/arm/sama5d4.dtsi vendor/device-tree/dist/src/arm/socfpga.dtsi vendor/device-tree/dist/src/arm/socfpga_arria10.dtsi vendor/device-tree/dist/src/arm/spear13xx.dtsi vendor/device-tree/dist/src/arm/spear3xx.dtsi vendor/device-tree/dist/src/arm/spear600.dtsi vendor/device-tree/dist/src/arm/ste-nomadik-nhk15.dts vendor/device-tree/dist/src/arm/ste-nomadik-stn8815.dtsi vendor/device-tree/dist/src/arm/ste-u300.dts vendor/device-tree/dist/src/arm/stm32429i-eval.dts vendor/device-tree/dist/src/arm/stm32746g-eval.dts vendor/device-tree/dist/src/arm/stm32f429-disco.dts vendor/device-tree/dist/src/arm/stm32f429.dtsi vendor/device-tree/dist/src/arm/stm32f469-disco.dts vendor/device-tree/dist/src/arm/stm32f746-disco.dts vendor/device-tree/dist/src/arm/stm32f746.dtsi vendor/device-tree/dist/src/arm/stm32f769-disco.dts vendor/device-tree/dist/src/arm/stm32h743-pinctrl.dtsi vendor/device-tree/dist/src/arm/stm32h743.dtsi vendor/device-tree/dist/src/arm/stm32h743i-disco.dts vendor/device-tree/dist/src/arm/stm32h743i-eval.dts vendor/device-tree/dist/src/arm/stm32mp157-pinctrl.dtsi vendor/device-tree/dist/src/arm/stm32mp157c-ed1.dts vendor/device-tree/dist/src/arm/stm32mp157c-ev1.dts vendor/device-tree/dist/src/arm/stm32mp157c.dtsi vendor/device-tree/dist/src/arm/sun4i-a10.dtsi vendor/device-tree/dist/src/arm/sun5i-a13-q8-tablet.dts vendor/device-tree/dist/src/arm/sun5i-reference-design-tablet.dtsi vendor/device-tree/dist/src/arm/sun7i-a20-bananapi.dts vendor/device-tree/dist/src/arm/sun8i-a23-a33.dtsi vendor/device-tree/dist/src/arm/sun8i-a23-ippo-q8h-v1.2.dts vendor/device-tree/dist/src/arm/sun8i-a23-ippo-q8h-v5.dts vendor/device-tree/dist/src/arm/sun8i-a23-q8-tablet.dts vendor/device-tree/dist/src/arm/sun8i-a23.dtsi vendor/device-tree/dist/src/arm/sun8i-a33.dtsi vendor/device-tree/dist/src/arm/sun8i-a83t-allwinner-h8homlet-v2.dts vendor/device-tree/dist/src/arm/sun8i-a83t-bananapi-m3.dts vendor/device-tree/dist/src/arm/sun8i-a83t-cubietruck-plus.dts vendor/device-tree/dist/src/arm/sun8i-h3-nanopi-m1-plus.dts vendor/device-tree/dist/src/arm/sun8i-q8-common.dtsi vendor/device-tree/dist/src/arm/sun8i-r40-bananapi-m2-ultra.dts vendor/device-tree/dist/src/arm/sun8i-r40.dtsi vendor/device-tree/dist/src/arm/sun9i-a80-cubieboard4.dts vendor/device-tree/dist/src/arm/sun9i-a80-optimus.dts vendor/device-tree/dist/src/arm/sun9i-a80.dtsi vendor/device-tree/dist/src/arm/sunxi-bananapi-m2-plus.dtsi vendor/device-tree/dist/src/arm/sunxi-h3-h5.dtsi vendor/device-tree/dist/src/arm/tegra114-dalmore.dts vendor/device-tree/dist/src/arm/tegra124-jetson-tk1.dts vendor/device-tree/dist/src/arm/tegra124-nyan.dtsi vendor/device-tree/dist/src/arm/tegra124-venice2.dts vendor/device-tree/dist/src/arm/tegra20-trimslice.dts vendor/device-tree/dist/src/arm/tegra20.dtsi vendor/device-tree/dist/src/arm/tegra30-beaver.dts vendor/device-tree/dist/src/arm/tegra30-cardhu.dtsi vendor/device-tree/dist/src/arm/versatile-ab.dts vendor/device-tree/dist/src/arm/vexpress-v2m-rs1.dtsi vendor/device-tree/dist/src/arm/vexpress-v2m.dtsi vendor/device-tree/dist/src/arm/vexpress-v2p-ca15_a7.dts vendor/device-tree/dist/src/arm/vf610-bk4.dts vendor/device-tree/dist/src/arm/vf610-zii-cfu1.dts vendor/device-tree/dist/src/arm/vf610-zii-ssmb-spu3.dts vendor/device-tree/dist/src/arm/vt8500.dtsi vendor/device-tree/dist/src/arm/wm8505.dtsi vendor/device-tree/dist/src/arm/wm8650.dtsi vendor/device-tree/dist/src/arm/wm8750.dtsi vendor/device-tree/dist/src/arm/wm8850.dtsi vendor/device-tree/dist/src/arm/zx296702-ad1.dts vendor/device-tree/dist/src/arm/zx296702.dtsi vendor/device-tree/dist/src/arm/zynq-zturn.dts vendor/device-tree/dist/src/arm64/actions/s700-cubieboard7.dts vendor/device-tree/dist/src/arm64/actions/s700.dtsi vendor/device-tree/dist/src/arm64/actions/s900.dtsi vendor/device-tree/dist/src/arm64/al/alpine-v2.dtsi vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-bananapi-m64.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-nanopi-a64.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-olinuxino.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-orangepi-win.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-pine64.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-teres-i.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64.dtsi vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5-libretech-all-h3-cc.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5.dtsi vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6.dtsi vendor/device-tree/dist/src/arm64/altera/socfpga_stratix10.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-axg-s400.dts vendor/device-tree/dist/src/arm64/amlogic/meson-axg.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-g12a.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gx.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxl.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxm.dtsi vendor/device-tree/dist/src/arm64/apm/apm-shadowcat.dtsi vendor/device-tree/dist/src/arm64/apm/apm-storm.dtsi vendor/device-tree/dist/src/arm64/arm/foundation-v8-gicv2.dtsi vendor/device-tree/dist/src/arm64/arm/foundation-v8-gicv3.dtsi vendor/device-tree/dist/src/arm64/arm/foundation-v8.dtsi vendor/device-tree/dist/src/arm64/arm/juno-base.dtsi vendor/device-tree/dist/src/arm64/arm/juno-r1.dts vendor/device-tree/dist/src/arm64/arm/juno-r2.dts vendor/device-tree/dist/src/arm64/arm/juno.dts vendor/device-tree/dist/src/arm64/arm/rtsm_ve-aemv8a.dts vendor/device-tree/dist/src/arm64/arm/rtsm_ve-motherboard.dtsi vendor/device-tree/dist/src/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts vendor/device-tree/dist/src/arm64/arm/vexpress-v2m-rs1.dtsi vendor/device-tree/dist/src/arm64/broadcom/northstar2/ns2.dtsi vendor/device-tree/dist/src/arm64/broadcom/stingray/stingray.dtsi vendor/device-tree/dist/src/arm64/cavium/thunder-88xx.dtsi vendor/device-tree/dist/src/arm64/cavium/thunder2-99xx.dtsi vendor/device-tree/dist/src/arm64/exynos/exynos5433.dtsi vendor/device-tree/dist/src/arm64/exynos/exynos7.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1028a-rdb.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1028a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1043a-qds.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1043a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1046a-qds.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1046a-rdb.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1046a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1088a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls208xa.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-lx2160a-rdb.dts vendor/device-tree/dist/src/arm64/freescale/fsl-lx2160a.dtsi vendor/device-tree/dist/src/arm64/freescale/imx8mq-evk.dts vendor/device-tree/dist/src/arm64/freescale/imx8mq.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi3660-hikey960.dts vendor/device-tree/dist/src/arm64/hisilicon/hi3660.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi3670.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi3798cv200-poplar.dts vendor/device-tree/dist/src/arm64/hisilicon/hi3798cv200.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi6220-hikey.dts vendor/device-tree/dist/src/arm64/hisilicon/hi6220.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hip05.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hip06.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hip07.dtsi vendor/device-tree/dist/src/arm64/lg/lg1312.dtsi vendor/device-tree/dist/src/arm64/lg/lg1313.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-3720-espressobin.dts vendor/device-tree/dist/src/arm64/marvell/armada-372x.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-37xx.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-7040-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-8040-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-ap806-dual.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-ap806-quad.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-ap806.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-ap810-ap0-octa-core.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-cp110.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt2712-evb.dts vendor/device-tree/dist/src/arm64/mediatek/mt2712e.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt6797-evb.dts vendor/device-tree/dist/src/arm64/mediatek/mt6797-x20-dev.dts vendor/device-tree/dist/src/arm64/mediatek/mt6797.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt7622.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt8173.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra132.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra186-p2771-0000.dts vendor/device-tree/dist/src/arm64/nvidia/tegra186-p3310.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra186.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra194-p2888.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra194-p2972-0000.dts vendor/device-tree/dist/src/arm64/nvidia/tegra194.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra210-p2371-2180.dts vendor/device-tree/dist/src/arm64/nvidia/tegra210-p2597.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra210-smaug.dts vendor/device-tree/dist/src/arm64/nvidia/tegra210.dtsi vendor/device-tree/dist/src/arm64/qcom/apq8016-sbc.dtsi vendor/device-tree/dist/src/arm64/qcom/ipq8074.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8916.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8992.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8994.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8996-pins.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8996.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8998-mtp.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8998.dtsi vendor/device-tree/dist/src/arm64/qcom/pm8005.dtsi vendor/device-tree/dist/src/arm64/qcom/pm8916.dtsi vendor/device-tree/dist/src/arm64/qcom/pm8998.dtsi vendor/device-tree/dist/src/arm64/qcom/pmi8994.dtsi vendor/device-tree/dist/src/arm64/qcom/pmi8998.dtsi vendor/device-tree/dist/src/arm64/qcom/pms405.dtsi vendor/device-tree/dist/src/arm64/qcom/qcs404-evb.dtsi vendor/device-tree/dist/src/arm64/qcom/qcs404.dtsi vendor/device-tree/dist/src/arm64/qcom/sdm845-mtp.dts vendor/device-tree/dist/src/arm64/qcom/sdm845.dtsi vendor/device-tree/dist/src/arm64/realtek/rtd1295.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a774a1.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a7795.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a7796-salvator-xs.dts vendor/device-tree/dist/src/arm64/renesas/r8a7796.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77965.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77970-v3msk.dts vendor/device-tree/dist/src/arm64/renesas/r8a77970.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77980.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77990-ebisu.dts vendor/device-tree/dist/src/arm64/renesas/r8a77990.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77995-draak.dts vendor/device-tree/dist/src/arm64/renesas/r8a77995.dtsi vendor/device-tree/dist/src/arm64/renesas/salvator-common.dtsi vendor/device-tree/dist/src/arm64/renesas/ulcb-kf.dtsi vendor/device-tree/dist/src/arm64/renesas/ulcb.dtsi vendor/device-tree/dist/src/arm64/rockchip/px30.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3328-roc-cc.dts vendor/device-tree/dist/src/arm64/rockchip/rk3328-rock64.dts vendor/device-tree/dist/src/arm64/rockchip/rk3328.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3368-evb.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3368-geekbox.dts vendor/device-tree/dist/src/arm64/rockchip/rk3368-lion.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3368-orion-r68-meta.dts vendor/device-tree/dist/src/arm64/rockchip/rk3368-px5-evb.dts vendor/device-tree/dist/src/arm64/rockchip/rk3368-r88.dts vendor/device-tree/dist/src/arm64/rockchip/rk3368.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399-gru-chromebook.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399-gru-scarlet.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399-gru.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399-rock960.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399-rockpro64.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-sapphire-excavator.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-ld11.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20-global.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-pxs3-ref.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-pxs3.dtsi vendor/device-tree/dist/src/arm64/sprd/sc2731.dtsi vendor/device-tree/dist/src/arm64/sprd/sc9836.dtsi vendor/device-tree/dist/src/arm64/sprd/sc9860.dtsi vendor/device-tree/dist/src/arm64/sprd/sp9860g-1h10.dts vendor/device-tree/dist/src/arm64/synaptics/as370.dtsi vendor/device-tree/dist/src/arm64/synaptics/berlin4ct.dtsi vendor/device-tree/dist/src/arm64/ti/k3-am65-main.dtsi vendor/device-tree/dist/src/arm64/ti/k3-am65-mcu.dtsi vendor/device-tree/dist/src/arm64/ti/k3-am654-base-board.dts vendor/device-tree/dist/src/arm64/ti/k3-am654.dtsi vendor/device-tree/dist/src/arm64/xilinx/zynqmp-zcu100-revC.dts vendor/device-tree/dist/src/arm64/xilinx/zynqmp.dtsi vendor/device-tree/dist/src/arm64/zte/zx296718.dtsi vendor/device-tree/dist/src/mips/cavium-octeon/octeon_3xxx.dts vendor/device-tree/dist/src/mips/cavium-octeon/ubnt_e100.dts vendor/device-tree/dist/src/powerpc/akebono.dts vendor/device-tree/dist/src/powerpc/bluestone.dts vendor/device-tree/dist/src/powerpc/currituck.dts vendor/device-tree/dist/src/powerpc/iss4xx-mpic.dts vendor/device-tree/dist/src/powerpc/wii.dts Modified: vendor/device-tree/dist/Bindings/Makefile ============================================================================== --- vendor/device-tree/dist/Bindings/Makefile Wed May 8 18:56:24 2019 (r347362) +++ vendor/device-tree/dist/Bindings/Makefile Wed May 8 19:00:46 2019 (r347363) @@ -15,7 +15,7 @@ DT_TMP_SCHEMA := processed-schema.yaml extra-y += $(DT_TMP_SCHEMA) quiet_cmd_mk_schema = SCHEMA $@ - cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(filter-out FORCE, $^) + cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(real-prereqs) DT_DOCS = $(shell \ cd $(srctree)/$(src) && \ Modified: vendor/device-tree/dist/Bindings/arm/amlogic.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/amlogic.txt Wed May 8 18:56:24 2019 (r347362) +++ vendor/device-tree/dist/Bindings/arm/amlogic.txt Wed May 8 19:00:46 2019 (r347363) @@ -109,6 +109,7 @@ Board compatible values (alphabetically, grouped by So - "amlogic,s400" (Meson axg a113d) - "amlogic,u200" (Meson g12a s905d2) + - "amediatech,x96-max" (Meson g12a s905x2) Amlogic Meson Firmware registers Interface ------------------------------------------ Modified: vendor/device-tree/dist/Bindings/arm/atmel-sysregs.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/atmel-sysregs.txt Wed May 8 18:56:24 2019 (r347362) +++ vendor/device-tree/dist/Bindings/arm/atmel-sysregs.txt Wed May 8 19:00:46 2019 (r347363) @@ -21,7 +21,8 @@ Its subnodes can be: RSTC Reset Controller required properties: - compatible: Should be "atmel,-rstc". - can be "at91sam9260" or "at91sam9g45" or "sama5d3" + can be "at91sam9260", "at91sam9g45", "sama5d3" or "samx7" + it also can be "microchip,sam9x60-rstc" - reg: Should contain registers location and length - clocks: phandle to input clock. @@ -147,6 +148,7 @@ required properties: - compatible: Should be "atmel,-sfr", "syscon" or "atmel,-sfrbu", "syscon" can be "sama5d3", "sama5d4" or "sama5d2". + It also can be "microchip,sam9x60-sfr", "syscon". - reg: Should contain registers location and length sfr@f0038000 { Modified: vendor/device-tree/dist/Bindings/arm/bcm/brcm,bcm2835.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/bcm/brcm,bcm2835.txt Wed May 8 18:56:24 2019 (r347362) +++ vendor/device-tree/dist/Bindings/arm/bcm/brcm,bcm2835.txt Wed May 8 19:00:46 2019 (r347363) @@ -30,6 +30,10 @@ Raspberry Pi 2 Model B Required root node properties: compatible = "raspberrypi,2-model-b", "brcm,bcm2836"; +Raspberry Pi 3 Model A+ +Required root node properties: +compatible = "raspberrypi,3-model-a-plus", "brcm,bcm2837"; + Raspberry Pi 3 Model B Required root node properties: compatible = "raspberrypi,3-model-b", "brcm,bcm2837"; Added: vendor/device-tree/dist/Bindings/arm/bitmain.yaml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/bitmain.yaml Wed May 8 19:00:46 2019 (r347363) @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/bitmain.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Bitmain platform device tree bindings + +maintainers: + - Manivannan Sadhasivam + +properties: + compatible: + items: + - enum: + - bitmain,sophon-edge + - const: bitmain,bm1880 +... Modified: vendor/device-tree/dist/Bindings/arm/cpus.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/cpus.yaml Wed May 8 18:56:24 2019 (r347362) +++ vendor/device-tree/dist/Bindings/arm/cpus.yaml Wed May 8 19:00:46 2019 (r347363) @@ -228,6 +228,7 @@ patternProperties: - renesas,r9a06g032-smp - rockchip,rk3036-smp - rockchip,rk3066-smp + - socionext,milbeaut-m10v-smp - ste,dbx500-smp cpu-release-addr: Added: vendor/device-tree/dist/Bindings/arm/freescale/fsl,imx7ulp-sim.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/freescale/fsl,imx7ulp-sim.txt Wed May 8 19:00:46 2019 (r347363) @@ -0,0 +1,16 @@ +Freescale i.MX7ULP System Integration Module +---------------------------------------------- +The system integration module (SIM) provides system control and chip configuration +registers. In this module, chip revision information is located in JTAG ID register, +and a set of registers have been made available in DGO domain for SW use, with the +objective to maintain its value between system resets. + +Required properties: +- compatible: Should be "fsl,imx7ulp-sim". +- reg: Specifies base physical address and size of the register sets. + +Example: +sim: sim@410a3000 { + compatible = "fsl,imx7ulp-sim", "syscon"; + reg = <0x410a3000 0x1000>; +}; Modified: vendor/device-tree/dist/Bindings/arm/freescale/fsl,scu.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/freescale/fsl,scu.txt Wed May 8 18:56:24 2019 (r347362) +++ vendor/device-tree/dist/Bindings/arm/freescale/fsl,scu.txt Wed May 8 19:00:46 2019 (r347363) @@ -58,7 +58,11 @@ This binding for the SCU power domain providers uses t domain binding[2]. Required properties: -- compatible: Should be "fsl,imx8qxp-scu-pd". +- compatible: Should be one of: + "fsl,imx8qm-scu-pd", + "fsl,imx8qxp-scu-pd" + followed by "fsl,scu-pd" + - #power-domain-cells: Must be 1. Contains the Resource ID used by SCU commands. See detailed Resource ID list from: @@ -70,7 +74,10 @@ Clock bindings based on SCU Message Protocol This binding uses the common clock binding[1]. Required properties: -- compatible: Should be "fsl,imx8qxp-clock". +- compatible: Should be one of: + "fsl,imx8qm-clock" + "fsl,imx8qxp-clock" + followed by "fsl,scu-clk" - #clock-cells: Should be 1. Contains the Clock ID value. - clocks: List of clock specifiers, must contain an entry for each required entry in clock-names @@ -137,7 +144,7 @@ firmware { &lsio_mu1 1 3>; clk: clk { - compatible = "fsl,imx8qxp-clk"; + compatible = "fsl,imx8qxp-clk", "fsl,scu-clk"; #clock-cells = <1>; }; @@ -154,7 +161,7 @@ firmware { }; pd: imx8qx-pd { - compatible = "fsl,imx8qxp-scu-pd"; + compatible = "fsl,imx8qxp-scu-pd", "fsl,scu-pd"; #power-domain-cells = <1>; }; Added: vendor/device-tree/dist/Bindings/arm/fsl.yaml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/fsl.yaml Wed May 8 19:00:46 2019 (r347363) @@ -0,0 +1,232 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/bindings/arm/fsl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale i.MX Platforms Device Tree Bindings + +maintainers: + - Shawn Guo + - Li Yang + +properties: + $nodename: + const: '/' + compatible: + oneOf: + - description: i.MX23 based Boards + items: + - enum: + - fsl,imx23-evk + - olimex,imx23-olinuxino + - const: fsl,imx23 + + - description: i.MX25 Product Development Kit + items: + - enum: + - fsl,imx25-pdk + - const: fsl,imx25 + + - description: i.MX27 Product Development Kit + items: + - enum: + - fsl,imx27-pdk + - const: fsl,imx27 + + - description: i.MX28 based Boards + items: + - enum: + - fsl,imx28-evk + - i2se,duckbill + - i2se,duckbill-2 + - technologic,imx28-ts4600 + - const: fsl,imx28 + - description: i.MX28 Duckbill 2 based Boards + items: + - enum: + - i2se,duckbill-2-485 + - i2se,duckbill-2-enocean + - i2se,duckbill-2-spi + - const: i2se,duckbill-2 + - const: fsl,imx28 + + - description: i.MX51 Babbage Board + items: + - enum: + - armadeus,imx51-apf51 + - fsl,imx51-babbage + - technologic,imx51-ts4800 + - const: fsl,imx51 + + - description: i.MX53 based Boards + items: + - enum: + - bhf,cx9020 + - fsl,imx53-ard + - fsl,imx53-evk + - fsl,imx53-qsb + - fsl,imx53-smd + - const: fsl,imx53 + + - description: i.MX6Q based Boards + items: + - enum: + - fsl,imx6q-arm2 + - fsl,imx6q-sabreauto + - fsl,imx6q-sabrelite + - fsl,imx6q-sabresd + - technologic,imx6q-ts4900 + - technologic,imx6q-ts7970 + - const: fsl,imx6q + + - description: i.MX6QP based Boards + items: + - enum: + - fsl,imx6qp-sabreauto # i.MX6 Quad Plus SABRE Automotive Board + - fsl,imx6qp-sabresd # i.MX6 Quad Plus SABRE Smart Device Board + - const: fsl,imx6qp + + - description: i.MX6DL based Boards + items: + - enum: + - fsl,imx6dl-sabreauto # i.MX6 DualLite/Solo SABRE Automotive Board + - fsl,imx6dl-sabresd # i.MX6 DualLite SABRE Smart Device Board + - technologic,imx6dl-ts4900 + - technologic,imx6dl-ts7970 + - ysoft,imx6dl-yapp4-draco # i.MX6 DualLite Y Soft IOTA Draco board + - ysoft,imx6dl-yapp4-hydra # i.MX6 DualLite Y Soft IOTA Hydra board + - ysoft,imx6dl-yapp4-ursa # i.MX6 Solo Y Soft IOTA Ursa board + - const: fsl,imx6dl + + - description: i.MX6SL based Boards + items: + - enum: + - fsl,imx6sl-evk # i.MX6 SoloLite EVK Board + - const: fsl,imx6sl + + - description: i.MX6SLL based Boards + items: + - enum: + - fsl,imx6sll-evk + - const: fsl,imx6sll + + - description: i.MX6SX based Boards + items: + - enum: + - fsl,imx6sx-sabreauto # i.MX6 SoloX Sabre Auto Board + - fsl,imx6sx-sdb # i.MX6 SoloX SDB Board + - const: fsl,imx6sx + + - description: i.MX6UL based Boards + items: + - enum: + - fsl,imx6ul-14x14-evk # i.MX6 UltraLite 14x14 EVK Board + - const: fsl,imx6ul + + - description: i.MX6ULL based Boards + items: + - enum: + - fsl,imx6ull-14x14-evk # i.MX6 UltraLiteLite 14x14 EVK Board + - const: fsl,imx6ull + + - description: i.MX6ULZ based Boards + items: + - enum: + - fsl,imx6ulz-14x14-evk # i.MX6 ULZ 14x14 EVK Board + - const: fsl,imx6ull # This seems odd. Should be last? + - const: fsl,imx6ulz + + - description: i.MX7D based Boards + items: + - enum: + - fsl,imx7d-sdb # i.MX7 SabreSD Board + - const: fsl,imx7d + + - description: + Compulab SBC-iMX7 is a single board computer based on the + Freescale i.MX7 system-on-chip. SBC-iMX7 is implemented with + the CL-SOM-iMX7 System-on-Module providing most of the functions, + and SB-SOM-iMX7 carrier board providing additional peripheral + functions and connectors. + items: + - const: compulab,sbc-imx7 + - const: compulab,cl-som-imx7 + - const: fsl,imx7d + + - description: i.MX8QXP based Boards + items: + - enum: + - fsl,imx8qxp-mek # i.MX8QXP MEK Board + - const: fsl,imx8qxp + + - description: + Freescale Vybrid Platform Device Tree Bindings + + For the Vybrid SoC familiy all variants with DDR controller are supported, + which is the VF5xx and VF6xx series. Out of historical reasons, in most + places the kernel uses vf610 to refer to the whole familiy. + The compatible string "fsl,vf610m4" is used for the secondary Cortex-M4 + core support. + items: + - enum: + - fsl,vf500 + - fsl,vf510 + - fsl,vf600 + - fsl,vf610 + - fsl,vf610m4 + + - description: LS1012A based Boards + items: + - enum: + - ebs-systart,oxalis + - fsl,ls1012a-rdb + - fsl,ls1012a-frdm + - fsl,ls1012a-qds + - const: fsl,ls1012a + + - description: LS1021A based Boards + items: + - enum: + - fsl,ls1021a-moxa-uc-8410a + - fsl,ls1021a-qds + - fsl,ls1021a-twr + - const: fsl,ls1021a + + - description: LS1043A based Boards + items: + - enum: + - fsl,ls1043a-rdb + - fsl,ls1043a-qds + - const: fsl,ls1043a + + - description: LS1046A based Boards + items: + - enum: + - fsl,ls1046a-qds + - fsl,ls1046a-rdb + - const: fsl,ls1046a + + - description: LS1088A based Boards + items: + - enum: + - fsl,ls1088a-qds + - fsl,ls1088a-rdb + - const: fsl,ls1088a + + - description: LS2080A based Boards + items: + - enum: + - fsl,ls2080a-simu + - fsl,ls2080a-qds + - fsl,ls2080a-rdb + - const: fsl,ls2080a + + - description: LS2088A based Boards + items: + - enum: + - fsl,ls2088a-qds + - fsl,ls2088a-rdb + - const: fsl,ls2088a + +... Added: vendor/device-tree/dist/Bindings/arm/l2c2x0.yaml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/l2c2x0.yaml Wed May 8 19:00:46 2019 (r347363) @@ -0,0 +1,248 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/l2c2x0.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ARM L2 Cache Controller + +maintainers: + - Rob Herring + +description: |+ + ARM cores often have a separate L2C210/L2C220/L2C310 (also known as PL210/ + PL220/PL310 and variants) based level 2 cache controller. All these various + implementations of the L2 cache controller have compatible programming + models (Note 1). Some of the properties that are just prefixed "cache-*" are + taken from section 3.7.3 of the Devicetree Specification which can be found + at: + https://www.devicetree.org/specifications/ + + Note 1: The description in this document doesn't apply to integrated L2 + cache controllers as found in e.g. Cortex-A15/A7/A57/A53. These + integrated L2 controllers are assumed to be all preconfigured by + early secure boot code. Thus no need to deal with their configuration + in the kernel at all. + +allOf: + - $ref: /schemas/cache-controller.yaml# + +properties: + compatible: + enum: + - arm,pl310-cache + - arm,l220-cache + - arm,l210-cache + # DEPRECATED by "brcm,bcm11351-a2-pl310-cache" + - bcm,bcm11351-a2-pl310-cache + # For Broadcom bcm11351 chipset where an + # offset needs to be added to the address before passing down to the L2 + # cache controller + - brcm,bcm11351-a2-pl310-cache + # Marvell Controller designed to be + # compatible with the ARM one, with system cache mode (meaning + # maintenance operations on L1 are broadcasted to the L2 and L2 + # performs the same operation). + - marvell,aurora-system-cache + # Marvell Controller designed to be + # compatible with the ARM one with outer cache mode. + - marvell,aurora-outer-cache + # Marvell Tauros3 cache controller, compatible + # with arm,pl310-cache controller. + - marvell,tauros3-cache + + cache-level: + const: 2 + + cache-unified: true + cache-size: true + cache-sets: true + cache-block-size: true + cache-line-size: true + + reg: + maxItems: 1 + + arm,data-latency: + description: Cycles of latency for Data RAM accesses. Specifies 3 cells of + read, write and setup latencies. Minimum valid values are 1. Controllers + without setup latency control should use a value of 0. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32-array + - minItems: 2 + maxItems: 3 + items: + minimum: 0 + maximum: 8 + + arm,tag-latency: + description: Cycles of latency for Tag RAM accesses. Specifies 3 cells of + read, write and setup latencies. Controllers without setup latency control + should use 0. Controllers without separate read and write Tag RAM latency + values should only use the first cell. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32-array + - minItems: 1 + maxItems: 3 + items: + minimum: 0 + maximum: 8 + + arm,dirty-latency: + description: Cycles of latency for Dirty RAMs. This is a single cell. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - minimum: 1 + maximum: 8 + + arm,filter-ranges: + description: Starting address and length of window to + filter. Addresses in the filter window are directed to the M1 port. Other + addresses will go to the M0 port. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32-array + - items: + minItems: 2 + maxItems: 2 + + arm,io-coherent: + description: indicates that the system is operating in an hardware + I/O coherent mode. Valid only when the arm,pl310-cache compatible + string is used. + type: boolean + + interrupts: + # Either a single combined interrupt or up to 9 individual interrupts + minItems: 1 + maxItems: 9 + + cache-id-part: + description: cache id part number to be used if it is not present + on hardware + $ref: /schemas/types.yaml#/definitions/uint32 + + wt-override: + description: If present then L2 is forced to Write through mode + type: boolean + + arm,double-linefill: + description: Override double linefill enable setting. Enable if + non-zero, disable if zero. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [ 0, 1 ] + + arm,double-linefill-incr: + description: Override double linefill on INCR read. Enable + if non-zero, disable if zero. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [ 0, 1 ] + + arm,double-linefill-wrap: + description: Override double linefill on WRAP read. Enable + if non-zero, disable if zero. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [ 0, 1 ] + + arm,prefetch-drop: + description: Override prefetch drop enable setting. Enable if non-zero, + disable if zero. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [ 0, 1 ] + + arm,prefetch-offset: + description: Override prefetch offset value. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [ 0, 1, 2, 3, 4, 5, 6, 7, 15, 23, 31 ] + + arm,shared-override: + description: The default behavior of the L220 or PL310 cache + controllers with respect to the shareable attribute is to transform "normal + memory non-cacheable transactions" into "cacheable no allocate" (for reads) + or "write through no write allocate" (for writes). + On systems where this may cause DMA buffer corruption, this property must + be specified to indicate that such transforms are precluded. + type: boolean + + arm,parity-enable: + description: enable parity checking on the L2 cache (L220 or PL310). + type: boolean + + arm,parity-disable: + description: disable parity checking on the L2 cache (L220 or PL310). + type: boolean + + arm,outer-sync-disable: + description: disable the outer sync operation on the L2 cache. + Some core tiles, especially ARM PB11MPCore have a faulty L220 cache that + will randomly hang unless outer sync operations are disabled. + type: boolean + + prefetch-data: + description: | + Data prefetch. Value: <0> (forcibly disable), <1> + (forcibly enable), property absent (retain settings set by firmware) + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [ 0, 1 ] + + prefetch-instr: + description: | + Instruction prefetch. Value: <0> (forcibly disable), + <1> (forcibly enable), property absent (retain settings set by + firmware) + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [ 0, 1 ] + + arm,dynamic-clock-gating: + description: | + L2 dynamic clock gating. Value: <0> (forcibly + disable), <1> (forcibly enable), property absent (OS specific behavior, + preferably retain firmware settings) + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [ 0, 1 ] + + arm,standby-mode: + description: L2 standby mode enable. Value <0> (forcibly disable), + <1> (forcibly enable), property absent (OS specific behavior, + preferably retain firmware settings) + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [ 0, 1 ] + + arm,early-bresp-disable: + description: Disable the CA9 optimization Early BRESP (PL310) + type: boolean + + arm,full-line-zero-disable: + description: Disable the CA9 optimization Full line of zero + write (PL310) + type: boolean + +required: + - compatible + - cache-unified + - reg + +additionalProperties: false + +examples: + - | + cache-controller@fff12000 { + compatible = "arm,pl310-cache"; + reg = <0xfff12000 0x1000>; + arm,data-latency = <1 1 1>; + arm,tag-latency = <2 2 2>; + arm,filter-ranges = <0x80000000 0x8000000>; + cache-unified; + cache-level = <2>; + interrupts = <45>; + }; + +... Modified: vendor/device-tree/dist/Bindings/arm/mediatek.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek.txt Wed May 8 18:56:24 2019 (r347362) +++ vendor/device-tree/dist/Bindings/arm/mediatek.txt Wed May 8 19:00:46 2019 (r347363) @@ -15,11 +15,12 @@ compatible: Must contain one of "mediatek,mt6795" "mediatek,mt6797" "mediatek,mt7622" - "mediatek,mt7623" which is referred to MT7623N SoC - "mediatek,mt7623a" + "mediatek,mt7623" + "mediatek,mt7629" "mediatek,mt8127" "mediatek,mt8135" "mediatek,mt8173" + "mediatek,mt8183" Supported boards: @@ -57,6 +58,9 @@ Supported boards: - Reference board variant 1 for MT7622: Required root node properties: - compatible = "mediatek,mt7622-rfb1", "mediatek,mt7622"; +- Bananapi BPI-R64 for MT7622: + Required root node properties: + - compatible = "bananapi,bpi-r64", "mediatek,mt7622"; - Reference board for MT7623a with eMMC: Required root node properties: - compatible = "mediatek,mt7623a-rfb-emmc", "mediatek,mt7623"; @@ -68,6 +72,9 @@ Supported boards: - compatible = "mediatek,mt7623n-rfb-emmc", "mediatek,mt7623"; - Bananapi BPI-R2 board: - compatible = "bananapi,bpi-r2", "mediatek,mt7623"; +- Reference board for MT7629: + Required root node properties: + - compatible = "mediatek,mt7629-rfb", "mediatek,mt7629"; - MTK mt8127 tablet moose EVB: Required root node properties: - compatible = "mediatek,mt8127-moose", "mediatek,mt8127"; @@ -77,3 +84,6 @@ Supported boards: - MTK mt8173 tablet EVB: Required root node properties: - compatible = "mediatek,mt8173-evb", "mediatek,mt8173"; +- Evaluation board for MT8183: + Required root node properties: + - compatible = "mediatek,mt8183-evb", "mediatek,mt8183"; Added: vendor/device-tree/dist/Bindings/arm/pmu.yaml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/pmu.yaml Wed May 8 19:00:46 2019 (r347363) @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/pmu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ARM Performance Monitor Units + +maintainers: + - Mark Rutland + - Will Deacon + +description: |+ + ARM cores often have a PMU for counting cpu and cache events like cache misses + and hits. The interface to the PMU is part of the ARM ARM. The ARM PMU + representation in the device tree should be done as under:- + +properties: + compatible: + items: + - enum: + - apm,potenza-pmu + - arm,armv8-pmuv3 + - arm,cortex-a73-pmu + - arm,cortex-a72-pmu + - arm,cortex-a57-pmu + - arm,cortex-a53-pmu + - arm,cortex-a35-pmu + - arm,cortex-a17-pmu + - arm,cortex-a15-pmu + - arm,cortex-a12-pmu + - arm,cortex-a9-pmu + - arm,cortex-a8-pmu + - arm,cortex-a7-pmu + - arm,cortex-a5-pmu + - arm,arm11mpcore-pmu + - arm,arm1176-pmu + - arm,arm1136-pmu + - brcm,vulcan-pmu + - cavium,thunder-pmu + - qcom,scorpion-pmu + - qcom,scorpion-mp-pmu + - qcom,krait-pmu + + interrupts: + # Don't know how many CPUs, so no constraints to specify + description: 1 per-cpu interrupt (PPI) or 1 interrupt per core. + + interrupt-affinity: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + When using SPIs, specifies a list of phandles to CPU + nodes corresponding directly to the affinity of + the SPIs listed in the interrupts property. + + When using a PPI, specifies a list of phandles to CPU + nodes corresponding to the set of CPUs which have + a PMU of this type signalling the PPI listed in the + interrupts property, unless this is already specified + by the PPI interrupt specifier itself (in which case + the interrupt-affinity property shouldn't be present). + + This property should be present when there is more than + a single SPI. + + qcom,no-pc-write: + type: boolean + description: + Indicates that this PMU doesn't support the 0xc and 0xd events. + + secure-reg-access: + type: boolean + description: + Indicates that the ARMv7 Secure Debug Enable Register + (SDER) is accessible. This will cause the driver to do + any setup required that is only possible in ARMv7 secure + state. If not present the ARMv7 SDER will not be touched, + which means the PMU may fail to operate unless external + code (bootloader or security monitor) has performed the + appropriate initialisation. Note that this property is + not valid for non-ARMv7 CPUs or ARMv7 CPUs booting Linux + in Non-secure state. + +required: + - compatible + +... Added: vendor/device-tree/dist/Bindings/arm/renesas.yaml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/renesas.yaml Wed May 8 19:00:46 2019 (r347363) @@ -0,0 +1,238 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/shmobile.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Renesas SH-Mobile, R-Mobile, and R-Car Platform Device Tree Bindings + +maintainers: + - Geert Uytterhoeven + +properties: + $nodename: + const: '/' + compatible: + oneOf: + - description: Emma Mobile EV2 + items: + - enum: + - renesas,kzm9d # Kyoto Microcomputer Co. KZM-A9-Dual + - const: renesas,emev2 + + - description: RZ/A1H (R7S72100) + items: + - enum: + - renesas,genmai # Genmai (RTK772100BC00000BR) + - renesas,gr-peach # GR-Peach (X28A-M01-E/F) + - renesas,rskrza1 # RSKRZA1 (YR0K77210C000BE) + - const: renesas,r7s72100 + + - description: RZ/A2 (R7S9210) + items: + - enum: + - renesas,rza2mevb # RZ/A2M Eval Board (RTK7921053S00000BE) + - const: renesas,r7s9210 + + - description: SH-Mobile AG5 (R8A73A00/SH73A0) + items: + - enum: + - renesas,kzm9g # Kyoto Microcomputer Co. KZM-A9-GT + - const: renesas,sh73a0 + + - description: R-Mobile APE6 (R8A73A40) + items: + - enum: + - renesas,ape6evm + - const: renesas,r8a73a4 + + - description: R-Mobile A1 (R8A77400) + items: + - enum: + - renesas,armadillo800eva # Atmark Techno Armadillo-800 EVA + - const: renesas,r8a7740 + + - description: RZ/G1H (R8A77420) + items: + - const: renesas,r8a7742 + + - description: RZ/G1M (R8A77430) + items: + - enum: + # iWave Systems RZ/G1M Qseven Development Platform (iW-RainboW-G20D-Qseven) + - iwave,g20d + - const: iwave,g20m + - const: renesas,r8a7743 + + - items: + - enum: + # iWave Systems RZ/G1M Qseven System On Module (iW-RainboW-G20M-Qseven) + - iwave,g20m + - renesas,sk-rzg1m # SK-RZG1M (YR8A77430S000BE) + - const: renesas,r8a7743 + + - description: RZ/G1N (R8A77440) + items: + - enum: + # iWave Systems RZ/G1N Qseven Development Platform (iW-RainboW-G20D-Qseven) + - iwave,g20d + - const: iwave,g20m + - const: renesas,r8a7744 + + - items: + - enum: + # iWave Systems RZ/G1N Qseven System On Module (iW-RainboW-G20M-Qseven) + - iwave,g20m + - const: renesas,r8a7744 + + - description: RZ/G1E (R8A77450) + items: + - enum: + - iwave,g22m # iWave Systems RZ/G1E SODIMM System On Module (iW-RainboW-G22M-SM) + - renesas,sk-rzg1e # SK-RZG1E (YR8A77450S000BE) + - const: renesas,r8a7745 + + - description: iWave Systems RZ/G1E SODIMM SOM Development Platform (iW-RainboW-G22D) + items: + - const: iwave,g22d + - const: iwave,g22m + - const: renesas,r8a7745 + + - description: RZ/G1C (R8A77470) + items: + - enum: + - iwave,g23s #iWave Systems RZ/G1C Single Board Computer (iW-RainboW-G23S) + - const: renesas,r8a77470 + + - description: RZ/G2M (R8A774A1) + items: + - const: renesas,r8a774a1 + + - description: RZ/G2E (R8A774C0) + items: + - enum: + - si-linux,cat874 # Silicon Linux RZ/G2E 96board platform (CAT874) + - const: renesas,r8a774c0 + + - items: + - enum: + - si-linux,cat875 # Silicon Linux sub board for CAT874 (CAT875) + - const: si-linux,cat874 + - const: renesas,r8a774c0 + + - description: R-Car M1A (R8A77781) + items: + - enum: + - renesas,bockw + - const: renesas,r8a7778 + + - description: R-Car H1 (R8A77790) + items: + - enum: + - renesas,marzen # Marzen (R0P7779A00010S) + - const: renesas,r8a7779 + + - description: R-Car H2 (R8A77900) + items: + - enum: + - renesas,lager # Lager (RTP0RC7790SEB00010S) + - renesas,stout # Stout (ADAS Starterkit, Y-R-CAR-ADAS-SKH2-BOARD) + - const: renesas,r8a7790 + + - description: R-Car M2-W (R8A77910) + items: + - enum: + - renesas,henninger + - renesas,koelsch # Koelsch (RTP0RC7791SEB00010S) + - renesas,porter # Porter (M2-LCDP) + - const: renesas,r8a7791 + + - description: R-Car V2H (R8A77920) + items: + - enum: + - renesas,blanche # Blanche (RTP0RC7792SEB00010S) + - renesas,wheat # Wheat (RTP0RC7792ASKB0000JE) + - const: renesas,r8a7792 + + - description: R-Car M2-N (R8A77930) + items: + - enum: + - renesas,gose # Gose (RTP0RC7793SEB00010S) + - const: renesas,r8a7793 + + - description: R-Car E2 (R8A77940) + items: + - enum: + - renesas,alt # Alt (RTP0RC7794SEB00010S) + - renesas,silk # SILK (RTP0RC7794LCB00011S) + - const: renesas,r8a7794 + + - description: R-Car H3 (R8A77950) + items: + - enum: + # H3ULCB (R-Car Starter Kit Premier, RTP0RC7795SKBX0010SA00 (H3 ES1.1)) + # H3ULCB (R-Car Starter Kit Premier, RTP0RC77951SKBX010SA00 (H3 ES2.0)) + - renesas,h3ulcb + - renesas,salvator-x # Salvator-X (RTP0RC7795SIPB0010S) + - renesas,salvator-xs # Salvator-XS (Salvator-X 2nd version, RTP0RC7795SIPB0012S) + - const: renesas,r8a7795 + + - description: R-Car M3-W (R8A77960) + items: + - enum: + - renesas,m3ulcb # M3ULCB (R-Car Starter Kit Pro, RTP0RC7796SKBX0010SA09 (M3 ES1.0)) + - renesas,salvator-x # Salvator-X (RTP0RC7796SIPB0011S) + - renesas,salvator-xs # Salvator-XS (Salvator-X 2nd version, RTP0RC7796SIPB0012S) + - const: renesas,r8a7796 + + - description: Kingfisher (SBEV-RCAR-KF-M03) + items: + - const: shimafuji,kingfisher + - enum: + - renesas,h3ulcb + - renesas,m3ulcb + - enum: + - renesas,r8a7795 + - renesas,r8a7796 + + - description: R-Car M3-N (R8A77965) + items: + - enum: + - renesas,m3nulcb # M3NULCB (R-Car Starter Kit Pro, RTP0RC77965SKBX010SA00 (M3-N ES1.1)) + - renesas,salvator-x # Salvator-X (RTP0RC7796SIPB0011S (M3-N)) + - renesas,salvator-xs # Salvator-XS (Salvator-X 2nd version, RTP0RC77965SIPB012S) + - const: renesas,r8a77965 + + - description: R-Car V3M (R8A77970) + items: + - enum: + - renesas,eagle # Eagle (RTP0RC77970SEB0010S) + - renesas,v3msk # V3MSK (Y-ASK-RCAR-V3M-WS10) + - const: renesas,r8a77970 + + - description: R-Car V3H (R8A77980) + items: + - enum: + - renesas,condor # Condor (RTP0RC77980SEB0010SS/RTP0RC77980SEB0010SA01) + - renesas,v3hsk # V3HSK (Y-ASK-RCAR-V3H-WS10) + - const: renesas,r8a77980 + + - description: R-Car E3 (R8A77990) + items: + - enum: + - renesas,ebisu # Ebisu (RTP0RC77990SEB0010S) + - const: renesas,r8a77990 + + - description: R-Car D3 (R8A77995) + items: + - enum: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 8 19:01:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05AAE1590EAD; Wed, 8 May 2019 19:01:41 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DBC18A170; Wed, 8 May 2019 19:01:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EE369F9E; Wed, 8 May 2019 19:01:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48J1eiq021694; Wed, 8 May 2019 19:01:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48J1eYl021693; Wed, 8 May 2019 19:01:40 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905081901.x48J1eYl021693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 May 2019 19:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347364 - vendor/device-tree/5.1 X-SVN-Group: vendor X-SVN-Commit-Author: manu X-SVN-Commit-Paths: vendor/device-tree/5.1 X-SVN-Commit-Revision: 347364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9DBC18A170 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 19:01:41 -0000 Author: manu Date: Wed May 8 19:01:39 2019 New Revision: 347364 URL: https://svnweb.freebsd.org/changeset/base/347364 Log: Tag import of DTS files from Linux 5.1 Added: vendor/device-tree/5.1/ - copied from r347363, vendor/device-tree/dist/ From owner-svn-src-all@freebsd.org Wed May 8 19:05:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF866159118D; Wed, 8 May 2019 19:05:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 516E18A3FF; Wed, 8 May 2019 19:05:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 259EB9FDE; Wed, 8 May 2019 19:05:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48J5xVo022933; Wed, 8 May 2019 19:05:59 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48J5xu4022932; Wed, 8 May 2019 19:05:59 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905081905.x48J5xu4022932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 8 May 2019 19:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347365 - head/sys/dev/dme X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/dme X-SVN-Commit-Revision: 347365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 516E18A3FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 19:05:59 -0000 Author: brooks Date: Wed May 8 19:05:58 2019 New Revision: 347365 URL: https://svnweb.freebsd.org/changeset/base/347365 Log: Update dme(4) to reflect that it will not be removed due to FCP-101. dme(4) is the built-in NIC on a couple non-expandable mips platforms and thus should remain. The FCP has been updated to reflect this fact. Discussed with: imp Modified: head/sys/dev/dme/if_dme.c Modified: head/sys/dev/dme/if_dme.c ============================================================================== --- head/sys/dev/dme/if_dme.c Wed May 8 19:01:39 2019 (r347364) +++ head/sys/dev/dme/if_dme.c Wed May 8 19:05:58 2019 (r347365) @@ -916,8 +916,6 @@ dme_attach(device_t dev) goto fail; } - gone_by_fcp101_dev(dev); - fail: if (error != 0) dme_detach(dev); From owner-svn-src-all@freebsd.org Wed May 8 19:27:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECA561591A24; Wed, 8 May 2019 19:27:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92D648B201; Wed, 8 May 2019 19:27:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81308A31F; Wed, 8 May 2019 19:27:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48JRajV034206; Wed, 8 May 2019 19:27:36 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48JRW0O034184; Wed, 8 May 2019 19:27:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905081927.x48JRW0O034184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 May 2019 19:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347366 - in head/sys/gnu/dts: arm arm64/actions arm64/al arm64/allwinner arm64/altera arm64/amd arm64/amlogic arm64/apm arm64/arm arm64/bitmain arm64/broadcom arm64/broadcom/northstar2... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm arm64/actions arm64/al arm64/allwinner arm64/altera arm64/amd arm64/amlogic arm64/apm arm64/arm arm64/bitmain arm64/broadcom arm64/broadcom/northstar2 arm64/broadcom/stingray ... X-SVN-Commit-Revision: 347366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 92D648B201 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 19:27:38 -0000 Author: manu Date: Wed May 8 19:27:30 2019 New Revision: 347366 URL: https://svnweb.freebsd.org/changeset/base/347366 Log: dts: Import files from Linux 5.1 MFC after: 2 months Added: - copied unchanged from r347363, vendor/device-tree/dist/src/arm/am335x-guardian.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/am3874-iceboard.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/aspeed-bmc-inspur-on5263m5.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/bcm2837-rpi-3-a-plus.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/bcm47094-phicomm-k3.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/imx6-logicpd-baseboard.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm/imx6-logicpd-som.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm/imx6dl-yapp4-common.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm/imx6dl-yapp4-draco.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/imx6dl-yapp4-hydra.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/imx6dl-yapp4-ursa.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/imx6q-logicpd.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/imx6ul-phytec-pcl063.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm/imx6ul-phytec-peb-eval-01.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm/imx6ul-phytec-phyboard-segin-full.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/imx6ul-phytec-phyboard-segin.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm/lpc4357-myd-lpc4357.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/milbeaut-m10v-evb.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/milbeaut-m10v.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm/r7s9210-rza2mevb.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/r7s9210.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm/rv1108-elgin-r1.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/socfpga_cyclone5_chameleon96.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm/vf610-zii-ssmb-dtu.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/amlogic/meson-g12a-x96-max.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/arm/fvp-base-revc.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/arm/rtsm_ve-motherboard-rs2.dtsi head/sys/gnu/dts/arm64/bitmain/ - copied from r347363, vendor/device-tree/dist/src/arm64/bitmain/ - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/broadcom/bcm2837-rpi-3-a-plus.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a-oxalis.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/freescale/imx8mm-pinfunc.h - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/freescale/imx8qxp-mek.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/freescale/imx8qxp.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/marvell/armada-3720-uDPU.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/nvidia/tegra210-p2894-0050-a08.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/nvidia/tegra210-p2894.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/renesas/cat875.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/renesas/r8a774c0-cat874.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/renesas/r8a774c0-ek874.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/renesas/r8a774c0.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/rockchip/rk3399-nanopc-t4.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/rockchip/rk3399-nanopi-m4.dts - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/rockchip/rk3399-nanopi4.dtsi - copied unchanged from r347363, vendor/device-tree/dist/src/arm64/rockchip/rk3399-rock-pi-4.dts - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/clk/lochnagar.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/clock/actions,s500-cmu.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/clock/g12a-aoclkc.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/clock/g12a-clkc.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/clock/imx8mm-clock.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/clock/sifive-fu540-prci.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/iio/adc/ingenic,adc.h head/sys/gnu/dts/include/dt-bindings/interconnect/ - copied from r347363, vendor/device-tree/dist/include/dt-bindings/interconnect/ - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/mfd/st,stpmic1.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/pinctrl/lochnagar.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/power/qcom-rpmpd.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/power/xlnx-zynqmp-power.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/reset/amlogic,meson-g12a-reset.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/reset/g12a-aoclkc.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/reset/imx8mq-reset.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/reset/xlnx-zynqmp-resets.h - copied unchanged from r347363, vendor/device-tree/dist/include/dt-bindings/soc/bcm2835-pm.h Directory Properties: head/sys/gnu/dts/arm/am335x-guardian.dts (props changed) head/sys/gnu/dts/arm/am3874-iceboard.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-inspur-on5263m5.dts (props changed) head/sys/gnu/dts/arm/bcm2837-rpi-3-a-plus.dts (props changed) head/sys/gnu/dts/arm/bcm47094-phicomm-k3.dts (props changed) head/sys/gnu/dts/arm/imx6-logicpd-baseboard.dtsi (props changed) head/sys/gnu/dts/arm/imx6-logicpd-som.dtsi (props changed) head/sys/gnu/dts/arm/imx6dl-yapp4-common.dtsi (props changed) head/sys/gnu/dts/arm/imx6dl-yapp4-draco.dts (props changed) head/sys/gnu/dts/arm/imx6dl-yapp4-hydra.dts (props changed) head/sys/gnu/dts/arm/imx6dl-yapp4-ursa.dts (props changed) head/sys/gnu/dts/arm/imx6q-logicpd.dts (props changed) head/sys/gnu/dts/arm/imx6ul-phytec-pcl063.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul-phytec-peb-eval-01.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul-phytec-phyboard-segin-full.dts (props changed) head/sys/gnu/dts/arm/imx6ul-phytec-phyboard-segin.dtsi (props changed) head/sys/gnu/dts/arm/lpc4357-myd-lpc4357.dts (props changed) head/sys/gnu/dts/arm/milbeaut-m10v-evb.dts (props changed) head/sys/gnu/dts/arm/milbeaut-m10v.dtsi (props changed) head/sys/gnu/dts/arm/r7s9210-rza2mevb.dts (props changed) head/sys/gnu/dts/arm/r7s9210.dtsi (props changed) head/sys/gnu/dts/arm/rv1108-elgin-r1.dts (props changed) head/sys/gnu/dts/arm/socfpga_cyclone5_chameleon96.dts (props changed) head/sys/gnu/dts/arm/vf610-zii-ssmb-dtu.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-g12a-x96-max.dts (props changed) head/sys/gnu/dts/arm64/arm/fvp-base-revc.dts (props changed) head/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard-rs2.dtsi (props changed) head/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-3-a-plus.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-oxalis.dts (props changed) head/sys/gnu/dts/arm64/freescale/imx8mm-pinfunc.h (props changed) head/sys/gnu/dts/arm64/freescale/imx8qxp-mek.dts (props changed) head/sys/gnu/dts/arm64/freescale/imx8qxp.dtsi (props changed) head/sys/gnu/dts/arm64/marvell/armada-3720-uDPU.dts (props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-p2894-0050-a08.dts (props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-p2894.dtsi (props changed) head/sys/gnu/dts/arm64/renesas/cat875.dtsi (props changed) head/sys/gnu/dts/arm64/renesas/r8a774c0-cat874.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a774c0-ek874.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a774c0.dtsi (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-nanopc-t4.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-nanopi-m4.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-nanopi4.dtsi (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-rock-pi-4.dts (props changed) head/sys/gnu/dts/include/dt-bindings/clk/lochnagar.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/actions,s500-cmu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/g12a-aoclkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/g12a-clkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx8mm-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sifive-fu540-prci.h (props changed) head/sys/gnu/dts/include/dt-bindings/iio/adc/ingenic,adc.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/st,stpmic1.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/lochnagar.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/qcom-rpmpd.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/xlnx-zynqmp-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-g12a-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/g12a-aoclkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/imx8mq-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/xlnx-zynqmp-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/soc/bcm2835-pm.h (props changed) Deleted: head/sys/gnu/dts/arm/skeleton.dtsi head/sys/gnu/dts/arm/skeleton64.dtsi Modified: head/sys/gnu/dts/arm/alphascale-asm9260.dtsi (contents, props changed) head/sys/gnu/dts/arm/alpine.dtsi (contents, props changed) head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts (contents, props changed) head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts (contents, props changed) head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts (contents, props changed) head/sys/gnu/dts/arm/am335x-chiliboard.dts (contents, props changed) head/sys/gnu/dts/arm/am335x-evm.dts (contents, props changed) head/sys/gnu/dts/arm/am335x-evmsk.dts (contents, props changed) head/sys/gnu/dts/arm/am335x-icev2.dts (contents, props changed) head/sys/gnu/dts/arm/am335x-igep0033.dtsi (contents, props changed) head/sys/gnu/dts/arm/am335x-lxm.dts (contents, props changed) head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts (contents, props changed) head/sys/gnu/dts/arm/am335x-phycore-som.dtsi (contents, props changed) head/sys/gnu/dts/arm/am335x-shc.dts (contents, props changed) head/sys/gnu/dts/arm/am33xx-l4.dtsi (contents, props changed) head/sys/gnu/dts/arm/am437x-gp-evm.dts (contents, props changed) head/sys/gnu/dts/arm/am437x-l4.dtsi (contents, props changed) head/sys/gnu/dts/arm/am43x-epos-evm.dts (contents, props changed) head/sys/gnu/dts/arm/arm-realview-eb.dtsi (contents, props changed) head/sys/gnu/dts/arm/arm-realview-pb1176.dts (contents, props changed) head/sys/gnu/dts/arm/arm-realview-pb11mp.dts (contents, props changed) head/sys/gnu/dts/arm/arm-realview-pbx.dtsi (contents, props changed) head/sys/gnu/dts/arm/armada-370-rd.dts (contents, props changed) head/sys/gnu/dts/arm/armada-388-clearfog.dts (contents, props changed) head/sys/gnu/dts/arm/armada-388-clearfog.dtsi (contents, props changed) head/sys/gnu/dts/arm/armada-38x.dtsi (contents, props changed) head/sys/gnu/dts/arm/armada-39x.dtsi (contents, props changed) head/sys/gnu/dts/arm/armada-xp-linksys-mamba.dts (contents, props changed) head/sys/gnu/dts/arm/artpec6.dtsi (contents, props changed) head/sys/gnu/dts/arm/aspeed-bmc-arm-stardragon4800-rep2.dts (contents, props changed) head/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts (contents, props changed) head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts (contents, props changed) head/sys/gnu/dts/arm/aspeed-bmc-quanta-q71l.dts (contents, props changed) head/sys/gnu/dts/arm/aspeed-g4.dtsi (contents, props changed) head/sys/gnu/dts/arm/aspeed-g5.dtsi (contents, props changed) head/sys/gnu/dts/arm/at91-nattis-2-natte-2.dts (contents, props changed) head/sys/gnu/dts/arm/at91-sama5d27_som1.dtsi (contents, props changed) head/sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts (contents, props changed) head/sys/gnu/dts/arm/at91-wb45n.dts (contents, props changed) head/sys/gnu/dts/arm/at91-wb50n.dts (contents, props changed) head/sys/gnu/dts/arm/at91rm9200.dtsi (contents, props changed) head/sys/gnu/dts/arm/at91sam9260.dtsi (contents, props changed) head/sys/gnu/dts/arm/at91sam9261.dtsi (contents, props changed) head/sys/gnu/dts/arm/at91sam9263.dtsi (contents, props changed) head/sys/gnu/dts/arm/at91sam9g45.dtsi (contents, props changed) head/sys/gnu/dts/arm/at91sam9n12.dtsi (contents, props changed) head/sys/gnu/dts/arm/at91sam9rl.dtsi (contents, props changed) head/sys/gnu/dts/arm/at91sam9x5.dtsi (contents, props changed) head/sys/gnu/dts/arm/atlas6-evb.dts (contents, props changed) head/sys/gnu/dts/arm/atlas6.dtsi (contents, props changed) head/sys/gnu/dts/arm/atlas7.dtsi (contents, props changed) head/sys/gnu/dts/arm/axm55xx.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm-cygnus.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm-nsp.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm11351.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm21664-garnet.dts (contents, props changed) head/sys/gnu/dts/arm/bcm21664.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm23550-sparrow.dts (contents, props changed) head/sys/gnu/dts/arm/bcm23550.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm28155-ap.dts (contents, props changed) head/sys/gnu/dts/arm/bcm2835-rpi-a-plus.dts (contents, props changed) head/sys/gnu/dts/arm/bcm2835-rpi-b-plus.dts (contents, props changed) head/sys/gnu/dts/arm/bcm2835-rpi-b-rev2.dts (contents, props changed) head/sys/gnu/dts/arm/bcm2835-rpi-zero-w.dts (contents, props changed) head/sys/gnu/dts/arm/bcm2835-rpi-zero.dts (contents, props changed) head/sys/gnu/dts/arm/bcm2835-rpi.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm2836-rpi-2-b.dts (contents, props changed) head/sys/gnu/dts/arm/bcm2837-rpi-3-b-plus.dts (contents, props changed) head/sys/gnu/dts/arm/bcm2837-rpi-3-b.dts (contents, props changed) head/sys/gnu/dts/arm/bcm2837-rpi-cm3.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm283x.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm47081-asus-rt-n18u.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47081-buffalo-wzr-600dhp2.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47081-buffalo-wzr-900dhp.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47081-luxul-xap-1410.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47081-luxul-xwr-1200.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47081-tplink-archer-c5-v2.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47094-dlink-dir-885l.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47094-linksys-panamera.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47094-luxul-abr-4500.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47094-luxul-xap-1610.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47094-luxul-xbr-4500.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47094-luxul-xwr-3100.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47094-luxul-xwr-3150-v1.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47094-netgear-r8500.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47189-luxul-xap-1440.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47189-luxul-xap-810.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47189-tenda-ac9.dts (contents, props changed) head/sys/gnu/dts/arm/bcm5301x.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm53340-ubnt-unifi-switch8.dts (contents, props changed) head/sys/gnu/dts/arm/bcm53573.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm63138.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm7445.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm947189acdbmr.dts (contents, props changed) head/sys/gnu/dts/arm/bcm953012er.dts (contents, props changed) head/sys/gnu/dts/arm/bcm953012hr.dts (contents, props changed) head/sys/gnu/dts/arm/bcm953012k.dts (contents, props changed) head/sys/gnu/dts/arm/cx92755.dtsi (contents, props changed) head/sys/gnu/dts/arm/da850-lcdk.dts (contents, props changed) head/sys/gnu/dts/arm/dm814x.dtsi (contents, props changed) head/sys/gnu/dts/arm/dove.dtsi (contents, props changed) head/sys/gnu/dts/arm/dra7-l4.dtsi (contents, props changed) head/sys/gnu/dts/arm/ep7209.dtsi (contents, props changed) head/sys/gnu/dts/arm/ep7211-edb7211.dts (contents, props changed) head/sys/gnu/dts/arm/exynos3250.dtsi (contents, props changed) head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/exynos4412-odroidx.dts (contents, props changed) head/sys/gnu/dts/arm/exynos5250-arndale.dts (contents, props changed) head/sys/gnu/dts/arm/exynos5422-odroid-core.dtsi (contents, props changed) head/sys/gnu/dts/arm/exynos5422-odroidxu3-audio.dtsi (contents, props changed) head/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/exynos5422-odroidxu3-lite.dts (contents, props changed) head/sys/gnu/dts/arm/exynos5422-odroidxu4.dts (contents, props changed) head/sys/gnu/dts/arm/imx27.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx28-cfa10036.dts (contents, props changed) head/sys/gnu/dts/arm/imx51-digi-connectcore-jsk.dts (contents, props changed) head/sys/gnu/dts/arm/imx51-digi-connectcore-som.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6dl-colibri-eval-v3.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-tbs2910.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-apalis.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-colibri.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-icore-rqs.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-phytec-pfla02.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6sl.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6sx.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6ull-colibri.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6ull-pinfunc-snvs.h (contents, props changed) head/sys/gnu/dts/arm/imx6ull.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx7d.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx7ulp.dtsi (contents, props changed) head/sys/gnu/dts/arm/integrator.dtsi (contents, props changed) head/sys/gnu/dts/arm/integratorcp.dts (contents, props changed) head/sys/gnu/dts/arm/kirkwood-dir665.dts (contents, props changed) head/sys/gnu/dts/arm/kirkwood-linksys-viper.dts (contents, props changed) head/sys/gnu/dts/arm/kirkwood-mv88f6281gtw-ge.dts (contents, props changed) head/sys/gnu/dts/arm/kirkwood-rd88f6281-z0.dts (contents, props changed) head/sys/gnu/dts/arm/kirkwood-rd88f6281.dtsi (contents, props changed) head/sys/gnu/dts/arm/kirkwood.dtsi (contents, props changed) head/sys/gnu/dts/arm/lpc3250-ea3250.dts (contents, props changed) head/sys/gnu/dts/arm/lpc3250-phy3250.dts (contents, props changed) head/sys/gnu/dts/arm/lpc32xx.dtsi (contents, props changed) head/sys/gnu/dts/arm/lpc4350-hitex-eval.dts (contents, props changed) head/sys/gnu/dts/arm/lpc4357-ea4357-devkit.dts (contents, props changed) head/sys/gnu/dts/arm/ls1021a-moxa-uc-8410a.dts (contents, props changed) head/sys/gnu/dts/arm/ls1021a-qds.dts (contents, props changed) head/sys/gnu/dts/arm/ls1021a-twr.dts (contents, props changed) head/sys/gnu/dts/arm/ls1021a.dtsi (contents, props changed) head/sys/gnu/dts/arm/meson.dtsi (contents, props changed) head/sys/gnu/dts/arm/meson6-atv1200.dts (contents, props changed) head/sys/gnu/dts/arm/meson6.dtsi (contents, props changed) head/sys/gnu/dts/arm/meson8-minix-neo-x8.dts (contents, props changed) head/sys/gnu/dts/arm/meson8.dtsi (contents, props changed) head/sys/gnu/dts/arm/meson8b-ec100.dts (contents, props changed) head/sys/gnu/dts/arm/meson8b-mxq.dts (contents, props changed) head/sys/gnu/dts/arm/meson8b-odroidc1.dts (contents, props changed) head/sys/gnu/dts/arm/meson8b.dtsi (contents, props changed) head/sys/gnu/dts/arm/meson8m2-mxiii-plus.dts (contents, props changed) head/sys/gnu/dts/arm/meson8m2.dtsi (contents, props changed) head/sys/gnu/dts/arm/mmp2-brownstone.dts (contents, props changed) head/sys/gnu/dts/arm/mmp2.dtsi (contents, props changed) head/sys/gnu/dts/arm/moxart.dtsi (contents, props changed) head/sys/gnu/dts/arm/mps2.dtsi (contents, props changed) head/sys/gnu/dts/arm/mt2701-evb.dts (contents, props changed) head/sys/gnu/dts/arm/mt2701.dtsi (contents, props changed) head/sys/gnu/dts/arm/mt6580-evbp1.dts (contents, props changed) head/sys/gnu/dts/arm/mt6580.dtsi (contents, props changed) head/sys/gnu/dts/arm/mt6589-aquaris5.dts (contents, props changed) head/sys/gnu/dts/arm/mt6589.dtsi (contents, props changed) head/sys/gnu/dts/arm/mt6592-evb.dts (contents, props changed) head/sys/gnu/dts/arm/mt6592.dtsi (contents, props changed) head/sys/gnu/dts/arm/mt7623.dtsi (contents, props changed) head/sys/gnu/dts/arm/mt8127-moose.dts (contents, props changed) head/sys/gnu/dts/arm/mt8127.dtsi (contents, props changed) head/sys/gnu/dts/arm/mt8135-evbp1.dts (contents, props changed) head/sys/gnu/dts/arm/mt8135.dtsi (contents, props changed) head/sys/gnu/dts/arm/nspire.dtsi (contents, props changed) head/sys/gnu/dts/arm/omap3-evm-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/omap3-evm-processor-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/omap3-gta04.dtsi (contents, props changed) head/sys/gnu/dts/arm/omap3-gta04a5.dts (contents, props changed) head/sys/gnu/dts/arm/omap4-droid4-xt894.dts (contents, props changed) head/sys/gnu/dts/arm/omap4-panda-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/omap4-sdp.dts (contents, props changed) head/sys/gnu/dts/arm/orion5x-lacie-d2-network.dts (contents, props changed) head/sys/gnu/dts/arm/orion5x-lacie-ethernet-disk-mini-v2.dts (contents, props changed) head/sys/gnu/dts/arm/orion5x-lswsgl.dts (contents, props changed) head/sys/gnu/dts/arm/orion5x-maxtor-shared-storage-2.dts (contents, props changed) head/sys/gnu/dts/arm/orion5x-netgear-wnr854t.dts (contents, props changed) head/sys/gnu/dts/arm/orion5x-rd88f5182-nas.dts (contents, props changed) head/sys/gnu/dts/arm/orion5x.dtsi (contents, props changed) head/sys/gnu/dts/arm/ox810se.dtsi (contents, props changed) head/sys/gnu/dts/arm/ox820.dtsi (contents, props changed) head/sys/gnu/dts/arm/picoxcell-pc3x2.dtsi (contents, props changed) head/sys/gnu/dts/arm/picoxcell-pc3x3.dtsi (contents, props changed) head/sys/gnu/dts/arm/prima2-evb.dts (contents, props changed) head/sys/gnu/dts/arm/prima2.dtsi (contents, props changed) head/sys/gnu/dts/arm/pxa168.dtsi (contents, props changed) head/sys/gnu/dts/arm/pxa2xx.dtsi (contents, props changed) head/sys/gnu/dts/arm/pxa910.dtsi (contents, props changed) head/sys/gnu/dts/arm/qcom-apq8060-dragonboard.dts (contents, props changed) head/sys/gnu/dts/arm/qcom-apq8064.dtsi (contents, props changed) head/sys/gnu/dts/arm/qcom-apq8084.dtsi (contents, props changed) head/sys/gnu/dts/arm/qcom-ipq4019.dtsi (contents, props changed) head/sys/gnu/dts/arm/qcom-ipq8064.dtsi (contents, props changed) head/sys/gnu/dts/arm/qcom-mdm9615-wp8548.dtsi (contents, props changed) head/sys/gnu/dts/arm/qcom-mdm9615.dtsi (contents, props changed) head/sys/gnu/dts/arm/qcom-msm8660.dtsi (contents, props changed) head/sys/gnu/dts/arm/qcom-msm8960.dtsi (contents, props changed) head/sys/gnu/dts/arm/qcom-msm8974-lge-nexus5-hammerhead.dts (contents, props changed) head/sys/gnu/dts/arm/qcom-msm8974.dtsi (contents, props changed) head/sys/gnu/dts/arm/qcom-pm8941.dtsi (contents, props changed) head/sys/gnu/dts/arm/qcom-pma8084.dtsi (contents, props changed) head/sys/gnu/dts/arm/r8a7743.dtsi (contents, props changed) head/sys/gnu/dts/arm/r8a7744.dtsi (contents, props changed) head/sys/gnu/dts/arm/r8a77470-iwg23s-sbc.dts (contents, props changed) head/sys/gnu/dts/arm/r8a7778.dtsi (contents, props changed) head/sys/gnu/dts/arm/r8a7779.dtsi (contents, props changed) head/sys/gnu/dts/arm/r8a7790-stout.dts (contents, props changed) head/sys/gnu/dts/arm/rk3036-kylin.dts (contents, props changed) head/sys/gnu/dts/arm/rk3036.dtsi (contents, props changed) head/sys/gnu/dts/arm/rk3066a-bqcurie2.dts (contents, props changed) head/sys/gnu/dts/arm/rk3066a-mk808.dts (contents, props changed) head/sys/gnu/dts/arm/rk3066a-rayeager.dts (contents, props changed) head/sys/gnu/dts/arm/rk3066a.dtsi (contents, props changed) head/sys/gnu/dts/arm/rk3188-bqedison2qc.dts (contents, props changed) head/sys/gnu/dts/arm/rk3188-px3-evb.dts (contents, props changed) head/sys/gnu/dts/arm/rk3229-evb.dts (contents, props changed) head/sys/gnu/dts/arm/rk3288-fennec.dts (contents, props changed) head/sys/gnu/dts/arm/rk3288-firefly-reload.dts (contents, props changed) head/sys/gnu/dts/arm/rk3288-miqi.dts (contents, props changed) head/sys/gnu/dts/arm/rk3288-popmetal.dts (contents, props changed) head/sys/gnu/dts/arm/rk3288-rock2-square.dts (contents, props changed) head/sys/gnu/dts/arm/rk3288-tinker-s.dts (contents, props changed) head/sys/gnu/dts/arm/rk3288-tinker.dtsi (contents, props changed) head/sys/gnu/dts/arm/rk3288-veyron.dtsi (contents, props changed) head/sys/gnu/dts/arm/rk3288-vyasa.dts (contents, props changed) head/sys/gnu/dts/arm/rk3288.dtsi (contents, props changed) head/sys/gnu/dts/arm/rv1108-evb.dts (contents, props changed) head/sys/gnu/dts/arm/rv1108.dtsi (contents, props changed) head/sys/gnu/dts/arm/s3c2416-smdk2416.dts (contents, props changed) head/sys/gnu/dts/arm/s5pv210-aries.dtsi (contents, props changed) head/sys/gnu/dts/arm/s5pv210-fascinate4g.dts (contents, props changed) head/sys/gnu/dts/arm/s5pv210-galaxys.dts (contents, props changed) head/sys/gnu/dts/arm/s5pv210.dtsi (contents, props changed) head/sys/gnu/dts/arm/sama5d2-pinfunc.h (contents, props changed) head/sys/gnu/dts/arm/sama5d2.dtsi (contents, props changed) head/sys/gnu/dts/arm/sama5d3.dtsi (contents, props changed) head/sys/gnu/dts/arm/sama5d4.dtsi (contents, props changed) head/sys/gnu/dts/arm/socfpga.dtsi (contents, props changed) head/sys/gnu/dts/arm/socfpga_arria10.dtsi (contents, props changed) head/sys/gnu/dts/arm/spear13xx.dtsi (contents, props changed) head/sys/gnu/dts/arm/spear3xx.dtsi (contents, props changed) head/sys/gnu/dts/arm/spear600.dtsi (contents, props changed) head/sys/gnu/dts/arm/ste-nomadik-nhk15.dts (contents, props changed) head/sys/gnu/dts/arm/ste-nomadik-stn8815.dtsi (contents, props changed) head/sys/gnu/dts/arm/ste-u300.dts (contents, props changed) head/sys/gnu/dts/arm/stm32429i-eval.dts (contents, props changed) head/sys/gnu/dts/arm/stm32746g-eval.dts (contents, props changed) head/sys/gnu/dts/arm/stm32f429-disco.dts (contents, props changed) head/sys/gnu/dts/arm/stm32f429.dtsi (contents, props changed) head/sys/gnu/dts/arm/stm32f469-disco.dts (contents, props changed) head/sys/gnu/dts/arm/stm32f746-disco.dts (contents, props changed) head/sys/gnu/dts/arm/stm32f746.dtsi (contents, props changed) head/sys/gnu/dts/arm/stm32f769-disco.dts (contents, props changed) head/sys/gnu/dts/arm/stm32h743-pinctrl.dtsi (contents, props changed) head/sys/gnu/dts/arm/stm32h743.dtsi (contents, props changed) head/sys/gnu/dts/arm/stm32h743i-disco.dts (contents, props changed) head/sys/gnu/dts/arm/stm32h743i-eval.dts (contents, props changed) head/sys/gnu/dts/arm/stm32mp157-pinctrl.dtsi (contents, props changed) head/sys/gnu/dts/arm/stm32mp157c-ed1.dts (contents, props changed) head/sys/gnu/dts/arm/stm32mp157c-ev1.dts (contents, props changed) head/sys/gnu/dts/arm/stm32mp157c.dtsi (contents, props changed) head/sys/gnu/dts/arm/sun4i-a10.dtsi (contents, props changed) head/sys/gnu/dts/arm/sun5i-a13-q8-tablet.dts (contents, props changed) head/sys/gnu/dts/arm/sun5i-reference-design-tablet.dtsi (contents, props changed) head/sys/gnu/dts/arm/sun7i-a20-bananapi.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-a23-a33.dtsi (contents, props changed) head/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v1.2.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v5.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-a23-q8-tablet.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-a23.dtsi (contents, props changed) head/sys/gnu/dts/arm/sun8i-a33.dtsi (contents, props changed) head/sys/gnu/dts/arm/sun8i-a83t-allwinner-h8homlet-v2.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-a83t-bananapi-m3.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-a83t-cubietruck-plus.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1-plus.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-q8-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/sun8i-r40-bananapi-m2-ultra.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-r40.dtsi (contents, props changed) head/sys/gnu/dts/arm/sun9i-a80-cubieboard4.dts (contents, props changed) head/sys/gnu/dts/arm/sun9i-a80-optimus.dts (contents, props changed) head/sys/gnu/dts/arm/sun9i-a80.dtsi (contents, props changed) head/sys/gnu/dts/arm/sunxi-bananapi-m2-plus.dtsi (contents, props changed) head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi (contents, props changed) head/sys/gnu/dts/arm/tegra114-dalmore.dts (contents, props changed) head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts (contents, props changed) head/sys/gnu/dts/arm/tegra124-nyan.dtsi (contents, props changed) head/sys/gnu/dts/arm/tegra124-venice2.dts (contents, props changed) head/sys/gnu/dts/arm/tegra20-trimslice.dts (contents, props changed) head/sys/gnu/dts/arm/tegra20.dtsi (contents, props changed) head/sys/gnu/dts/arm/tegra30-beaver.dts (contents, props changed) head/sys/gnu/dts/arm/tegra30-cardhu.dtsi (contents, props changed) head/sys/gnu/dts/arm/versatile-ab.dts (contents, props changed) head/sys/gnu/dts/arm/vexpress-v2m-rs1.dtsi (contents, props changed) head/sys/gnu/dts/arm/vexpress-v2m.dtsi (contents, props changed) head/sys/gnu/dts/arm/vexpress-v2p-ca15_a7.dts (contents, props changed) head/sys/gnu/dts/arm/vf610-bk4.dts (contents, props changed) head/sys/gnu/dts/arm/vf610-zii-cfu1.dts (contents, props changed) head/sys/gnu/dts/arm/vf610-zii-ssmb-spu3.dts (contents, props changed) head/sys/gnu/dts/arm/vt8500.dtsi (contents, props changed) head/sys/gnu/dts/arm/wm8505.dtsi (contents, props changed) head/sys/gnu/dts/arm/wm8650.dtsi (contents, props changed) head/sys/gnu/dts/arm/wm8750.dtsi (contents, props changed) head/sys/gnu/dts/arm/wm8850.dtsi (contents, props changed) head/sys/gnu/dts/arm/zx296702-ad1.dts (contents, props changed) head/sys/gnu/dts/arm/zx296702.dtsi (contents, props changed) head/sys/gnu/dts/arm/zynq-zturn.dts (contents, props changed) head/sys/gnu/dts/arm64/actions/s700-cubieboard7.dts (contents, props changed) head/sys/gnu/dts/arm64/actions/s700.dtsi (contents, props changed) head/sys/gnu/dts/arm64/actions/s900.dtsi (contents, props changed) head/sys/gnu/dts/arm64/al/alpine-v2.dtsi (contents, props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-bananapi-m64.dts (contents, props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-nanopi-a64.dts (contents, props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-olinuxino.dts (contents, props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-orangepi-win.dts (contents, props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64.dts (contents, props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-teres-i.dts (contents, props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi (contents, props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5-libretech-all-h3-cc.dts (contents, props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5.dtsi (contents, props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi (contents, props changed) head/sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi (contents, props changed) head/sys/gnu/dts/arm64/amlogic/meson-axg-s400.dts (contents, props changed) head/sys/gnu/dts/arm64/amlogic/meson-axg.dtsi (contents, props changed) head/sys/gnu/dts/arm64/amlogic/meson-g12a.dtsi (contents, props changed) head/sys/gnu/dts/arm64/amlogic/meson-gx.dtsi (contents, props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb.dtsi (contents, props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl.dtsi (contents, props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxm.dtsi (contents, props changed) head/sys/gnu/dts/arm64/apm/apm-shadowcat.dtsi (contents, props changed) head/sys/gnu/dts/arm64/apm/apm-storm.dtsi (contents, props changed) head/sys/gnu/dts/arm64/arm/foundation-v8-gicv2.dtsi (contents, props changed) head/sys/gnu/dts/arm64/arm/foundation-v8-gicv3.dtsi (contents, props changed) head/sys/gnu/dts/arm64/arm/foundation-v8.dtsi (contents, props changed) head/sys/gnu/dts/arm64/arm/juno-base.dtsi (contents, props changed) head/sys/gnu/dts/arm64/arm/juno-r1.dts (contents, props changed) head/sys/gnu/dts/arm64/arm/juno-r2.dts (contents, props changed) head/sys/gnu/dts/arm64/arm/juno.dts (contents, props changed) head/sys/gnu/dts/arm64/arm/rtsm_ve-aemv8a.dts (contents, props changed) head/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard.dtsi (contents, props changed) head/sys/gnu/dts/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts (contents, props changed) head/sys/gnu/dts/arm64/arm/vexpress-v2m-rs1.dtsi (contents, props changed) head/sys/gnu/dts/arm64/broadcom/northstar2/ns2.dtsi (contents, props changed) head/sys/gnu/dts/arm64/broadcom/stingray/stingray.dtsi (contents, props changed) head/sys/gnu/dts/arm64/cavium/thunder-88xx.dtsi (contents, props changed) head/sys/gnu/dts/arm64/cavium/thunder2-99xx.dtsi (contents, props changed) head/sys/gnu/dts/arm64/exynos/exynos5433.dtsi (contents, props changed) head/sys/gnu/dts/arm64/exynos/exynos7.dtsi (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1012a.dtsi (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-rdb.dts (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1028a.dtsi (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1043a-qds.dts (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1043a.dtsi (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1046a-qds.dts (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1046a-rdb.dts (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1046a.dtsi (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1088a.dtsi (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls208xa.dtsi (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-lx2160a-rdb.dts (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-lx2160a.dtsi (contents, props changed) head/sys/gnu/dts/arm64/freescale/imx8mq-evk.dts (contents, props changed) head/sys/gnu/dts/arm64/freescale/imx8mq.dtsi (contents, props changed) head/sys/gnu/dts/arm64/hisilicon/hi3660-hikey960.dts (contents, props changed) head/sys/gnu/dts/arm64/hisilicon/hi3660.dtsi (contents, props changed) head/sys/gnu/dts/arm64/hisilicon/hi3670.dtsi (contents, props changed) head/sys/gnu/dts/arm64/hisilicon/hi3798cv200-poplar.dts (contents, props changed) head/sys/gnu/dts/arm64/hisilicon/hi3798cv200.dtsi (contents, props changed) head/sys/gnu/dts/arm64/hisilicon/hi6220-hikey.dts (contents, props changed) head/sys/gnu/dts/arm64/hisilicon/hi6220.dtsi (contents, props changed) head/sys/gnu/dts/arm64/hisilicon/hip05.dtsi (contents, props changed) head/sys/gnu/dts/arm64/hisilicon/hip06.dtsi (contents, props changed) head/sys/gnu/dts/arm64/hisilicon/hip07.dtsi (contents, props changed) head/sys/gnu/dts/arm64/lg/lg1312.dtsi (contents, props changed) head/sys/gnu/dts/arm64/lg/lg1313.dtsi (contents, props changed) head/sys/gnu/dts/arm64/marvell/armada-3720-espressobin.dts (contents, props changed) head/sys/gnu/dts/arm64/marvell/armada-372x.dtsi (contents, props changed) head/sys/gnu/dts/arm64/marvell/armada-37xx.dtsi (contents, props changed) head/sys/gnu/dts/arm64/marvell/armada-7040-db.dts (contents, props changed) head/sys/gnu/dts/arm64/marvell/armada-8040-db.dts (contents, props changed) head/sys/gnu/dts/arm64/marvell/armada-ap806-dual.dtsi (contents, props changed) head/sys/gnu/dts/arm64/marvell/armada-ap806-quad.dtsi (contents, props changed) head/sys/gnu/dts/arm64/marvell/armada-ap806.dtsi (contents, props changed) head/sys/gnu/dts/arm64/marvell/armada-ap810-ap0-octa-core.dtsi (contents, props changed) head/sys/gnu/dts/arm64/marvell/armada-cp110.dtsi (contents, props changed) head/sys/gnu/dts/arm64/mediatek/mt2712-evb.dts (contents, props changed) head/sys/gnu/dts/arm64/mediatek/mt2712e.dtsi (contents, props changed) head/sys/gnu/dts/arm64/mediatek/mt6797-evb.dts (contents, props changed) head/sys/gnu/dts/arm64/mediatek/mt6797-x20-dev.dts (contents, props changed) head/sys/gnu/dts/arm64/mediatek/mt6797.dtsi (contents, props changed) head/sys/gnu/dts/arm64/mediatek/mt7622.dtsi (contents, props changed) head/sys/gnu/dts/arm64/mediatek/mt8173.dtsi (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra132.dtsi (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra186-p2771-0000.dts (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra186-p3310.dtsi (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra186.dtsi (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra194-p2888.dtsi (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra194-p2972-0000.dts (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra194.dtsi (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-p2371-2180.dts (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-p2597.dtsi (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-smaug.dts (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra210.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/apq8016-sbc.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/ipq8074.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/msm8916.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/msm8992.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/msm8994.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/msm8996-pins.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/msm8996.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/msm8998-mtp.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/msm8998.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/pm8005.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/pm8916.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/pm8998.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/pmi8994.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/pmi8998.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/pms405.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/qcs404-evb.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/qcs404.dtsi (contents, props changed) head/sys/gnu/dts/arm64/qcom/sdm845-mtp.dts (contents, props changed) head/sys/gnu/dts/arm64/qcom/sdm845.dtsi (contents, props changed) head/sys/gnu/dts/arm64/realtek/rtd1295.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a774a1.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a7795.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a7796-salvator-xs.dts (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a7796.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a77965.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a77970-v3msk.dts (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a77970.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a77980.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a77990-ebisu.dts (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a77990.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a77995-draak.dts (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a77995.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/salvator-common.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/ulcb-kf.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/ulcb.dtsi (contents, props changed) head/sys/gnu/dts/arm64/rockchip/px30.dtsi (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3328-roc-cc.dts (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3328-rock64.dts (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3328.dtsi (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3368-evb.dtsi (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3368-geekbox.dts (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3368-lion.dtsi (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3368-orion-r68-meta.dts (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3368-px5-evb.dts (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3368-r88.dts (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3368.dtsi (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-gru-chromebook.dtsi (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet.dtsi (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-gru.dtsi (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dtsi (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-sapphire-excavator.dts (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3399.dtsi (contents, props changed) head/sys/gnu/dts/arm64/socionext/uniphier-ld11.dtsi (contents, props changed) head/sys/gnu/dts/arm64/socionext/uniphier-ld20-global.dts (contents, props changed) head/sys/gnu/dts/arm64/socionext/uniphier-ld20.dtsi (contents, props changed) head/sys/gnu/dts/arm64/socionext/uniphier-pxs3-ref.dts (contents, props changed) head/sys/gnu/dts/arm64/socionext/uniphier-pxs3.dtsi (contents, props changed) head/sys/gnu/dts/arm64/sprd/sc2731.dtsi (contents, props changed) head/sys/gnu/dts/arm64/sprd/sc9836.dtsi (contents, props changed) head/sys/gnu/dts/arm64/sprd/sc9860.dtsi (contents, props changed) head/sys/gnu/dts/arm64/sprd/sp9860g-1h10.dts (contents, props changed) head/sys/gnu/dts/arm64/synaptics/as370.dtsi (contents, props changed) head/sys/gnu/dts/arm64/synaptics/berlin4ct.dtsi (contents, props changed) head/sys/gnu/dts/arm64/ti/k3-am65-main.dtsi (contents, props changed) head/sys/gnu/dts/arm64/ti/k3-am65-mcu.dtsi (contents, props changed) head/sys/gnu/dts/arm64/ti/k3-am654-base-board.dts (contents, props changed) head/sys/gnu/dts/arm64/ti/k3-am654.dtsi (contents, props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu100-revC.dts (contents, props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp.dtsi (contents, props changed) head/sys/gnu/dts/arm64/zte/zx296718.dtsi (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/ath79-clk.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/axg-aoclkc.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos5433.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/gxbb-aoclkc.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx5-clock.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx8mq-clock.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/meson8b-clkc.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt2712-clk.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt8173-clk.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,rpmcc.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,rpmh.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a774a1-cpg-mssr.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a774c0-cpg-mssr.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7778-clock.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/stm32mp1-clks.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/gpio/gpio.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/at91.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/power/mt8173-power.h (contents, props changed) Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/arm/aks-cdu.dts (props changed) head/sys/gnu/dts/arm/alphascale-asm9260-devkit.dts (props changed) head/sys/gnu/dts/arm/alpine-db.dts (props changed) head/sys/gnu/dts/arm/am335x-baltos-leds.dtsi (props changed) head/sys/gnu/dts/arm/am335x-baltos.dtsi (props changed) head/sys/gnu/dts/arm/am335x-base0033.dts (props changed) head/sys/gnu/dts/arm/am335x-bone-common.dtsi (props changed) head/sys/gnu/dts/arm/am335x-bone.dts (props changed) head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi (props changed) head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts (props changed) head/sys/gnu/dts/arm/am335x-boneblack.dts (props changed) head/sys/gnu/dts/arm/am335x-boneblue.dts (props changed) head/sys/gnu/dts/arm/am335x-bonegreen-common.dtsi (props changed) head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts (props changed) head/sys/gnu/dts/arm/am335x-bonegreen.dts (props changed) head/sys/gnu/dts/arm/am335x-chilisom.dtsi (props changed) head/sys/gnu/dts/arm/am335x-cm-t335.dts (props changed) head/sys/gnu/dts/arm/am335x-moxa-uc-2101.dts (props changed) head/sys/gnu/dts/arm/am335x-nano.dts (props changed) head/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts (props changed) head/sys/gnu/dts/arm/am335x-osd335x-common.dtsi (props changed) head/sys/gnu/dts/arm/am335x-pcm-953.dtsi (props changed) head/sys/gnu/dts/arm/am335x-pdu001.dts (props changed) head/sys/gnu/dts/arm/am335x-pepper.dts (props changed) head/sys/gnu/dts/arm/am335x-phycore-rdk.dts (props changed) head/sys/gnu/dts/arm/am335x-pocketbeagle.dts (props changed) head/sys/gnu/dts/arm/am335x-sancloud-bbe.dts (props changed) head/sys/gnu/dts/arm/am335x-sbc-t335.dts (props changed) head/sys/gnu/dts/arm/am335x-sl50.dts (props changed) head/sys/gnu/dts/arm/am335x-wega-rdk.dts (props changed) head/sys/gnu/dts/arm/am335x-wega.dtsi (props changed) head/sys/gnu/dts/arm/am33xx-clocks.dtsi (props changed) head/sys/gnu/dts/arm/am33xx.dtsi (props changed) head/sys/gnu/dts/arm/am3517-craneboard.dts (props changed) head/sys/gnu/dts/arm/am3517-evm-ui.dtsi (props changed) head/sys/gnu/dts/arm/am3517-evm.dts (props changed) head/sys/gnu/dts/arm/am3517-som.dtsi (props changed) head/sys/gnu/dts/arm/am3517.dtsi (props changed) head/sys/gnu/dts/arm/am3517_mt_ventoux.dts (props changed) head/sys/gnu/dts/arm/am35xx-clocks.dtsi (props changed) head/sys/gnu/dts/arm/am4372.dtsi (props changed) head/sys/gnu/dts/arm/am437x-cm-t43.dts (props changed) head/sys/gnu/dts/arm/am437x-idk-evm.dts (props changed) head/sys/gnu/dts/arm/am437x-sbc-t43.dts (props changed) head/sys/gnu/dts/arm/am437x-sk-evm.dts (props changed) head/sys/gnu/dts/arm/am43xx-clocks.dtsi (props changed) head/sys/gnu/dts/arm/am571x-idk.dts (props changed) head/sys/gnu/dts/arm/am572x-idk-common.dtsi (props changed) head/sys/gnu/dts/arm/am572x-idk.dts (props changed) head/sys/gnu/dts/arm/am574x-idk.dts (props changed) head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi (props changed) head/sys/gnu/dts/arm/am57xx-beagle-x15-revb1.dts (props changed) head/sys/gnu/dts/arm/am57xx-beagle-x15-revc.dts (props changed) head/sys/gnu/dts/arm/am57xx-beagle-x15.dts (props changed) head/sys/gnu/dts/arm/am57xx-cl-som-am57x.dts (props changed) head/sys/gnu/dts/arm/am57xx-commercial-grade.dtsi (props changed) head/sys/gnu/dts/arm/am57xx-idk-common.dtsi (props changed) head/sys/gnu/dts/arm/am57xx-industrial-grade.dtsi (props changed) head/sys/gnu/dts/arm/am57xx-sbc-am57x.dts (props changed) head/sys/gnu/dts/arm/animeo_ip.dts (props changed) head/sys/gnu/dts/arm/arm-realview-eb-11mp-bbrevd-ctrevb.dts (props changed) head/sys/gnu/dts/arm/arm-realview-eb-11mp-bbrevd.dts (props changed) head/sys/gnu/dts/arm/arm-realview-eb-11mp-ctrevb.dts (props changed) head/sys/gnu/dts/arm/arm-realview-eb-11mp-revb.dts (props changed) head/sys/gnu/dts/arm/arm-realview-eb-11mp.dts (props changed) head/sys/gnu/dts/arm/arm-realview-eb-a9mp-bbrevd.dts (props changed) head/sys/gnu/dts/arm/arm-realview-eb-a9mp.dts (props changed) head/sys/gnu/dts/arm/arm-realview-eb-bbrevd.dts (props changed) head/sys/gnu/dts/arm/arm-realview-eb-bbrevd.dtsi (props changed) head/sys/gnu/dts/arm/arm-realview-eb-mp.dtsi (props changed) head/sys/gnu/dts/arm/arm-realview-eb.dts (props changed) head/sys/gnu/dts/arm/arm-realview-pba8.dts (props changed) head/sys/gnu/dts/arm/arm-realview-pbx-a9.dts (props changed) head/sys/gnu/dts/arm/armada-370-db.dts (props changed) head/sys/gnu/dts/arm/armada-370-dlink-dns327l.dts (props changed) head/sys/gnu/dts/arm/armada-370-mirabox.dts (props changed) head/sys/gnu/dts/arm/armada-370-netgear-rn102.dts (props changed) head/sys/gnu/dts/arm/armada-370-netgear-rn104.dts (props changed) head/sys/gnu/dts/arm/armada-370-seagate-nas-2bay.dts (props changed) head/sys/gnu/dts/arm/armada-370-seagate-nas-4bay.dts (props changed) head/sys/gnu/dts/arm/armada-370-seagate-nas-xbay.dtsi (props changed) head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud-2bay.dts (props changed) head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud.dts (props changed) head/sys/gnu/dts/arm/armada-370-seagate-personal-cloud.dtsi (props changed) head/sys/gnu/dts/arm/armada-370-synology-ds213j.dts (props changed) head/sys/gnu/dts/arm/armada-370-xp.dtsi (props changed) head/sys/gnu/dts/arm/armada-370.dtsi (props changed) head/sys/gnu/dts/arm/armada-375-db.dts (props changed) head/sys/gnu/dts/arm/armada-375.dtsi (props changed) head/sys/gnu/dts/arm/armada-380.dtsi (props changed) head/sys/gnu/dts/arm/armada-385-db-88f6820-amc.dts (props changed) head/sys/gnu/dts/arm/armada-385-db-ap.dts (props changed) head/sys/gnu/dts/arm/armada-385-linksys-caiman.dts (props changed) head/sys/gnu/dts/arm/armada-385-linksys-cobra.dts (props changed) head/sys/gnu/dts/arm/armada-385-linksys-rango.dts (props changed) head/sys/gnu/dts/arm/armada-385-linksys-shelby.dts (props changed) head/sys/gnu/dts/arm/armada-385-linksys.dtsi (props changed) head/sys/gnu/dts/arm/armada-385-synology-ds116.dts (props changed) head/sys/gnu/dts/arm/armada-385-turris-omnia.dts (props changed) head/sys/gnu/dts/arm/armada-385.dtsi (props changed) head/sys/gnu/dts/arm/armada-388-clearfog-base.dts (props changed) head/sys/gnu/dts/arm/armada-388-clearfog-pro.dts (props changed) head/sys/gnu/dts/arm/armada-388-db.dts (props changed) head/sys/gnu/dts/arm/armada-388-gp.dts (props changed) head/sys/gnu/dts/arm/armada-388-helios4.dts (props changed) head/sys/gnu/dts/arm/armada-388-rd.dts (props changed) head/sys/gnu/dts/arm/armada-388.dtsi (props changed) head/sys/gnu/dts/arm/armada-38x-solidrun-microsom.dtsi (props changed) head/sys/gnu/dts/arm/armada-390-db.dts (props changed) head/sys/gnu/dts/arm/armada-390.dtsi (props changed) head/sys/gnu/dts/arm/armada-395-gp.dts (props changed) head/sys/gnu/dts/arm/armada-395.dtsi (props changed) head/sys/gnu/dts/arm/armada-398-db.dts (props changed) head/sys/gnu/dts/arm/armada-398.dtsi (props changed) head/sys/gnu/dts/arm/armada-xp-98dx3236.dtsi (props changed) head/sys/gnu/dts/arm/armada-xp-98dx3336.dtsi (props changed) head/sys/gnu/dts/arm/armada-xp-98dx4251.dtsi (props changed) head/sys/gnu/dts/arm/armada-xp-axpwifiap.dts (props changed) head/sys/gnu/dts/arm/armada-xp-db-dxbc2.dts (props changed) head/sys/gnu/dts/arm/armada-xp-db-xc3-24g4xg.dts (props changed) head/sys/gnu/dts/arm/armada-xp-db.dts (props changed) head/sys/gnu/dts/arm/armada-xp-gp.dts (props changed) head/sys/gnu/dts/arm/armada-xp-lenovo-ix4-300d.dts (props changed) head/sys/gnu/dts/arm/armada-xp-matrix.dts (props changed) head/sys/gnu/dts/arm/armada-xp-mv78230.dtsi (props changed) head/sys/gnu/dts/arm/armada-xp-mv78260.dtsi (props changed) head/sys/gnu/dts/arm/armada-xp-mv78460.dtsi (props changed) head/sys/gnu/dts/arm/armada-xp-netgear-rn2120.dts (props changed) head/sys/gnu/dts/arm/armada-xp-openblocks-ax3-4.dts (props changed) head/sys/gnu/dts/arm/armada-xp-synology-ds414.dts (props changed) head/sys/gnu/dts/arm/armada-xp.dtsi (props changed) head/sys/gnu/dts/arm/armv7-m.dtsi (props changed) head/sys/gnu/dts/arm/artpec6-devboard.dts (props changed) head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-arm-centriq2400-rep.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-facebook-cmm.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-intel-s2600wf.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-opp-lanyang.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-opp-zaius.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-portwell-neptune.dts (props changed) head/sys/gnu/dts/arm/at91-ariag25.dts (props changed) head/sys/gnu/dts/arm/at91-ariettag25.dts (props changed) head/sys/gnu/dts/arm/at91-cosino.dtsi (props changed) head/sys/gnu/dts/arm/at91-cosino_mega2560.dts (props changed) head/sys/gnu/dts/arm/at91-dvk_som60.dts (props changed) head/sys/gnu/dts/arm/at91-dvk_su60_somc.dtsi (props changed) head/sys/gnu/dts/arm/at91-dvk_su60_somc_lcm.dtsi (props changed) head/sys/gnu/dts/arm/at91-foxg20.dts (props changed) head/sys/gnu/dts/arm/at91-gatwick.dts (props changed) head/sys/gnu/dts/arm/at91-kizbox.dts (props changed) head/sys/gnu/dts/arm/at91-kizbox2.dts (props changed) head/sys/gnu/dts/arm/at91-kizboxmini.dts (props changed) head/sys/gnu/dts/arm/at91-linea.dtsi (props changed) head/sys/gnu/dts/arm/at91-natte.dtsi (props changed) head/sys/gnu/dts/arm/at91-qil_a9260.dts (props changed) head/sys/gnu/dts/arm/at91-sam9_l9260.dts (props changed) head/sys/gnu/dts/arm/at91-sama5d2_ptc_ek.dts (props changed) head/sys/gnu/dts/arm/at91-sama5d2_xplained.dts (props changed) head/sys/gnu/dts/arm/at91-sama5d3_xplained.dts (props changed) head/sys/gnu/dts/arm/at91-sama5d4_ma5d4.dtsi (props changed) head/sys/gnu/dts/arm/at91-sama5d4_ma5d4evk.dts (props changed) head/sys/gnu/dts/arm/at91-sama5d4_xplained.dts (props changed) head/sys/gnu/dts/arm/at91-sama5d4ek.dts (props changed) head/sys/gnu/dts/arm/at91-som60.dtsi (props changed) head/sys/gnu/dts/arm/at91-tse850-3.dts (props changed) head/sys/gnu/dts/arm/at91-vinco.dts (props changed) head/sys/gnu/dts/arm/at91-wb45n.dtsi (props changed) head/sys/gnu/dts/arm/at91-wb50n.dtsi (props changed) head/sys/gnu/dts/arm/at91rm9200_pqfp.dtsi (props changed) head/sys/gnu/dts/arm/at91rm9200ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9260ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9261ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9263ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9g15.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9g15ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9g20.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9g20ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9g20ek_2mmc.dts (props changed) head/sys/gnu/dts/arm/at91sam9g20ek_common.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9g25.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9g25ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9g35.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9g35ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9m10g45ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9n12ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9rlek.dts (props changed) head/sys/gnu/dts/arm/at91sam9x25.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9x25ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9x35.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9x35ek.dts (props changed) head/sys/gnu/dts/arm/at91sam9x5_can.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9x5_isi.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9x5_lcd.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9x5_macb0.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9x5_macb1.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9x5_usart3.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9x5cm.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9x5dm.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9x5ek.dtsi (props changed) head/sys/gnu/dts/arm/at91sam9xe.dtsi (props changed) head/sys/gnu/dts/arm/atlas7-evb.dts (props changed) head/sys/gnu/dts/arm/axm5516-amarillo.dts (props changed) head/sys/gnu/dts/arm/axm5516-cpus.dtsi (props changed) head/sys/gnu/dts/arm/axp152.dtsi (props changed) head/sys/gnu/dts/arm/axp209.dtsi (props changed) head/sys/gnu/dts/arm/axp223.dtsi (props changed) head/sys/gnu/dts/arm/axp22x.dtsi (props changed) head/sys/gnu/dts/arm/axp809.dtsi (props changed) head/sys/gnu/dts/arm/axp81x.dtsi (props changed) head/sys/gnu/dts/arm/bcm-cygnus-clock.dtsi (props changed) head/sys/gnu/dts/arm/bcm-hr2.dtsi (props changed) head/sys/gnu/dts/arm/bcm2835-rpi-a.dts (props changed) head/sys/gnu/dts/arm/bcm2835-rpi-b.dts (props changed) head/sys/gnu/dts/arm/bcm2835-rpi-cm1-io1.dts (props changed) head/sys/gnu/dts/arm/bcm2835-rpi-cm1.dtsi (props changed) head/sys/gnu/dts/arm/bcm2835.dtsi (props changed) head/sys/gnu/dts/arm/bcm2836-rpi.dtsi (props changed) head/sys/gnu/dts/arm/bcm2836.dtsi (props changed) head/sys/gnu/dts/arm/bcm2837-rpi-cm3-io3.dts (props changed) head/sys/gnu/dts/arm/bcm2837.dtsi (props changed) head/sys/gnu/dts/arm/bcm283x-rpi-lan7515.dtsi (props changed) head/sys/gnu/dts/arm/bcm283x-rpi-smsc9512.dtsi (props changed) head/sys/gnu/dts/arm/bcm283x-rpi-smsc9514.dtsi (props changed) head/sys/gnu/dts/arm/bcm283x-rpi-usb-host.dtsi (props changed) head/sys/gnu/dts/arm/bcm283x-rpi-usb-otg.dtsi (props changed) head/sys/gnu/dts/arm/bcm4708-asus-rt-ac56u.dts (props changed) head/sys/gnu/dts/arm/bcm4708-asus-rt-ac68u.dts (props changed) head/sys/gnu/dts/arm/bcm4708-buffalo-wzr-1750dhp.dts (props changed) head/sys/gnu/dts/arm/bcm4708-linksys-ea6300-v1.dts (props changed) head/sys/gnu/dts/arm/bcm4708-linksys-ea6500-v2.dts (props changed) head/sys/gnu/dts/arm/bcm4708-luxul-xap-1510.dts (props changed) head/sys/gnu/dts/arm/bcm4708-luxul-xwc-1000.dts (props changed) head/sys/gnu/dts/arm/bcm4708-netgear-r6250.dts (props changed) head/sys/gnu/dts/arm/bcm4708-netgear-r6300-v2.dts (props changed) head/sys/gnu/dts/arm/bcm4708-smartrg-sr400ac.dts (props changed) head/sys/gnu/dts/arm/bcm4708.dtsi (props changed) head/sys/gnu/dts/arm/bcm47081.dtsi (props changed) head/sys/gnu/dts/arm/bcm4709-asus-rt-ac87u.dts (props changed) head/sys/gnu/dts/arm/bcm4709-buffalo-wxr-1900dhp.dts (props changed) head/sys/gnu/dts/arm/bcm4709-linksys-ea9200.dts (props changed) head/sys/gnu/dts/arm/bcm4709-netgear-r7000.dts (props changed) head/sys/gnu/dts/arm/bcm4709-netgear-r8000.dts (props changed) head/sys/gnu/dts/arm/bcm4709-tplink-archer-c9-v1.dts (props changed) head/sys/gnu/dts/arm/bcm4709.dtsi (props changed) head/sys/gnu/dts/arm/bcm47094.dtsi (props changed) head/sys/gnu/dts/arm/bcm5301x-nand-cs0-bch1.dtsi (props changed) head/sys/gnu/dts/arm/bcm5301x-nand-cs0-bch4.dtsi (props changed) head/sys/gnu/dts/arm/bcm5301x-nand-cs0-bch8.dtsi (props changed) head/sys/gnu/dts/arm/bcm5301x-nand-cs0.dtsi (props changed) head/sys/gnu/dts/arm/bcm59056.dtsi (props changed) head/sys/gnu/dts/arm/bcm7445-bcm97445svmb.dts (props changed) head/sys/gnu/dts/arm/bcm911360_entphn.dts (props changed) head/sys/gnu/dts/arm/bcm911360k.dts (props changed) head/sys/gnu/dts/arm/bcm94708.dts (props changed) head/sys/gnu/dts/arm/bcm94709.dts (props changed) head/sys/gnu/dts/arm/bcm958300k.dts (props changed) head/sys/gnu/dts/arm/bcm958305k.dts (props changed) head/sys/gnu/dts/arm/bcm958522er.dts (props changed) head/sys/gnu/dts/arm/bcm958525er.dts (props changed) head/sys/gnu/dts/arm/bcm958525xmc.dts (props changed) head/sys/gnu/dts/arm/bcm958622hr.dts (props changed) head/sys/gnu/dts/arm/bcm958623hr.dts (props changed) head/sys/gnu/dts/arm/bcm958625hr.dts (props changed) head/sys/gnu/dts/arm/bcm958625k.dts (props changed) head/sys/gnu/dts/arm/bcm963138dvt.dts (props changed) head/sys/gnu/dts/arm/bcm988312hr.dts (props changed) head/sys/gnu/dts/arm/bcm9hmidc.dtsi (props changed) head/sys/gnu/dts/arm/berlin2-sony-nsz-gs7.dts (props changed) head/sys/gnu/dts/arm/berlin2.dtsi (props changed) head/sys/gnu/dts/arm/berlin2cd-google-chromecast.dts (props changed) head/sys/gnu/dts/arm/berlin2cd-valve-steamlink.dts (props changed) head/sys/gnu/dts/arm/berlin2cd.dtsi (props changed) head/sys/gnu/dts/arm/berlin2q-marvell-dmp.dts (props changed) head/sys/gnu/dts/arm/berlin2q.dtsi (props changed) head/sys/gnu/dts/arm/compulab-sb-som.dtsi (props changed) head/sys/gnu/dts/arm/cros-adc-thermistors.dtsi (props changed) head/sys/gnu/dts/arm/cros-ec-keyboard.dtsi (props changed) head/sys/gnu/dts/arm/cros-ec-sbs.dtsi (props changed) head/sys/gnu/dts/arm/cx92755_equinox.dts (props changed) head/sys/gnu/dts/arm/da850-enbw-cmc.dts (props changed) head/sys/gnu/dts/arm/da850-evm.dts (props changed) head/sys/gnu/dts/arm/da850-lego-ev3.dts (props changed) head/sys/gnu/dts/arm/da850.dtsi (props changed) head/sys/gnu/dts/arm/dm8148-evm.dts (props changed) head/sys/gnu/dts/arm/dm8148-t410.dts (props changed) head/sys/gnu/dts/arm/dm814x-clocks.dtsi (props changed) head/sys/gnu/dts/arm/dm8168-evm.dts (props changed) head/sys/gnu/dts/arm/dm816x-clocks.dtsi (props changed) head/sys/gnu/dts/arm/dm816x.dtsi (props changed) head/sys/gnu/dts/arm/dove-cm-a510.dtsi (props changed) head/sys/gnu/dts/arm/dove-cubox-es.dts (props changed) head/sys/gnu/dts/arm/dove-cubox.dts (props changed) head/sys/gnu/dts/arm/dove-d2plug.dts (props changed) head/sys/gnu/dts/arm/dove-d3plug.dts (props changed) head/sys/gnu/dts/arm/dove-dove-db.dts (props changed) head/sys/gnu/dts/arm/dove-sbc-a510.dts (props changed) head/sys/gnu/dts/arm/dra62x-clocks.dtsi (props changed) head/sys/gnu/dts/arm/dra62x-j5eco-evm.dts (props changed) head/sys/gnu/dts/arm/dra62x.dtsi (props changed) head/sys/gnu/dts/arm/dra7-dspeve-thermal.dtsi (props changed) head/sys/gnu/dts/arm/dra7-evm-common.dtsi (props changed) head/sys/gnu/dts/arm/dra7-evm.dts (props changed) head/sys/gnu/dts/arm/dra7-iva-thermal.dtsi (props changed) head/sys/gnu/dts/arm/dra7-mmc-iodelay.dtsi (props changed) head/sys/gnu/dts/arm/dra7.dtsi (props changed) head/sys/gnu/dts/arm/dra71-evm.dts (props changed) head/sys/gnu/dts/arm/dra72-evm-common.dtsi (props changed) head/sys/gnu/dts/arm/dra72-evm-revc.dts (props changed) head/sys/gnu/dts/arm/dra72-evm-tps65917.dtsi (props changed) head/sys/gnu/dts/arm/dra72-evm.dts (props changed) head/sys/gnu/dts/arm/dra72x-mmc-iodelay.dtsi (props changed) head/sys/gnu/dts/arm/dra72x.dtsi (props changed) head/sys/gnu/dts/arm/dra74x-mmc-iodelay.dtsi (props changed) head/sys/gnu/dts/arm/dra74x.dtsi (props changed) head/sys/gnu/dts/arm/dra76-evm.dts (props changed) head/sys/gnu/dts/arm/dra76x-mmc-iodelay.dtsi (props changed) head/sys/gnu/dts/arm/dra76x.dtsi (props changed) head/sys/gnu/dts/arm/dra7xx-clocks.dtsi (props changed) head/sys/gnu/dts/arm/ecx-2000.dts (props changed) head/sys/gnu/dts/arm/ecx-common.dtsi (props changed) head/sys/gnu/dts/arm/efm32gg-dk3750.dts (props changed) head/sys/gnu/dts/arm/efm32gg.dtsi (props changed) head/sys/gnu/dts/arm/elpida_ecb240abacn.dtsi (props changed) head/sys/gnu/dts/arm/emev2-kzm9d.dts (props changed) head/sys/gnu/dts/arm/emev2.dtsi (props changed) head/sys/gnu/dts/arm/ep7211.dtsi (props changed) head/sys/gnu/dts/arm/ethernut5.dts (props changed) head/sys/gnu/dts/arm/evk-pro3.dts (props changed) head/sys/gnu/dts/arm/exynos-mfc-reserved-memory.dtsi (props changed) head/sys/gnu/dts/arm/exynos-syscon-restart.dtsi (props changed) head/sys/gnu/dts/arm/exynos3250-artik5-eval.dts (props changed) head/sys/gnu/dts/arm/exynos3250-artik5.dtsi (props changed) head/sys/gnu/dts/arm/exynos3250-monk.dts (props changed) head/sys/gnu/dts/arm/exynos3250-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/exynos3250-rinato.dts (props changed) head/sys/gnu/dts/arm/exynos4-cpu-thermal.dtsi (props changed) head/sys/gnu/dts/arm/exynos4.dtsi (props changed) head/sys/gnu/dts/arm/exynos4210-origen.dts (props changed) head/sys/gnu/dts/arm/exynos4210-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/exynos4210-smdkv310.dts (props changed) head/sys/gnu/dts/arm/exynos4210-trats.dts (props changed) head/sys/gnu/dts/arm/exynos4210-universal_c210.dts (props changed) head/sys/gnu/dts/arm/exynos4210.dtsi (props changed) head/sys/gnu/dts/arm/exynos4212.dtsi (props changed) head/sys/gnu/dts/arm/exynos4412-galaxy-s3.dtsi (props changed) head/sys/gnu/dts/arm/exynos4412-i9300.dts (props changed) head/sys/gnu/dts/arm/exynos4412-i9305.dts (props changed) head/sys/gnu/dts/arm/exynos4412-itop-elite.dts (props changed) head/sys/gnu/dts/arm/exynos4412-itop-scp-core.dtsi (props changed) head/sys/gnu/dts/arm/exynos4412-midas.dtsi (props changed) head/sys/gnu/dts/arm/exynos4412-n710x.dts (props changed) head/sys/gnu/dts/arm/exynos4412-odroidu3.dts (props changed) head/sys/gnu/dts/arm/exynos4412-odroidx2.dts (props changed) head/sys/gnu/dts/arm/exynos4412-origen.dts (props changed) head/sys/gnu/dts/arm/exynos4412-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/exynos4412-ppmu-common.dtsi (props changed) head/sys/gnu/dts/arm/exynos4412-prime.dtsi (props changed) head/sys/gnu/dts/arm/exynos4412-smdk4412.dts (props changed) head/sys/gnu/dts/arm/exynos4412-tiny4412.dts (props changed) head/sys/gnu/dts/arm/exynos4412-trats2.dts (props changed) head/sys/gnu/dts/arm/exynos4412.dtsi (props changed) head/sys/gnu/dts/arm/exynos4415-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/exynos4415.dtsi (props changed) head/sys/gnu/dts/arm/exynos4x12-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/exynos4x12.dtsi (props changed) head/sys/gnu/dts/arm/exynos5.dtsi (props changed) head/sys/gnu/dts/arm/exynos5250-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/exynos5250-smdk5250.dts (props changed) head/sys/gnu/dts/arm/exynos5250-snow-common.dtsi (props changed) head/sys/gnu/dts/arm/exynos5250-snow-rev5.dts (props changed) head/sys/gnu/dts/arm/exynos5250-snow.dts (props changed) head/sys/gnu/dts/arm/exynos5250-spring.dts (props changed) head/sys/gnu/dts/arm/exynos5250.dtsi (props changed) head/sys/gnu/dts/arm/exynos5260-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/exynos5260-xyref5260.dts (props changed) head/sys/gnu/dts/arm/exynos5260.dtsi (props changed) head/sys/gnu/dts/arm/exynos5410-odroidxu.dts (props changed) head/sys/gnu/dts/arm/exynos5410-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/exynos5410-smdk5410.dts (props changed) head/sys/gnu/dts/arm/exynos5410.dtsi (props changed) head/sys/gnu/dts/arm/exynos5420-arndale-octa.dts (props changed) head/sys/gnu/dts/arm/exynos5420-cpus.dtsi (props changed) head/sys/gnu/dts/arm/exynos5420-peach-pit.dts (props changed) head/sys/gnu/dts/arm/exynos5420-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/exynos5420-smdk5420.dts (props changed) head/sys/gnu/dts/arm/exynos5420-trip-points.dtsi (props changed) head/sys/gnu/dts/arm/exynos5420.dtsi (props changed) head/sys/gnu/dts/arm/exynos5422-cpu-thermal.dtsi (props changed) head/sys/gnu/dts/arm/exynos5422-cpus.dtsi (props changed) head/sys/gnu/dts/arm/exynos5422-odroidhc1.dts (props changed) head/sys/gnu/dts/arm/exynos5422-odroidxu3.dts (props changed) head/sys/gnu/dts/arm/exynos54xx-odroidxu-leds.dtsi (props changed) head/sys/gnu/dts/arm/exynos54xx.dtsi (props changed) head/sys/gnu/dts/arm/exynos5800-peach-pi.dts (props changed) head/sys/gnu/dts/arm/exynos5800.dtsi (props changed) head/sys/gnu/dts/arm/facebook-bmc-flash-layout.dtsi (props changed) head/sys/gnu/dts/arm/ge863-pro3.dtsi (props changed) head/sys/gnu/dts/arm/gemini-dlink-dir-685.dts (props changed) head/sys/gnu/dts/arm/gemini-dlink-dns-313.dts (props changed) head/sys/gnu/dts/arm/gemini-nas4220b.dts (props changed) head/sys/gnu/dts/arm/gemini-rut1xx.dts (props changed) head/sys/gnu/dts/arm/gemini-sl93512r.dts (props changed) head/sys/gnu/dts/arm/gemini-sq201.dts (props changed) head/sys/gnu/dts/arm/gemini-wbd111.dts (props changed) head/sys/gnu/dts/arm/gemini-wbd222.dts (props changed) head/sys/gnu/dts/arm/gemini.dtsi (props changed) head/sys/gnu/dts/arm/gr-peach-audiocamerashield.dtsi (props changed) head/sys/gnu/dts/arm/hi3519-demb.dts (props changed) head/sys/gnu/dts/arm/hi3519.dtsi (props changed) head/sys/gnu/dts/arm/hi3620-hi4511.dts (props changed) head/sys/gnu/dts/arm/hi3620.dtsi (props changed) head/sys/gnu/dts/arm/highbank.dts (props changed) head/sys/gnu/dts/arm/hip01-ca9x2.dts (props changed) head/sys/gnu/dts/arm/hip01.dtsi (props changed) head/sys/gnu/dts/arm/hip04-d01.dts (props changed) head/sys/gnu/dts/arm/hip04.dtsi (props changed) head/sys/gnu/dts/arm/hisi-x5hd2-dkb.dts (props changed) head/sys/gnu/dts/arm/hisi-x5hd2.dtsi (props changed) head/sys/gnu/dts/arm/imx1-ads.dts (props changed) head/sys/gnu/dts/arm/imx1-apf9328.dts (props changed) head/sys/gnu/dts/arm/imx1-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx1.dtsi (props changed) head/sys/gnu/dts/arm/imx23-evk.dts (props changed) head/sys/gnu/dts/arm/imx23-olinuxino.dts (props changed) head/sys/gnu/dts/arm/imx23-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx23-sansa.dts (props changed) head/sys/gnu/dts/arm/imx23-stmp378x_devb.dts (props changed) head/sys/gnu/dts/arm/imx23-xfi3.dts (props changed) head/sys/gnu/dts/arm/imx23.dtsi (props changed) head/sys/gnu/dts/arm/imx25-eukrea-cpuimx25.dtsi (props changed) head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts (props changed) head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts (props changed) head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts (props changed) head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard.dts (props changed) head/sys/gnu/dts/arm/imx25-karo-tx25.dts (props changed) head/sys/gnu/dts/arm/imx25-pdk.dts (props changed) head/sys/gnu/dts/arm/imx25-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx25.dtsi (props changed) head/sys/gnu/dts/arm/imx27-apf27.dts (props changed) head/sys/gnu/dts/arm/imx27-apf27dev.dts (props changed) head/sys/gnu/dts/arm/imx27-eukrea-cpuimx27.dtsi (props changed) head/sys/gnu/dts/arm/imx27-eukrea-mbimxsd27-baseboard.dts (props changed) head/sys/gnu/dts/arm/imx27-pdk.dts (props changed) head/sys/gnu/dts/arm/imx27-phytec-phycard-s-rdk.dts (props changed) head/sys/gnu/dts/arm/imx27-phytec-phycard-s-som.dtsi (props changed) head/sys/gnu/dts/arm/imx27-phytec-phycore-rdk.dts (props changed) head/sys/gnu/dts/arm/imx27-phytec-phycore-som.dtsi (props changed) head/sys/gnu/dts/arm/imx27-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx28-apf28.dts (props changed) head/sys/gnu/dts/arm/imx28-apf28dev.dts (props changed) head/sys/gnu/dts/arm/imx28-apx4devkit.dts (props changed) head/sys/gnu/dts/arm/imx28-cfa10037.dts (props changed) head/sys/gnu/dts/arm/imx28-cfa10049.dts (props changed) head/sys/gnu/dts/arm/imx28-cfa10055.dts (props changed) head/sys/gnu/dts/arm/imx28-cfa10056.dts (props changed) head/sys/gnu/dts/arm/imx28-cfa10057.dts (props changed) head/sys/gnu/dts/arm/imx28-cfa10058.dts (props changed) head/sys/gnu/dts/arm/imx28-duckbill-2-485.dts (props changed) head/sys/gnu/dts/arm/imx28-duckbill-2-enocean.dts (props changed) head/sys/gnu/dts/arm/imx28-duckbill-2-spi.dts (props changed) head/sys/gnu/dts/arm/imx28-duckbill-2.dts (props changed) head/sys/gnu/dts/arm/imx28-duckbill.dts (props changed) head/sys/gnu/dts/arm/imx28-eukrea-mbmx283lc.dts (props changed) head/sys/gnu/dts/arm/imx28-eukrea-mbmx287lc.dts (props changed) head/sys/gnu/dts/arm/imx28-eukrea-mbmx28lc.dtsi (props changed) head/sys/gnu/dts/arm/imx28-evk.dts (props changed) head/sys/gnu/dts/arm/imx28-m28.dtsi (props changed) head/sys/gnu/dts/arm/imx28-m28cu3.dts (props changed) head/sys/gnu/dts/arm/imx28-m28evk.dts (props changed) head/sys/gnu/dts/arm/imx28-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx28-sps1.dts (props changed) head/sys/gnu/dts/arm/imx28-ts4600.dts (props changed) head/sys/gnu/dts/arm/imx28-tx28.dts (props changed) head/sys/gnu/dts/arm/imx28.dtsi (props changed) head/sys/gnu/dts/arm/imx31-bug.dts (props changed) head/sys/gnu/dts/arm/imx31-lite.dts (props changed) head/sys/gnu/dts/arm/imx31.dtsi (props changed) head/sys/gnu/dts/arm/imx35-eukrea-cpuimx35.dtsi (props changed) head/sys/gnu/dts/arm/imx35-eukrea-mbimxsd35-baseboard.dts (props changed) head/sys/gnu/dts/arm/imx35-pdk.dts (props changed) head/sys/gnu/dts/arm/imx35-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx35.dtsi (props changed) head/sys/gnu/dts/arm/imx50-evk.dts (props changed) head/sys/gnu/dts/arm/imx50-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx50.dtsi (props changed) head/sys/gnu/dts/arm/imx51-apf51.dts (props changed) head/sys/gnu/dts/arm/imx51-apf51dev.dts (props changed) head/sys/gnu/dts/arm/imx51-babbage.dts (props changed) head/sys/gnu/dts/arm/imx51-eukrea-cpuimx51.dtsi (props changed) head/sys/gnu/dts/arm/imx51-eukrea-mbimxsd51-baseboard.dts (props changed) head/sys/gnu/dts/arm/imx51-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx51-ts4800.dts (props changed) head/sys/gnu/dts/arm/imx51-zii-rdu1.dts (props changed) head/sys/gnu/dts/arm/imx51-zii-scu2-mezz.dts (props changed) head/sys/gnu/dts/arm/imx51-zii-scu3-esb.dts (props changed) head/sys/gnu/dts/arm/imx51.dtsi (props changed) head/sys/gnu/dts/arm/imx53-ard.dts (props changed) head/sys/gnu/dts/arm/imx53-cx9020.dts (props changed) head/sys/gnu/dts/arm/imx53-kp-ddc.dts (props changed) head/sys/gnu/dts/arm/imx53-kp-hsc.dts (props changed) head/sys/gnu/dts/arm/imx53-kp.dtsi (props changed) head/sys/gnu/dts/arm/imx53-m53.dtsi (props changed) head/sys/gnu/dts/arm/imx53-m53evk.dts (props changed) head/sys/gnu/dts/arm/imx53-mba53.dts (props changed) head/sys/gnu/dts/arm/imx53-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx53-ppd.dts (props changed) head/sys/gnu/dts/arm/imx53-qsb-common.dtsi (props changed) head/sys/gnu/dts/arm/imx53-qsb.dts (props changed) head/sys/gnu/dts/arm/imx53-qsrb.dts (props changed) head/sys/gnu/dts/arm/imx53-smd.dts (props changed) head/sys/gnu/dts/arm/imx53-tqma53.dtsi (props changed) head/sys/gnu/dts/arm/imx53-tx53-x03x.dts (props changed) head/sys/gnu/dts/arm/imx53-tx53-x13x.dts (props changed) head/sys/gnu/dts/arm/imx53-tx53.dtsi (props changed) head/sys/gnu/dts/arm/imx53-usbarmory.dts (props changed) head/sys/gnu/dts/arm/imx53-voipac-bsb.dts (props changed) head/sys/gnu/dts/arm/imx53-voipac-dmm-668.dtsi (props changed) head/sys/gnu/dts/arm/imx53.dtsi (props changed) head/sys/gnu/dts/arm/imx6dl-apf6dev.dts (props changed) head/sys/gnu/dts/arm/imx6dl-aristainetos2_4.dts (props changed) head/sys/gnu/dts/arm/imx6dl-aristainetos2_7.dts (props changed) head/sys/gnu/dts/arm/imx6dl-aristainetos_4.dts (props changed) head/sys/gnu/dts/arm/imx6dl-aristainetos_7.dts (props changed) head/sys/gnu/dts/arm/imx6dl-cubox-i-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-cubox-i-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-cubox-i.dts (props changed) head/sys/gnu/dts/arm/imx6dl-dfi-fs700-m60.dts (props changed) head/sys/gnu/dts/arm/imx6dl-emcon-avari.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw51xx.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw52xx.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw53xx.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw54xx.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw551x.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw552x.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw553x.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw560x.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw5903.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw5904.dts (props changed) head/sys/gnu/dts/arm/imx6dl-hummingboard-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-hummingboard-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-hummingboard.dts (props changed) head/sys/gnu/dts/arm/imx6dl-hummingboard2-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-hummingboard2-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6dl-hummingboard2.dts (props changed) head/sys/gnu/dts/arm/imx6dl-icore-mipi.dts (props changed) head/sys/gnu/dts/arm/imx6dl-icore-rqs.dts (props changed) head/sys/gnu/dts/arm/imx6dl-icore.dts (props changed) head/sys/gnu/dts/arm/imx6dl-mamoj.dts (props changed) head/sys/gnu/dts/arm/imx6dl-nit6xlite.dts (props changed) head/sys/gnu/dts/arm/imx6dl-nitrogen6x.dts (props changed) head/sys/gnu/dts/arm/imx6dl-phytec-mira-rdk-nand.dts (props changed) head/sys/gnu/dts/arm/imx6dl-phytec-pbab01.dts (props changed) head/sys/gnu/dts/arm/imx6dl-phytec-pfla02.dtsi (props changed) head/sys/gnu/dts/arm/imx6dl-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx6dl-rex-basic.dts (props changed) head/sys/gnu/dts/arm/imx6dl-riotboard.dts (props changed) head/sys/gnu/dts/arm/imx6dl-sabreauto.dts (props changed) head/sys/gnu/dts/arm/imx6dl-sabrelite.dts (props changed) head/sys/gnu/dts/arm/imx6dl-sabresd.dts (props changed) head/sys/gnu/dts/arm/imx6dl-savageboard.dts (props changed) head/sys/gnu/dts/arm/imx6dl-ts4900.dts (props changed) head/sys/gnu/dts/arm/imx6dl-ts7970.dts (props changed) head/sys/gnu/dts/arm/imx6dl-tx6dl-comtft.dts (props changed) head/sys/gnu/dts/arm/imx6dl-tx6s-8034-mb7.dts (props changed) head/sys/gnu/dts/arm/imx6dl-tx6s-8034.dts (props changed) head/sys/gnu/dts/arm/imx6dl-tx6s-8035-mb7.dts (props changed) head/sys/gnu/dts/arm/imx6dl-tx6s-8035.dts (props changed) head/sys/gnu/dts/arm/imx6dl-tx6u-801x.dts (props changed) head/sys/gnu/dts/arm/imx6dl-tx6u-8033-mb7.dts (props changed) head/sys/gnu/dts/arm/imx6dl-tx6u-8033.dts (props changed) head/sys/gnu/dts/arm/imx6dl-tx6u-80xx-mb7.dts (props changed) head/sys/gnu/dts/arm/imx6dl-tx6u-811x.dts (props changed) head/sys/gnu/dts/arm/imx6dl-tx6u-81xx-mb7.dts (props changed) head/sys/gnu/dts/arm/imx6dl-udoo.dts (props changed) head/sys/gnu/dts/arm/imx6dl-wandboard-revb1.dts (props changed) head/sys/gnu/dts/arm/imx6dl-wandboard-revd1.dts (props changed) head/sys/gnu/dts/arm/imx6dl-wandboard.dts (props changed) head/sys/gnu/dts/arm/imx6dl.dtsi (props changed) head/sys/gnu/dts/arm/imx6q-apalis-eval.dts (props changed) head/sys/gnu/dts/arm/imx6q-apalis-ixora-v1.1.dts (props changed) head/sys/gnu/dts/arm/imx6q-apalis-ixora.dts (props changed) head/sys/gnu/dts/arm/imx6q-apf6dev.dts (props changed) head/sys/gnu/dts/arm/imx6q-arm2.dts (props changed) head/sys/gnu/dts/arm/imx6q-b450v3.dts (props changed) head/sys/gnu/dts/arm/imx6q-b650v3.dts (props changed) head/sys/gnu/dts/arm/imx6q-b850v3.dts (props changed) head/sys/gnu/dts/arm/imx6q-ba16.dtsi (props changed) head/sys/gnu/dts/arm/imx6q-bx50v3.dtsi (props changed) head/sys/gnu/dts/arm/imx6q-cm-fx6.dts (props changed) head/sys/gnu/dts/arm/imx6q-cubox-i-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-cubox-i-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-cubox-i.dts (props changed) head/sys/gnu/dts/arm/imx6q-dfi-fs700-m60.dts (props changed) head/sys/gnu/dts/arm/imx6q-dhcom-pdk2.dts (props changed) head/sys/gnu/dts/arm/imx6q-dhcom-som.dtsi (props changed) head/sys/gnu/dts/arm/imx6q-display5-tianma-tm070-1280x768.dts (props changed) head/sys/gnu/dts/arm/imx6q-display5.dtsi (props changed) head/sys/gnu/dts/arm/imx6q-dmo-edmqmx6.dts (props changed) head/sys/gnu/dts/arm/imx6q-dms-ba16.dts (props changed) head/sys/gnu/dts/arm/imx6q-emcon-avari.dts (props changed) head/sys/gnu/dts/arm/imx6q-evi.dts (props changed) head/sys/gnu/dts/arm/imx6q-gk802.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw51xx.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw52xx.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw53xx.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw5400-a.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw54xx.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw551x.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw552x.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw553x.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw560x.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw5903.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw5904.dts (props changed) head/sys/gnu/dts/arm/imx6q-h100.dts (props changed) head/sys/gnu/dts/arm/imx6q-hummingboard-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-hummingboard-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-hummingboard.dts (props changed) head/sys/gnu/dts/arm/imx6q-hummingboard2-emmc-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-hummingboard2-som-v15.dts (props changed) head/sys/gnu/dts/arm/imx6q-hummingboard2.dts (props changed) head/sys/gnu/dts/arm/imx6q-icore-mipi.dts (props changed) head/sys/gnu/dts/arm/imx6q-icore-ofcap10.dts (props changed) head/sys/gnu/dts/arm/imx6q-icore-ofcap12.dts (props changed) head/sys/gnu/dts/arm/imx6q-icore-rqs.dts (props changed) head/sys/gnu/dts/arm/imx6q-icore.dts (props changed) head/sys/gnu/dts/arm/imx6q-kp-tpc.dts (props changed) head/sys/gnu/dts/arm/imx6q-kp.dtsi (props changed) head/sys/gnu/dts/arm/imx6q-marsboard.dts (props changed) head/sys/gnu/dts/arm/imx6q-mccmon6.dts (props changed) head/sys/gnu/dts/arm/imx6q-nitrogen6_max.dts (props changed) head/sys/gnu/dts/arm/imx6q-nitrogen6_som2.dts (props changed) head/sys/gnu/dts/arm/imx6q-nitrogen6x.dts (props changed) head/sys/gnu/dts/arm/imx6q-novena.dts (props changed) head/sys/gnu/dts/arm/imx6q-phytec-mira-rdk-emmc.dts (props changed) head/sys/gnu/dts/arm/imx6q-phytec-mira-rdk-nand.dts (props changed) head/sys/gnu/dts/arm/imx6q-phytec-pbab01.dts (props changed) head/sys/gnu/dts/arm/imx6q-phytec-pfla02.dtsi (props changed) head/sys/gnu/dts/arm/imx6q-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx6q-pistachio.dts (props changed) head/sys/gnu/dts/arm/imx6q-rex-pro.dts (props changed) head/sys/gnu/dts/arm/imx6q-sabreauto.dts (props changed) head/sys/gnu/dts/arm/imx6q-sabrelite.dts (props changed) head/sys/gnu/dts/arm/imx6q-sabresd.dts (props changed) head/sys/gnu/dts/arm/imx6q-savageboard.dts (props changed) head/sys/gnu/dts/arm/imx6q-sbc6x.dts (props changed) head/sys/gnu/dts/arm/imx6q-ts4900.dts (props changed) head/sys/gnu/dts/arm/imx6q-ts7970.dts (props changed) head/sys/gnu/dts/arm/imx6q-tx6q-1010-comtft.dts (props changed) head/sys/gnu/dts/arm/imx6q-tx6q-1010.dts (props changed) head/sys/gnu/dts/arm/imx6q-tx6q-1020-comtft.dts (props changed) head/sys/gnu/dts/arm/imx6q-tx6q-1020.dts (props changed) head/sys/gnu/dts/arm/imx6q-tx6q-1036-mb7.dts (props changed) head/sys/gnu/dts/arm/imx6q-tx6q-1036.dts (props changed) head/sys/gnu/dts/arm/imx6q-tx6q-10x0-mb7.dts (props changed) head/sys/gnu/dts/arm/imx6q-tx6q-1110.dts (props changed) head/sys/gnu/dts/arm/imx6q-tx6q-11x0-mb7.dts (props changed) head/sys/gnu/dts/arm/imx6q-udoo.dts (props changed) head/sys/gnu/dts/arm/imx6q-utilite-pro.dts (props changed) head/sys/gnu/dts/arm/imx6q-var-dt6customboard.dts (props changed) head/sys/gnu/dts/arm/imx6q-wandboard-revb1.dts (props changed) head/sys/gnu/dts/arm/imx6q-wandboard-revd1.dts (props changed) head/sys/gnu/dts/arm/imx6q-wandboard.dts (props changed) head/sys/gnu/dts/arm/imx6q-zii-rdu2.dts (props changed) head/sys/gnu/dts/arm/imx6q.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-apf6.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-apf6dev.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-aristainetos.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-aristainetos2.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-cubox-i.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-dfi-fs700-m60.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-emcon-avari.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-emcon.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-gw51xx.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-gw52xx.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-gw53xx.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-gw54xx.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-gw551x.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-gw552x.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-gw553x.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-gw560x.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-gw5903.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-gw5904.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-hummingboard.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-hummingboard2-emmc.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-hummingboard2.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-icore-1.5.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-icore.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-nit6xlite.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-nitrogen6_max.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-nitrogen6_som2.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-nitrogen6x.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-phytec-mira.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-phytec-pbab01.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-phytec-phycore-som.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-rex.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-sabrelite.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-savageboard.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-sr-som-brcm.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-sr-som-emmc.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-sr-som-ti.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-sr-som.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-ts4900.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-ts7970.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-tx6-lcd.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-tx6-lvds.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-tx6-mb7.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-tx6.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-udoo.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-var-dart.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-wandboard-revb1.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-wandboard-revc1.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-wandboard-revd1.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl.dtsi (props changed) head/sys/gnu/dts/arm/imx6qp-nitrogen6_max.dts (props changed) head/sys/gnu/dts/arm/imx6qp-nitrogen6_som2.dts (props changed) head/sys/gnu/dts/arm/imx6qp-phytec-mira-rdk-nand.dts (props changed) head/sys/gnu/dts/arm/imx6qp-sabreauto.dts (props changed) head/sys/gnu/dts/arm/imx6qp-sabresd.dts (props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8037-mb7.dts (props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8037.dts (props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8137-mb7.dts (props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8137.dts (props changed) head/sys/gnu/dts/arm/imx6qp-wandboard-revd1.dts (props changed) head/sys/gnu/dts/arm/imx6qp-zii-rdu2.dts (props changed) head/sys/gnu/dts/arm/imx6qp.dtsi (props changed) head/sys/gnu/dts/arm/imx6sl-evk.dts (props changed) head/sys/gnu/dts/arm/imx6sl-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx6sl-warp.dts (props changed) head/sys/gnu/dts/arm/imx6sll-evk.dts (props changed) head/sys/gnu/dts/arm/imx6sll-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx6sll.dtsi (props changed) head/sys/gnu/dts/arm/imx6sx-nitrogen6sx.dts (props changed) head/sys/gnu/dts/arm/imx6sx-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx6sx-sabreauto.dts (props changed) head/sys/gnu/dts/arm/imx6sx-sdb-reva.dts (props changed) head/sys/gnu/dts/arm/imx6sx-sdb-sai.dts (props changed) head/sys/gnu/dts/arm/imx6sx-sdb.dts (props changed) head/sys/gnu/dts/arm/imx6sx-sdb.dtsi (props changed) head/sys/gnu/dts/arm/imx6sx-softing-vining-2000.dts (props changed) head/sys/gnu/dts/arm/imx6sx-udoo-neo-basic.dts (props changed) head/sys/gnu/dts/arm/imx6sx-udoo-neo-extended.dts (props changed) head/sys/gnu/dts/arm/imx6sx-udoo-neo-full.dts (props changed) head/sys/gnu/dts/arm/imx6sx-udoo-neo.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul-14x14-evk.dts (props changed) head/sys/gnu/dts/arm/imx6ul-14x14-evk.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul-ccimx6ulsbcexpress.dts (props changed) head/sys/gnu/dts/arm/imx6ul-ccimx6ulsbcpro.dts (props changed) head/sys/gnu/dts/arm/imx6ul-ccimx6ulsom.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul-geam.dts (props changed) head/sys/gnu/dts/arm/imx6ul-isiot-emmc.dts (props changed) head/sys/gnu/dts/arm/imx6ul-isiot-nand.dts (props changed) head/sys/gnu/dts/arm/imx6ul-isiot.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul-liteboard.dts (props changed) head/sys/gnu/dts/arm/imx6ul-litesom.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul-opos6ul.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul-opos6uldev.dts (props changed) head/sys/gnu/dts/arm/imx6ul-pico-hobbit.dts (props changed) head/sys/gnu/dts/arm/imx6ul-pico-pi.dts (props changed) head/sys/gnu/dts/arm/imx6ul-pico.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx6ul-tx6ul-0010.dts (props changed) head/sys/gnu/dts/arm/imx6ul-tx6ul-0011.dts (props changed) head/sys/gnu/dts/arm/imx6ul-tx6ul-mainboard.dts (props changed) head/sys/gnu/dts/arm/imx6ul-tx6ul.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul.dtsi (props changed) head/sys/gnu/dts/arm/imx6ull-14x14-evk.dts (props changed) head/sys/gnu/dts/arm/imx6ull-colibri-eval-v3.dts (props changed) head/sys/gnu/dts/arm/imx6ull-colibri-eval-v3.dtsi (props changed) head/sys/gnu/dts/arm/imx6ull-colibri-nonwifi.dtsi (props changed) head/sys/gnu/dts/arm/imx6ull-colibri-wifi-eval-v3.dts (props changed) head/sys/gnu/dts/arm/imx6ull-colibri-wifi.dtsi (props changed) head/sys/gnu/dts/arm/imx6ull-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx6ulz-14x14-evk.dts (props changed) head/sys/gnu/dts/arm/imx6ulz.dtsi (props changed) head/sys/gnu/dts/arm/imx7-colibri-eval-v3.dtsi (props changed) head/sys/gnu/dts/arm/imx7-colibri.dtsi (props changed) head/sys/gnu/dts/arm/imx7d-cl-som-imx7.dts (props changed) head/sys/gnu/dts/arm/imx7d-colibri-emmc-eval-v3.dts (props changed) head/sys/gnu/dts/arm/imx7d-colibri-emmc.dtsi (props changed) head/sys/gnu/dts/arm/imx7d-colibri-eval-v3.dts (props changed) head/sys/gnu/dts/arm/imx7d-colibri.dtsi (props changed) head/sys/gnu/dts/arm/imx7d-nitrogen7.dts (props changed) head/sys/gnu/dts/arm/imx7d-pico-hobbit.dts (props changed) head/sys/gnu/dts/arm/imx7d-pico-pi.dts (props changed) head/sys/gnu/dts/arm/imx7d-pico.dtsi (props changed) head/sys/gnu/dts/arm/imx7d-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx7d-sbc-imx7.dts (props changed) head/sys/gnu/dts/arm/imx7d-sdb-reva.dts (props changed) head/sys/gnu/dts/arm/imx7d-sdb-sht11.dts (props changed) head/sys/gnu/dts/arm/imx7d-sdb.dts (props changed) head/sys/gnu/dts/arm/imx7s-colibri-eval-v3.dts (props changed) head/sys/gnu/dts/arm/imx7s-colibri.dtsi (props changed) head/sys/gnu/dts/arm/imx7s-warp.dts (props changed) head/sys/gnu/dts/arm/imx7s.dtsi (props changed) head/sys/gnu/dts/arm/imx7ulp-evk.dts (props changed) head/sys/gnu/dts/arm/imx7ulp-pinfunc.h (props changed) head/sys/gnu/dts/arm/integratorap.dts (props changed) head/sys/gnu/dts/arm/iwg20d-q7-common.dtsi (props changed) head/sys/gnu/dts/arm/iwg20d-q7-dbcm-ca.dtsi (props changed) head/sys/gnu/dts/arm/keystone-clocks.dtsi (props changed) head/sys/gnu/dts/arm/keystone-k2e-clocks.dtsi (props changed) head/sys/gnu/dts/arm/keystone-k2e-evm.dts (props changed) head/sys/gnu/dts/arm/keystone-k2e-netcp.dtsi (props changed) head/sys/gnu/dts/arm/keystone-k2e.dtsi (props changed) head/sys/gnu/dts/arm/keystone-k2g-evm.dts (props changed) head/sys/gnu/dts/arm/keystone-k2g-ice.dts (props changed) head/sys/gnu/dts/arm/keystone-k2g-netcp.dtsi (props changed) head/sys/gnu/dts/arm/keystone-k2g.dtsi (props changed) head/sys/gnu/dts/arm/keystone-k2hk-clocks.dtsi (props changed) head/sys/gnu/dts/arm/keystone-k2hk-evm.dts (props changed) head/sys/gnu/dts/arm/keystone-k2hk-netcp.dtsi (props changed) head/sys/gnu/dts/arm/keystone-k2hk.dtsi (props changed) head/sys/gnu/dts/arm/keystone-k2l-clocks.dtsi (props changed) head/sys/gnu/dts/arm/keystone-k2l-evm.dts (props changed) head/sys/gnu/dts/arm/keystone-k2l-netcp.dtsi (props changed) head/sys/gnu/dts/arm/keystone-k2l.dtsi (props changed) head/sys/gnu/dts/arm/keystone.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-6192.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-6281.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-6282.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-98dx4122.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-b3.dts (props changed) head/sys/gnu/dts/arm/kirkwood-blackarmor-nas220.dts (props changed) head/sys/gnu/dts/arm/kirkwood-cloudbox.dts (props changed) head/sys/gnu/dts/arm/kirkwood-d2net.dts (props changed) head/sys/gnu/dts/arm/kirkwood-db-88f6281.dts (props changed) head/sys/gnu/dts/arm/kirkwood-db-88f6282.dts (props changed) head/sys/gnu/dts/arm/kirkwood-db.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-dns320.dts (props changed) head/sys/gnu/dts/arm/kirkwood-dns325.dts (props changed) head/sys/gnu/dts/arm/kirkwood-dnskw.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-dockstar.dts (props changed) head/sys/gnu/dts/arm/kirkwood-dreamplug.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds109.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds110jv10.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds111.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds112.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds209.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds210.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds212.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds212j.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds409.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds409slim.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds411.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds411j.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ds411slim.dts (props changed) head/sys/gnu/dts/arm/kirkwood-goflexnet.dts (props changed) head/sys/gnu/dts/arm/kirkwood-guruplug-server-plus.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ib62x0.dts (props changed) head/sys/gnu/dts/arm/kirkwood-iconnect.dts (props changed) head/sys/gnu/dts/arm/kirkwood-iomega_ix2_200.dts (props changed) head/sys/gnu/dts/arm/kirkwood-is2.dts (props changed) head/sys/gnu/dts/arm/kirkwood-km_common.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-km_fixedeth.dts (props changed) head/sys/gnu/dts/arm/kirkwood-km_kirkwood.dts (props changed) head/sys/gnu/dts/arm/kirkwood-laplug.dts (props changed) head/sys/gnu/dts/arm/kirkwood-linkstation-6282.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-linkstation-duo-6281.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-linkstation-lsqvl.dts (props changed) head/sys/gnu/dts/arm/kirkwood-linkstation-lsvl.dts (props changed) head/sys/gnu/dts/arm/kirkwood-linkstation-lswsxl.dts (props changed) head/sys/gnu/dts/arm/kirkwood-linkstation-lswvl.dts (props changed) head/sys/gnu/dts/arm/kirkwood-linkstation-lswxl.dts (props changed) head/sys/gnu/dts/arm/kirkwood-linkstation.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-lschlv2.dts (props changed) head/sys/gnu/dts/arm/kirkwood-lsxhl.dts (props changed) head/sys/gnu/dts/arm/kirkwood-lsxl.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-mplcec4.dts (props changed) head/sys/gnu/dts/arm/kirkwood-nas2big.dts (props changed) head/sys/gnu/dts/arm/kirkwood-net2big.dts (props changed) head/sys/gnu/dts/arm/kirkwood-net5big.dts (props changed) head/sys/gnu/dts/arm/kirkwood-netgear_readynas_duo_v2.dts (props changed) head/sys/gnu/dts/arm/kirkwood-netgear_readynas_nv+_v2.dts (props changed) head/sys/gnu/dts/arm/kirkwood-netxbig.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-ns2-common.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-ns2.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ns2lite.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ns2max.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ns2mini.dts (props changed) head/sys/gnu/dts/arm/kirkwood-nsa310.dts (props changed) head/sys/gnu/dts/arm/kirkwood-nsa310a.dts (props changed) head/sys/gnu/dts/arm/kirkwood-nsa320.dts (props changed) head/sys/gnu/dts/arm/kirkwood-nsa325.dts (props changed) head/sys/gnu/dts/arm/kirkwood-nsa3x0-common.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-openblocks_a6.dts (props changed) head/sys/gnu/dts/arm/kirkwood-openblocks_a7.dts (props changed) head/sys/gnu/dts/arm/kirkwood-openrd-base.dts (props changed) head/sys/gnu/dts/arm/kirkwood-openrd-client.dts (props changed) head/sys/gnu/dts/arm/kirkwood-openrd-ultimate.dts (props changed) head/sys/gnu/dts/arm/kirkwood-openrd.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-pogo_e02.dts (props changed) head/sys/gnu/dts/arm/kirkwood-pogoplug-series-4.dts (props changed) head/sys/gnu/dts/arm/kirkwood-rd88f6192.dts (props changed) head/sys/gnu/dts/arm/kirkwood-rd88f6281-a.dts (props changed) head/sys/gnu/dts/arm/kirkwood-rs212.dts (props changed) head/sys/gnu/dts/arm/kirkwood-rs409.dts (props changed) head/sys/gnu/dts/arm/kirkwood-rs411.dts (props changed) head/sys/gnu/dts/arm/kirkwood-sheevaplug-common.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-sheevaplug-esata.dts (props changed) head/sys/gnu/dts/arm/kirkwood-sheevaplug.dts (props changed) head/sys/gnu/dts/arm/kirkwood-synology.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-t5325.dts (props changed) head/sys/gnu/dts/arm/kirkwood-topkick.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ts219-6281.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ts219-6282.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ts219.dtsi (props changed) head/sys/gnu/dts/arm/kirkwood-ts419-6281.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ts419-6282.dts (props changed) head/sys/gnu/dts/arm/kirkwood-ts419.dtsi (props changed) head/sys/gnu/dts/arm/logicpd-som-lv-35xx-devkit.dts (props changed) head/sys/gnu/dts/arm/logicpd-som-lv-37xx-devkit.dts (props changed) head/sys/gnu/dts/arm/logicpd-som-lv-baseboard.dtsi (props changed) head/sys/gnu/dts/arm/logicpd-som-lv.dtsi (props changed) head/sys/gnu/dts/arm/logicpd-torpedo-35xx-devkit.dts (props changed) head/sys/gnu/dts/arm/logicpd-torpedo-37xx-devkit.dts (props changed) head/sys/gnu/dts/arm/logicpd-torpedo-baseboard.dtsi (props changed) head/sys/gnu/dts/arm/logicpd-torpedo-som.dtsi (props changed) head/sys/gnu/dts/arm/lpc18xx.dtsi (props changed) head/sys/gnu/dts/arm/lpc4337-ciaa.dts (props changed) head/sys/gnu/dts/arm/lpc4350.dtsi (props changed) head/sys/gnu/dts/arm/lpc4357.dtsi (props changed) head/sys/gnu/dts/arm/motorola-cpcap-mapphone.dtsi (props changed) head/sys/gnu/dts/arm/moxart-uc7112lx.dts (props changed) head/sys/gnu/dts/arm/mpa1600.dts (props changed) head/sys/gnu/dts/arm/mps2-an385.dts (props changed) head/sys/gnu/dts/arm/mps2-an399.dts (props changed) head/sys/gnu/dts/arm/mt2701-pinfunc.h (props changed) head/sys/gnu/dts/arm/mt6323.dtsi (props changed) head/sys/gnu/dts/arm/mt7623a-rfb-emmc.dts (props changed) head/sys/gnu/dts/arm/mt7623a-rfb-nand.dts (props changed) head/sys/gnu/dts/arm/mt7623a.dtsi (props changed) head/sys/gnu/dts/arm/mt7623n-bananapi-bpi-r2.dts (props changed) head/sys/gnu/dts/arm/mt7623n-rfb-emmc.dts (props changed) head/sys/gnu/dts/arm/mt8135-pinfunc.h (props changed) head/sys/gnu/dts/arm/mvebu-linkstation-fan.dtsi (props changed) head/sys/gnu/dts/arm/mvebu-linkstation-gpio-simple.dtsi (props changed) head/sys/gnu/dts/arm/mxs-pinfunc.h (props changed) head/sys/gnu/dts/arm/nspire-classic.dtsi (props changed) head/sys/gnu/dts/arm/nspire-clp.dts (props changed) head/sys/gnu/dts/arm/nspire-cx.dts (props changed) head/sys/gnu/dts/arm/nspire-tp.dts (props changed) head/sys/gnu/dts/arm/nuvoton-common-npcm7xx.dtsi (props changed) head/sys/gnu/dts/arm/nuvoton-npcm750-evb.dts (props changed) head/sys/gnu/dts/arm/nuvoton-npcm750.dtsi (props changed) head/sys/gnu/dts/arm/omap-gpmc-smsc911x.dtsi (props changed) head/sys/gnu/dts/arm/omap-gpmc-smsc9221.dtsi (props changed) head/sys/gnu/dts/arm/omap-zoom-common.dtsi (props changed) head/sys/gnu/dts/arm/omap2.dtsi (props changed) head/sys/gnu/dts/arm/omap2420-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap2420-h4.dts (props changed) head/sys/gnu/dts/arm/omap2420-n800.dts (props changed) head/sys/gnu/dts/arm/omap2420-n810-wimax.dts (props changed) head/sys/gnu/dts/arm/omap2420-n810.dts (props changed) head/sys/gnu/dts/arm/omap2420-n8x0-common.dtsi (props changed) head/sys/gnu/dts/arm/omap2420.dtsi (props changed) head/sys/gnu/dts/arm/omap2430-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap2430-sdp.dts (props changed) head/sys/gnu/dts/arm/omap2430.dtsi (props changed) head/sys/gnu/dts/arm/omap24xx-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap3-beagle-xm-ab.dts (props changed) head/sys/gnu/dts/arm/omap3-beagle-xm.dts (props changed) head/sys/gnu/dts/arm/omap3-beagle.dts (props changed) head/sys/gnu/dts/arm/omap3-cm-t3517.dts (props changed) head/sys/gnu/dts/arm/omap3-cm-t3530.dts (props changed) head/sys/gnu/dts/arm/omap3-cm-t3730.dts (props changed) head/sys/gnu/dts/arm/omap3-cm-t3x.dtsi (props changed) head/sys/gnu/dts/arm/omap3-cm-t3x30.dtsi (props changed) head/sys/gnu/dts/arm/omap3-cpu-thermal.dtsi (props changed) head/sys/gnu/dts/arm/omap3-devkit8000-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-devkit8000-lcd-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-devkit8000-lcd43.dts (props changed) head/sys/gnu/dts/arm/omap3-devkit8000-lcd70.dts (props changed) head/sys/gnu/dts/arm/omap3-devkit8000.dts (props changed) head/sys/gnu/dts/arm/omap3-evm-37xx.dts (props changed) head/sys/gnu/dts/arm/omap3-evm.dts (props changed) head/sys/gnu/dts/arm/omap3-gta04a3.dts (props changed) head/sys/gnu/dts/arm/omap3-gta04a4.dts (props changed) head/sys/gnu/dts/arm/omap3-gta04a5one.dts (props changed) head/sys/gnu/dts/arm/omap3-ha-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-ha-lcd.dts (props changed) head/sys/gnu/dts/arm/omap3-ha.dts (props changed) head/sys/gnu/dts/arm/omap3-igep.dtsi (props changed) head/sys/gnu/dts/arm/omap3-igep0020-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-igep0020-rev-f.dts (props changed) head/sys/gnu/dts/arm/omap3-igep0020.dts (props changed) head/sys/gnu/dts/arm/omap3-igep0030-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-igep0030-rev-g.dts (props changed) head/sys/gnu/dts/arm/omap3-igep0030.dts (props changed) head/sys/gnu/dts/arm/omap3-ldp.dts (props changed) head/sys/gnu/dts/arm/omap3-lilly-a83x.dtsi (props changed) head/sys/gnu/dts/arm/omap3-lilly-dbb056.dts (props changed) head/sys/gnu/dts/arm/omap3-n9.dts (props changed) head/sys/gnu/dts/arm/omap3-n900.dts (props changed) head/sys/gnu/dts/arm/omap3-n950-n9.dtsi (props changed) head/sys/gnu/dts/arm/omap3-n950.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-alto35-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-alto35.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-base.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-chestnut43-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-chestnut43.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-common-dvi.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-common-lcd35.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-common-lcd43.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-common-peripherals.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-gallop43-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-gallop43.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-palo35-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-palo35.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-palo43-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-palo43.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-storm-alto35.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-storm-chestnut43.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-storm-gallop43.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-storm-palo35.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-storm-palo43.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-storm-summit.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-storm-tobi.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-storm-tobiduo.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-storm.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-summit-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-summit.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-tobi-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-tobi.dts (props changed) head/sys/gnu/dts/arm/omap3-overo-tobiduo-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-overo-tobiduo.dts (props changed) head/sys/gnu/dts/arm/omap3-overo.dtsi (props changed) head/sys/gnu/dts/arm/omap3-pandora-1ghz.dts (props changed) head/sys/gnu/dts/arm/omap3-pandora-600mhz.dts (props changed) head/sys/gnu/dts/arm/omap3-pandora-common.dtsi (props changed) head/sys/gnu/dts/arm/omap3-panel-sharp-ls037v7dw01.dtsi (props changed) head/sys/gnu/dts/arm/omap3-sb-t35.dtsi (props changed) head/sys/gnu/dts/arm/omap3-sbc-t3517.dts (props changed) head/sys/gnu/dts/arm/omap3-sbc-t3530.dts (props changed) head/sys/gnu/dts/arm/omap3-sbc-t3730.dts (props changed) head/sys/gnu/dts/arm/omap3-sniper.dts (props changed) head/sys/gnu/dts/arm/omap3-tao3530.dtsi (props changed) head/sys/gnu/dts/arm/omap3-thunder.dts (props changed) head/sys/gnu/dts/arm/omap3-zoom3.dts (props changed) head/sys/gnu/dts/arm/omap3.dtsi (props changed) head/sys/gnu/dts/arm/omap3430-sdp.dts (props changed) head/sys/gnu/dts/arm/omap3430es1-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap34xx-omap36xx-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap34xx.dtsi (props changed) head/sys/gnu/dts/arm/omap36xx-am35xx-omap3430es2plus-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap36xx-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap36xx-omap3430es2plus-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap36xx.dtsi (props changed) head/sys/gnu/dts/arm/omap3xxx-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap4-cpu-thermal.dtsi (props changed) head/sys/gnu/dts/arm/omap4-duovero-parlor.dts (props changed) head/sys/gnu/dts/arm/omap4-duovero.dtsi (props changed) head/sys/gnu/dts/arm/omap4-kc1.dts (props changed) head/sys/gnu/dts/arm/omap4-l4.dtsi (props changed) head/sys/gnu/dts/arm/omap4-panda-a4.dts (props changed) head/sys/gnu/dts/arm/omap4-panda-es.dts (props changed) head/sys/gnu/dts/arm/omap4-panda.dts (props changed) head/sys/gnu/dts/arm/omap4-sdp-es23plus.dts (props changed) head/sys/gnu/dts/arm/omap4-var-dvk-om44.dts (props changed) head/sys/gnu/dts/arm/omap4-var-om44customboard.dtsi (props changed) head/sys/gnu/dts/arm/omap4-var-som-om44-wlan.dtsi (props changed) head/sys/gnu/dts/arm/omap4-var-som-om44.dtsi (props changed) head/sys/gnu/dts/arm/omap4-var-stk-om44.dts (props changed) head/sys/gnu/dts/arm/omap4.dtsi (props changed) head/sys/gnu/dts/arm/omap443x-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap443x.dtsi (props changed) head/sys/gnu/dts/arm/omap4460.dtsi (props changed) head/sys/gnu/dts/arm/omap446x-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap44xx-clocks.dtsi (props changed) head/sys/gnu/dts/arm/omap5-board-common.dtsi (props changed) head/sys/gnu/dts/arm/omap5-cm-t54.dts (props changed) head/sys/gnu/dts/arm/omap5-core-thermal.dtsi (props changed) head/sys/gnu/dts/arm/omap5-gpu-thermal.dtsi (props changed) head/sys/gnu/dts/arm/omap5-igep0050.dts (props changed) head/sys/gnu/dts/arm/omap5-l4.dtsi (props changed) head/sys/gnu/dts/arm/omap5-sbc-t54.dts (props changed) head/sys/gnu/dts/arm/omap5-uevm.dts (props changed) head/sys/gnu/dts/arm/omap5.dtsi (props changed) head/sys/gnu/dts/arm/omap54xx-clocks.dtsi (props changed) head/sys/gnu/dts/arm/openbmc-flash-layout.dtsi (props changed) head/sys/gnu/dts/arm/orion5x-kuroboxpro.dts (props changed) head/sys/gnu/dts/arm/orion5x-linkstation-lschl.dts (props changed) head/sys/gnu/dts/arm/orion5x-linkstation-lsgl.dts (props changed) head/sys/gnu/dts/arm/orion5x-linkstation-lswtgl.dts (props changed) head/sys/gnu/dts/arm/orion5x-linkstation.dtsi (props changed) head/sys/gnu/dts/arm/orion5x-mv88f5181.dtsi (props changed) head/sys/gnu/dts/arm/orion5x-mv88f5182.dtsi (props changed) head/sys/gnu/dts/arm/owl-s500-cubieboard6.dts (props changed) head/sys/gnu/dts/arm/owl-s500-guitar-bb-rev-b.dts (props changed) head/sys/gnu/dts/arm/owl-s500-guitar.dtsi (props changed) head/sys/gnu/dts/arm/owl-s500-sparky.dts (props changed) head/sys/gnu/dts/arm/owl-s500.dtsi (props changed) head/sys/gnu/dts/arm/ox810se-wd-mbwe.dts (props changed) head/sys/gnu/dts/arm/ox820-cloudengines-pogoplug-series-3.dts (props changed) head/sys/gnu/dts/arm/picoxcell-pc7302-pc3x2.dts (props changed) head/sys/gnu/dts/arm/picoxcell-pc7302-pc3x3.dts (props changed) head/sys/gnu/dts/arm/pm9g45.dts (props changed) head/sys/gnu/dts/arm/pxa168-aspenite.dts (props changed) head/sys/gnu/dts/arm/pxa25x.dtsi (props changed) head/sys/gnu/dts/arm/pxa27x.dtsi (props changed) head/sys/gnu/dts/arm/pxa300-raumfeld-common.dtsi (props changed) head/sys/gnu/dts/arm/pxa300-raumfeld-connector.dts (props changed) head/sys/gnu/dts/arm/pxa300-raumfeld-controller.dts (props changed) head/sys/gnu/dts/arm/pxa300-raumfeld-speaker-l.dts (props changed) head/sys/gnu/dts/arm/pxa300-raumfeld-speaker-m.dts (props changed) head/sys/gnu/dts/arm/pxa300-raumfeld-speaker-one.dts (props changed) head/sys/gnu/dts/arm/pxa300-raumfeld-speaker-s.dts (props changed) head/sys/gnu/dts/arm/pxa300-raumfeld-tuneable-clock.dtsi (props changed) head/sys/gnu/dts/arm/pxa3xx.dtsi (props changed) head/sys/gnu/dts/arm/pxa910-dkb.dts (props changed) head/sys/gnu/dts/arm/qcom-apq8064-arrow-db600c-pins.dtsi (props changed) head/sys/gnu/dts/arm/qcom-apq8064-arrow-db600c.dts (props changed) head/sys/gnu/dts/arm/qcom-apq8064-asus-nexus7-flo.dts (props changed) head/sys/gnu/dts/arm/qcom-apq8064-cm-qs600.dts (props changed) head/sys/gnu/dts/arm/qcom-apq8064-ifc6410.dts (props changed) head/sys/gnu/dts/arm/qcom-apq8064-pins.dtsi (props changed) head/sys/gnu/dts/arm/qcom-apq8064-sony-xperia-yuga.dts (props changed) head/sys/gnu/dts/arm/qcom-apq8064-v2.0.dtsi (props changed) head/sys/gnu/dts/arm/qcom-apq8074-dragonboard.dts (props changed) head/sys/gnu/dts/arm/qcom-apq8084-ifc6540.dts (props changed) head/sys/gnu/dts/arm/qcom-apq8084-mtp.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk01.1-c1.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk01.1.dtsi (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk04.1-c1.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk04.1-c3.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk04.1.dtsi (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk07.1-c1.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk07.1-c2.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq4019-ap.dk07.1.dtsi (props changed) head/sys/gnu/dts/arm/qcom-ipq8064-ap148.dts (props changed) head/sys/gnu/dts/arm/qcom-ipq8064-v1.0.dtsi (props changed) head/sys/gnu/dts/arm/qcom-mdm9615-wp8548-mangoh-green.dts (props changed) head/sys/gnu/dts/arm/qcom-msm8660-surf.dts (props changed) head/sys/gnu/dts/arm/qcom-msm8960-cdp.dts (props changed) head/sys/gnu/dts/arm/qcom-msm8974-fairphone-fp2.dts (props changed) head/sys/gnu/dts/arm/qcom-msm8974-samsung-klte.dts (props changed) head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-amami.dts (props changed) head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-castor.dts (props changed) head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-honami.dts (props changed) head/sys/gnu/dts/arm/qcom-msm8974pro.dtsi (props changed) head/sys/gnu/dts/arm/qcom-pm8841.dtsi (props changed) head/sys/gnu/dts/arm/r7s72100-genmai.dts (props changed) head/sys/gnu/dts/arm/r7s72100-gr-peach.dts (props changed) head/sys/gnu/dts/arm/r7s72100-rskrza1.dts (props changed) head/sys/gnu/dts/arm/r7s72100.dtsi (props changed) head/sys/gnu/dts/arm/r8a73a4-ape6evm.dts (props changed) head/sys/gnu/dts/arm/r8a73a4.dtsi (props changed) head/sys/gnu/dts/arm/r8a7740-armadillo800eva.dts (props changed) head/sys/gnu/dts/arm/r8a7740.dtsi (props changed) head/sys/gnu/dts/arm/r8a7743-iwg20d-q7-dbcm-ca.dts (props changed) head/sys/gnu/dts/arm/r8a7743-iwg20d-q7.dts (props changed) head/sys/gnu/dts/arm/r8a7743-iwg20m.dtsi (props changed) head/sys/gnu/dts/arm/r8a7743-sk-rzg1m.dts (props changed) head/sys/gnu/dts/arm/r8a7744-iwg20d-q7-dbcm-ca.dts (props changed) head/sys/gnu/dts/arm/r8a7744-iwg20d-q7.dts (props changed) head/sys/gnu/dts/arm/r8a7744-iwg20m.dtsi (props changed) head/sys/gnu/dts/arm/r8a7745-iwg22d-sodimm-dbhd-ca.dts (props changed) head/sys/gnu/dts/arm/r8a7745-iwg22d-sodimm.dts (props changed) head/sys/gnu/dts/arm/r8a7745-iwg22m.dtsi (props changed) head/sys/gnu/dts/arm/r8a7745-sk-rzg1e.dts (props changed) head/sys/gnu/dts/arm/r8a7745.dtsi (props changed) head/sys/gnu/dts/arm/r8a77470.dtsi (props changed) head/sys/gnu/dts/arm/r8a7778-bockw.dts (props changed) head/sys/gnu/dts/arm/r8a7779-marzen.dts (props changed) head/sys/gnu/dts/arm/r8a7790-lager.dts (props changed) head/sys/gnu/dts/arm/r8a7790.dtsi (props changed) head/sys/gnu/dts/arm/r8a7791-koelsch.dts (props changed) head/sys/gnu/dts/arm/r8a7791-porter.dts (props changed) head/sys/gnu/dts/arm/r8a7791.dtsi (props changed) head/sys/gnu/dts/arm/r8a7792-blanche.dts (props changed) head/sys/gnu/dts/arm/r8a7792-wheat.dts (props changed) head/sys/gnu/dts/arm/r8a7792.dtsi (props changed) head/sys/gnu/dts/arm/r8a7793-gose.dts (props changed) head/sys/gnu/dts/arm/r8a7793.dtsi (props changed) head/sys/gnu/dts/arm/r8a7794-alt.dts (props changed) head/sys/gnu/dts/arm/r8a7794-silk.dts (props changed) head/sys/gnu/dts/arm/r8a7794.dtsi (props changed) head/sys/gnu/dts/arm/r8a77xx-aa104xd12-panel.dtsi (props changed) head/sys/gnu/dts/arm/r8a77xx-aa121td01-panel.dtsi (props changed) head/sys/gnu/dts/arm/r9a06g032-rzn1d400-db.dts (props changed) head/sys/gnu/dts/arm/r9a06g032.dtsi (props changed) head/sys/gnu/dts/arm/rda8810pl-orangepi-2g-iot.dts (props changed) head/sys/gnu/dts/arm/rda8810pl-orangepi-i96.dts (props changed) head/sys/gnu/dts/arm/rda8810pl.dtsi (props changed) head/sys/gnu/dts/arm/rk1108-evb.dts (props changed) head/sys/gnu/dts/arm/rk1108.dtsi (props changed) head/sys/gnu/dts/arm/rk3036-evb.dts (props changed) head/sys/gnu/dts/arm/rk3066a-marsboard.dts (props changed) head/sys/gnu/dts/arm/rk3188-radxarock.dts (props changed) head/sys/gnu/dts/arm/rk3188.dtsi (props changed) head/sys/gnu/dts/arm/rk3228-evb.dts (props changed) head/sys/gnu/dts/arm/rk3228.dtsi (props changed) head/sys/gnu/dts/arm/rk3229.dtsi (props changed) head/sys/gnu/dts/arm/rk322x.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-evb-act8846.dts (props changed) head/sys/gnu/dts/arm/rk3288-evb-rk808.dts (props changed) head/sys/gnu/dts/arm/rk3288-evb.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-firefly-beta.dts (props changed) head/sys/gnu/dts/arm/rk3288-firefly-reload-core.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-firefly.dts (props changed) head/sys/gnu/dts/arm/rk3288-firefly.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-phycore-rdk.dts (props changed) head/sys/gnu/dts/arm/rk3288-phycore-som.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-r89.dts (props changed) head/sys/gnu/dts/arm/rk3288-rock2-som.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-tinker.dts (props changed) head/sys/gnu/dts/arm/rk3288-veyron-analog-audio.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-veyron-brain.dts (props changed) head/sys/gnu/dts/arm/rk3288-veyron-chromebook.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-veyron-jaq.dts (props changed) head/sys/gnu/dts/arm/rk3288-veyron-jerry.dts (props changed) head/sys/gnu/dts/arm/rk3288-veyron-mickey.dts (props changed) head/sys/gnu/dts/arm/rk3288-veyron-minnie.dts (props changed) head/sys/gnu/dts/arm/rk3288-veyron-pinky.dts (props changed) head/sys/gnu/dts/arm/rk3288-veyron-sdmmc.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-veyron-speedy.dts (props changed) head/sys/gnu/dts/arm/rk3xxx.dtsi (props changed) head/sys/gnu/dts/arm/s3c2416-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/s3c2416.dtsi (props changed) head/sys/gnu/dts/arm/s3c24xx.dtsi (props changed) head/sys/gnu/dts/arm/s3c6400.dtsi (props changed) head/sys/gnu/dts/arm/s3c6410-mini6410.dts (props changed) head/sys/gnu/dts/arm/s3c6410-smdk6410.dts (props changed) head/sys/gnu/dts/arm/s3c6410.dtsi (props changed) head/sys/gnu/dts/arm/s3c64xx-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/s3c64xx.dtsi (props changed) head/sys/gnu/dts/arm/s5pv210-aquila.dts (props changed) head/sys/gnu/dts/arm/s5pv210-goni.dts (props changed) head/sys/gnu/dts/arm/s5pv210-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/s5pv210-smdkc110.dts (props changed) head/sys/gnu/dts/arm/s5pv210-smdkv210.dts (props changed) head/sys/gnu/dts/arm/s5pv210-torbreck.dts (props changed) head/sys/gnu/dts/arm/sama5d31.dtsi (props changed) head/sys/gnu/dts/arm/sama5d31ek.dts (props changed) head/sys/gnu/dts/arm/sama5d33.dtsi (props changed) head/sys/gnu/dts/arm/sama5d33ek.dts (props changed) head/sys/gnu/dts/arm/sama5d34.dtsi (props changed) head/sys/gnu/dts/arm/sama5d34ek.dts (props changed) head/sys/gnu/dts/arm/sama5d35.dtsi (props changed) head/sys/gnu/dts/arm/sama5d35ek.dts (props changed) head/sys/gnu/dts/arm/sama5d36.dtsi (props changed) head/sys/gnu/dts/arm/sama5d36ek.dts (props changed) head/sys/gnu/dts/arm/sama5d36ek_cmp.dts (props changed) head/sys/gnu/dts/arm/sama5d3_can.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3_emac.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3_gmac.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3_lcd.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3_mci2.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3_tcb1.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3_uart.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3xcm.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3xcm_cmp.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3xdm.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3xmb.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3xmb_cmp.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3xmb_emac.dtsi (props changed) head/sys/gnu/dts/arm/sama5d3xmb_gmac.dtsi (props changed) head/sys/gnu/dts/arm/sh73a0-kzm9g.dts (props changed) head/sys/gnu/dts/arm/sh73a0.dtsi (props changed) head/sys/gnu/dts/arm/socfpga_arria10_socdk.dtsi (props changed) head/sys/gnu/dts/arm/socfpga_arria10_socdk_nand.dts (props changed) head/sys/gnu/dts/arm/socfpga_arria10_socdk_qspi.dts (props changed) head/sys/gnu/dts/arm/socfpga_arria10_socdk_sdmmc.dts (props changed) head/sys/gnu/dts/arm/socfpga_arria5.dtsi (props changed) head/sys/gnu/dts/arm/socfpga_arria5_socdk.dts (props changed) head/sys/gnu/dts/arm/socfpga_cyclone5.dtsi (props changed) head/sys/gnu/dts/arm/socfpga_cyclone5_de0_nano_soc.dts (props changed) head/sys/gnu/dts/arm/socfpga_cyclone5_mcv.dtsi (props changed) head/sys/gnu/dts/arm/socfpga_cyclone5_mcvevk.dts (props changed) head/sys/gnu/dts/arm/socfpga_cyclone5_socdk.dts (props changed) head/sys/gnu/dts/arm/socfpga_cyclone5_sockit.dts (props changed) head/sys/gnu/dts/arm/socfpga_cyclone5_socrates.dts (props changed) head/sys/gnu/dts/arm/socfpga_cyclone5_sodia.dts (props changed) head/sys/gnu/dts/arm/socfpga_cyclone5_vining_fpga.dts (props changed) head/sys/gnu/dts/arm/socfpga_vt.dts (props changed) head/sys/gnu/dts/arm/spear1310-evb.dts (props changed) head/sys/gnu/dts/arm/spear1310.dtsi (props changed) head/sys/gnu/dts/arm/spear1340-evb.dts (props changed) head/sys/gnu/dts/arm/spear1340.dtsi (props changed) head/sys/gnu/dts/arm/spear300-evb.dts (props changed) head/sys/gnu/dts/arm/spear300.dtsi (props changed) head/sys/gnu/dts/arm/spear310-evb.dts (props changed) head/sys/gnu/dts/arm/spear310.dtsi (props changed) head/sys/gnu/dts/arm/spear320-evb.dts (props changed) head/sys/gnu/dts/arm/spear320-hmi.dts (props changed) head/sys/gnu/dts/arm/spear320.dtsi (props changed) head/sys/gnu/dts/arm/spear600-evb.dts (props changed) head/sys/gnu/dts/arm/st-pincfg.h (props changed) head/sys/gnu/dts/arm/ste-dbx5x0.dtsi (props changed) head/sys/gnu/dts/arm/ste-href-ab8500.dtsi (props changed) head/sys/gnu/dts/arm/ste-href-ab8505.dtsi (props changed) head/sys/gnu/dts/arm/ste-href-family-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/ste-href-stuib.dtsi (props changed) head/sys/gnu/dts/arm/ste-href-tvk1281618.dtsi (props changed) head/sys/gnu/dts/arm/ste-href.dtsi (props changed) head/sys/gnu/dts/arm/ste-hrefprev60-stuib.dts (props changed) head/sys/gnu/dts/arm/ste-hrefprev60-tvk.dts (props changed) head/sys/gnu/dts/arm/ste-hrefprev60.dtsi (props changed) head/sys/gnu/dts/arm/ste-hrefv60plus-stuib.dts (props changed) head/sys/gnu/dts/arm/ste-hrefv60plus-tvk.dts (props changed) head/sys/gnu/dts/arm/ste-hrefv60plus.dtsi (props changed) head/sys/gnu/dts/arm/ste-nomadik-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/ste-nomadik-s8815.dts (props changed) head/sys/gnu/dts/arm/ste-snowball.dts (props changed) head/sys/gnu/dts/arm/stih407-b2120.dts (props changed) head/sys/gnu/dts/arm/stih407-clock.dtsi (props changed) head/sys/gnu/dts/arm/stih407-family.dtsi (props changed) head/sys/gnu/dts/arm/stih407-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stih407.dtsi (props changed) head/sys/gnu/dts/arm/stih410-b2120.dts (props changed) head/sys/gnu/dts/arm/stih410-b2260.dts (props changed) head/sys/gnu/dts/arm/stih410-clock.dtsi (props changed) head/sys/gnu/dts/arm/stih410-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stih410.dtsi (props changed) head/sys/gnu/dts/arm/stih415-b2000.dts (props changed) head/sys/gnu/dts/arm/stih415-b2020.dts (props changed) head/sys/gnu/dts/arm/stih415-clock.dtsi (props changed) head/sys/gnu/dts/arm/stih415-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stih415.dtsi (props changed) head/sys/gnu/dts/arm/stih416-b2000.dts (props changed) head/sys/gnu/dts/arm/stih416-b2020.dts (props changed) head/sys/gnu/dts/arm/stih416-b2020e.dts (props changed) head/sys/gnu/dts/arm/stih416-clock.dtsi (props changed) head/sys/gnu/dts/arm/stih416-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stih416.dtsi (props changed) head/sys/gnu/dts/arm/stih418-b2199.dts (props changed) head/sys/gnu/dts/arm/stih418-clock.dtsi (props changed) head/sys/gnu/dts/arm/stih418.dtsi (props changed) head/sys/gnu/dts/arm/stih41x-b2000.dtsi (props changed) head/sys/gnu/dts/arm/stih41x-b2020.dtsi (props changed) head/sys/gnu/dts/arm/stih41x-b2020x.dtsi (props changed) head/sys/gnu/dts/arm/stih41x.dtsi (props changed) head/sys/gnu/dts/arm/stihxxx-b2120.dtsi (props changed) head/sys/gnu/dts/arm/stm32f4-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32f429-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32f469-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32f469.dtsi (props changed) head/sys/gnu/dts/arm/stm32f7-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32f746-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32f769-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/sun4i-a10-a1000.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-ba10-tvbox.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-chuwi-v7-cw0825.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-cubieboard.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-dserve-dsrv9703c.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-gemei-g9.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-hackberry.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-hyundai-a7hd.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-inet1.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-inet97fv2.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-inet9f-rev03.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-itead-iteaduino-plus.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-jesurun-q5.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-marsboard.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-mini-xplus.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-mk802.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-mk802ii.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-olinuxino-lime.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-pcduino.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-pcduino2.dts (props changed) head/sys/gnu/dts/arm/sun4i-a10-pov-protab2-ips9.dts (props changed) head/sys/gnu/dts/arm/sun5i-a10s-auxtek-t003.dts (props changed) head/sys/gnu/dts/arm/sun5i-a10s-auxtek-t004.dts (props changed) head/sys/gnu/dts/arm/sun5i-a10s-mk802.dts (props changed) head/sys/gnu/dts/arm/sun5i-a10s-olinuxino-micro.dts (props changed) head/sys/gnu/dts/arm/sun5i-a10s-r7-tv-dongle.dts (props changed) head/sys/gnu/dts/arm/sun5i-a10s-wobo-i5.dts (props changed) head/sys/gnu/dts/arm/sun5i-a10s.dtsi (props changed) head/sys/gnu/dts/arm/sun5i-a13-difrnce-dit4350.dts (props changed) head/sys/gnu/dts/arm/sun5i-a13-empire-electronix-d709.dts (props changed) head/sys/gnu/dts/arm/sun5i-a13-empire-electronix-m712.dts (props changed) head/sys/gnu/dts/arm/sun5i-a13-hsg-h702.dts (props changed) head/sys/gnu/dts/arm/sun5i-a13-inet-98v-rev2.dts (props changed) head/sys/gnu/dts/arm/sun5i-a13-licheepi-one.dts (props changed) head/sys/gnu/dts/arm/sun5i-a13-olinuxino-micro.dts (props changed) head/sys/gnu/dts/arm/sun5i-a13-olinuxino.dts (props changed) head/sys/gnu/dts/arm/sun5i-a13-utoo-p66.dts (props changed) head/sys/gnu/dts/arm/sun5i-a13.dtsi (props changed) head/sys/gnu/dts/arm/sun5i-gr8-chip-pro.dts (props changed) head/sys/gnu/dts/arm/sun5i-gr8-evb.dts (props changed) head/sys/gnu/dts/arm/sun5i-gr8.dtsi (props changed) head/sys/gnu/dts/arm/sun5i-q8-common.dtsi (props changed) head/sys/gnu/dts/arm/sun5i-r8-chip.dts (props changed) head/sys/gnu/dts/arm/sun5i-r8.dtsi (props changed) head/sys/gnu/dts/arm/sun5i.dtsi (props changed) head/sys/gnu/dts/arm/sun6i-a31-app4-evb1.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31-colombus.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31-hummingbird.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31-i7.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31-m9.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31-mele-a1000g-quad.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31.dtsi (props changed) head/sys/gnu/dts/arm/sun6i-a31s-colorfly-e708-q1.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31s-cs908.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31s-inet-q972.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31s-primo81.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31s-sina31s-core.dtsi (props changed) head/sys/gnu/dts/arm/sun6i-a31s-sina31s.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31s-sinovoip-bpi-m2.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31s-yones-toptech-bs1078-v2.dts (props changed) head/sys/gnu/dts/arm/sun6i-a31s.dtsi (props changed) head/sys/gnu/dts/arm/sun6i-reference-design-tablet.dtsi (props changed) head/sys/gnu/dts/arm/sun7i-a20-bananapi-m1-plus.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-bananapro.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-cubieboard2.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-cubietruck.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-hummingbird.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-i12-tvbox.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-icnova-swac.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-itead-ibox.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-lamobo-r1.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-m3.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-mk808c.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb-emmc.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-olimex-som204-evb-emmc.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-olimex-som204-evb.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2-emmc.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro-emmc.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-orangepi-mini.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-orangepi.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-pcduino3-nano.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-pcduino3.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-wexler-tab7200.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20-wits-pro-a20-dkt.dts (props changed) head/sys/gnu/dts/arm/sun7i-a20.dtsi (props changed) head/sys/gnu/dts/arm/sun8i-a23-evb.dts (props changed) head/sys/gnu/dts/arm/sun8i-a23-gt90h-v4.dts (props changed) head/sys/gnu/dts/arm/sun8i-a23-inet86dz.dts (props changed) head/sys/gnu/dts/arm/sun8i-a23-polaroid-mid2407pxe03.dts (props changed) head/sys/gnu/dts/arm/sun8i-a23-polaroid-mid2809pxe04.dts (props changed) head/sys/gnu/dts/arm/sun8i-a33-et-q8-v1.6.dts (props changed) head/sys/gnu/dts/arm/sun8i-a33-ga10h-v1.1.dts (props changed) head/sys/gnu/dts/arm/sun8i-a33-inet-d978-rev2.dts (props changed) head/sys/gnu/dts/arm/sun8i-a33-ippo-q8h-v1.2.dts (props changed) head/sys/gnu/dts/arm/sun8i-a33-olinuxino.dts (props changed) head/sys/gnu/dts/arm/sun8i-a33-q8-tablet.dts (props changed) head/sys/gnu/dts/arm/sun8i-a33-sinlinx-sina33.dts (props changed) head/sys/gnu/dts/arm/sun8i-a83t-tbs-a711.dts (props changed) head/sys/gnu/dts/arm/sun8i-a83t.dtsi (props changed) head/sys/gnu/dts/arm/sun8i-h2-plus-bananapi-m2-zero.dts (props changed) head/sys/gnu/dts/arm/sun8i-h2-plus-libretech-all-h3-cc.dts (props changed) head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-r1.dts (props changed) head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus-v1.2.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-beelink-x2.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-libretech-all-h3-cc.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-mapleboard-mp130.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-nanopi-neo-air.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-nanopi-neo.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-nanopi.dtsi (props changed) head/sys/gnu/dts/arm/sun8i-h3-orangepi-2.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-orangepi-lite.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-orangepi-one.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc-plus.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-orangepi-plus.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-orangepi-plus2e.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-orangepi-zero-plus2.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3.dtsi (props changed) head/sys/gnu/dts/arm/sun8i-r16-bananapi-m2m.dts (props changed) head/sys/gnu/dts/arm/sun8i-r16-nintendo-nes-classic.dts (props changed) head/sys/gnu/dts/arm/sun8i-r16-nintendo-super-nes-classic.dts (props changed) head/sys/gnu/dts/arm/sun8i-r16-parrot.dts (props changed) head/sys/gnu/dts/arm/sun8i-reference-design-tablet.dtsi (props changed) head/sys/gnu/dts/arm/sun8i-t3-cqa3t-bv3.dts (props changed) head/sys/gnu/dts/arm/sun8i-v3s-licheepi-zero-dock.dts (props changed) head/sys/gnu/dts/arm/sun8i-v3s-licheepi-zero.dts (props changed) head/sys/gnu/dts/arm/sun8i-v3s.dtsi (props changed) head/sys/gnu/dts/arm/sun8i-v40-bananapi-m2-berry.dts (props changed) head/sys/gnu/dts/arm/suniv-f1c100s-licheepi-nano.dts (props changed) head/sys/gnu/dts/arm/suniv-f1c100s.dtsi (props changed) head/sys/gnu/dts/arm/sunxi-bananapi-m2-plus-v1.2.dtsi (props changed) head/sys/gnu/dts/arm/sunxi-common-regulators.dtsi (props changed) head/sys/gnu/dts/arm/sunxi-itead-core-common.dtsi (props changed) head/sys/gnu/dts/arm/sunxi-libretech-all-h3-cc.dtsi (props changed) head/sys/gnu/dts/arm/sunxi-q8-common.dtsi (props changed) head/sys/gnu/dts/arm/sunxi-reference-design-tablet.dtsi (props changed) head/sys/gnu/dts/arm/tango4-common.dtsi (props changed) head/sys/gnu/dts/arm/tango4-smp8758.dtsi (props changed) head/sys/gnu/dts/arm/tango4-vantage-1172.dts (props changed) head/sys/gnu/dts/arm/tegra114-roth.dts (props changed) head/sys/gnu/dts/arm/tegra114-tn7.dts (props changed) head/sys/gnu/dts/arm/tegra114.dtsi (props changed) head/sys/gnu/dts/arm/tegra124-apalis-emc.dtsi (props changed) head/sys/gnu/dts/arm/tegra124-apalis-eval.dts (props changed) head/sys/gnu/dts/arm/tegra124-apalis-v1.2-eval.dts (props changed) head/sys/gnu/dts/arm/tegra124-apalis-v1.2.dtsi (props changed) head/sys/gnu/dts/arm/tegra124-apalis.dtsi (props changed) head/sys/gnu/dts/arm/tegra124-jetson-tk1-emc.dtsi (props changed) head/sys/gnu/dts/arm/tegra124-nyan-big-emc.dtsi (props changed) head/sys/gnu/dts/arm/tegra124-nyan-big.dts (props changed) head/sys/gnu/dts/arm/tegra124-nyan-blaze-emc.dtsi (props changed) head/sys/gnu/dts/arm/tegra124-nyan-blaze.dts (props changed) head/sys/gnu/dts/arm/tegra124.dtsi (props changed) head/sys/gnu/dts/arm/tegra20-colibri-eval-v3.dts (props changed) head/sys/gnu/dts/arm/tegra20-colibri-iris.dts (props changed) head/sys/gnu/dts/arm/tegra20-colibri.dtsi (props changed) head/sys/gnu/dts/arm/tegra20-harmony.dts (props changed) head/sys/gnu/dts/arm/tegra20-medcom-wide.dts (props changed) head/sys/gnu/dts/arm/tegra20-paz00.dts (props changed) head/sys/gnu/dts/arm/tegra20-plutux.dts (props changed) head/sys/gnu/dts/arm/tegra20-seaboard.dts (props changed) head/sys/gnu/dts/arm/tegra20-tamonten.dtsi (props changed) head/sys/gnu/dts/arm/tegra20-tec.dts (props changed) head/sys/gnu/dts/arm/tegra20-ventana.dts (props changed) head/sys/gnu/dts/arm/tegra20-whistler.dts (props changed) head/sys/gnu/dts/arm/tegra30-apalis-eval.dts (props changed) head/sys/gnu/dts/arm/tegra30-apalis-v1.1-eval.dts (props changed) head/sys/gnu/dts/arm/tegra30-apalis-v1.1.dtsi (props changed) head/sys/gnu/dts/arm/tegra30-apalis.dtsi (props changed) head/sys/gnu/dts/arm/tegra30-cardhu-a02.dts (props changed) head/sys/gnu/dts/arm/tegra30-cardhu-a04.dts (props changed) head/sys/gnu/dts/arm/tegra30-colibri-eval-v3.dts (props changed) head/sys/gnu/dts/arm/tegra30-colibri.dtsi (props changed) head/sys/gnu/dts/arm/tegra30.dtsi (props changed) head/sys/gnu/dts/arm/tny_a9260.dts (props changed) head/sys/gnu/dts/arm/tny_a9260_common.dtsi (props changed) head/sys/gnu/dts/arm/tny_a9263.dts (props changed) head/sys/gnu/dts/arm/tny_a9g20.dts (props changed) head/sys/gnu/dts/arm/tps6507x.dtsi (props changed) head/sys/gnu/dts/arm/tps65217.dtsi (props changed) head/sys/gnu/dts/arm/tps65910.dtsi (props changed) head/sys/gnu/dts/arm/twl4030.dtsi (props changed) head/sys/gnu/dts/arm/twl4030_omap3.dtsi (props changed) head/sys/gnu/dts/arm/twl6030.dtsi (props changed) head/sys/gnu/dts/arm/twl6030_omap4.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-common32.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-ld4-ref.dts (props changed) head/sys/gnu/dts/arm/uniphier-ld4.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-ld6b-ref.dts (props changed) head/sys/gnu/dts/arm/uniphier-ld6b.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-ph1-ld4-ref.dts (props changed) head/sys/gnu/dts/arm/uniphier-ph1-ld4.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-ph1-ld6b-ref.dts (props changed) head/sys/gnu/dts/arm/uniphier-ph1-ld6b.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-ph1-pro4-ace.dts (props changed) head/sys/gnu/dts/arm/uniphier-ph1-pro4-ref.dts (props changed) head/sys/gnu/dts/arm/uniphier-ph1-pro4-sanji.dts (props changed) head/sys/gnu/dts/arm/uniphier-ph1-pro4.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-ph1-pro5.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-ph1-sld3-ref.dts (props changed) head/sys/gnu/dts/arm/uniphier-ph1-sld3.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-ph1-sld8-ref.dts (props changed) head/sys/gnu/dts/arm/uniphier-ph1-sld8.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-pro4-ace.dts (props changed) head/sys/gnu/dts/arm/uniphier-pro4-ref.dts (props changed) head/sys/gnu/dts/arm/uniphier-pro4-sanji.dts (props changed) head/sys/gnu/dts/arm/uniphier-pro4.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-pro5.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-proxstream2-gentil.dts (props changed) head/sys/gnu/dts/arm/uniphier-proxstream2-vodka.dts (props changed) head/sys/gnu/dts/arm/uniphier-proxstream2.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-pxs2-gentil.dts (props changed) head/sys/gnu/dts/arm/uniphier-pxs2-vodka.dts (props changed) head/sys/gnu/dts/arm/uniphier-pxs2.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-ref-daughter.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-sld8-ref.dts (props changed) head/sys/gnu/dts/arm/uniphier-sld8.dtsi (props changed) head/sys/gnu/dts/arm/uniphier-support-card.dtsi (props changed) head/sys/gnu/dts/arm/usb_a9260.dts (props changed) head/sys/gnu/dts/arm/usb_a9260_common.dtsi (props changed) head/sys/gnu/dts/arm/usb_a9263.dts (props changed) head/sys/gnu/dts/arm/usb_a9g20-dab-mmx.dtsi (props changed) head/sys/gnu/dts/arm/usb_a9g20.dts (props changed) head/sys/gnu/dts/arm/usb_a9g20_common.dtsi (props changed) head/sys/gnu/dts/arm/usb_a9g20_lpw.dts (props changed) head/sys/gnu/dts/arm/versatile-ab-ib2.dts (props changed) head/sys/gnu/dts/arm/versatile-pb.dts (props changed) head/sys/gnu/dts/arm/vexpress-v2p-ca15-tc1.dts (props changed) head/sys/gnu/dts/arm/vexpress-v2p-ca5s.dts (props changed) head/sys/gnu/dts/arm/vexpress-v2p-ca9.dts (props changed) head/sys/gnu/dts/arm/vf-colibri-eval-v3.dtsi (props changed) head/sys/gnu/dts/arm/vf-colibri.dtsi (props changed) head/sys/gnu/dts/arm/vf500-colibri-eval-v3.dts (props changed) head/sys/gnu/dts/arm/vf500-colibri.dtsi (props changed) head/sys/gnu/dts/arm/vf500.dtsi (props changed) head/sys/gnu/dts/arm/vf610-colibri-eval-v3.dts (props changed) head/sys/gnu/dts/arm/vf610-colibri.dtsi (props changed) head/sys/gnu/dts/arm/vf610-cosmic.dts (props changed) head/sys/gnu/dts/arm/vf610-pinfunc.h (props changed) head/sys/gnu/dts/arm/vf610-twr.dts (props changed) head/sys/gnu/dts/arm/vf610-zii-dev-rev-b.dts (props changed) head/sys/gnu/dts/arm/vf610-zii-dev-rev-c.dts (props changed) head/sys/gnu/dts/arm/vf610-zii-dev.dtsi (props changed) head/sys/gnu/dts/arm/vf610-zii-scu4-aib.dts (props changed) head/sys/gnu/dts/arm/vf610.dtsi (props changed) head/sys/gnu/dts/arm/vf610m4-colibri.dts (props changed) head/sys/gnu/dts/arm/vf610m4-cosmic.dts (props changed) head/sys/gnu/dts/arm/vf610m4.dtsi (props changed) head/sys/gnu/dts/arm/vfxxx.dtsi (props changed) head/sys/gnu/dts/arm/vt8500-bv07.dts (props changed) head/sys/gnu/dts/arm/wm8505-ref.dts (props changed) head/sys/gnu/dts/arm/wm8650-mid.dts (props changed) head/sys/gnu/dts/arm/wm8750-apc8750.dts (props changed) head/sys/gnu/dts/arm/wm8850-w70v2.dts (props changed) head/sys/gnu/dts/arm/xenvm-4.2.dts (props changed) head/sys/gnu/dts/arm/zynq-7000.dtsi (props changed) head/sys/gnu/dts/arm/zynq-cc108.dts (props changed) head/sys/gnu/dts/arm/zynq-microzed.dts (props changed) head/sys/gnu/dts/arm/zynq-parallella.dts (props changed) head/sys/gnu/dts/arm/zynq-zc702.dts (props changed) head/sys/gnu/dts/arm/zynq-zc706.dts (props changed) head/sys/gnu/dts/arm/zynq-zc770-xm010.dts (props changed) head/sys/gnu/dts/arm/zynq-zc770-xm011.dts (props changed) head/sys/gnu/dts/arm/zynq-zc770-xm012.dts (props changed) head/sys/gnu/dts/arm/zynq-zc770-xm013.dts (props changed) head/sys/gnu/dts/arm/zynq-zed.dts (props changed) head/sys/gnu/dts/arm/zynq-zybo-z7.dts (props changed) head/sys/gnu/dts/arm/zynq-zybo.dts (props changed) head/sys/gnu/dts/arm64/ (props changed) head/sys/gnu/dts/arm64/actions/s900-bubblegum-96.dts (props changed) head/sys/gnu/dts/arm64/al/alpine-v2-evp.dts (props changed) head/sys/gnu/dts/arm64/allwinner/axp803.dtsi (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-amarula-relic.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64-lts.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64-plus.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pinebook.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine-baseboard.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine.dtsi (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5-bananapi-m2-plus-v1.2.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5-bananapi-m2-plus.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5.dtsi (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5-nanopi-neo-plus2.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5-nanopi-neo2.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-pc2.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-prime.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-zero-plus.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-zero-plus2.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-lite2.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-one-plus.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi.dtsi (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64.dts (props changed) head/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk.dts (props changed) head/sys/gnu/dts/arm64/amd/amd-overdrive-rev-b0.dts (props changed) head/sys/gnu/dts/arm64/amd/amd-overdrive-rev-b1.dts (props changed) head/sys/gnu/dts/arm64/amd/amd-overdrive.dts (props changed) head/sys/gnu/dts/arm64/amd/amd-seattle-clks.dtsi (props changed) head/sys/gnu/dts/arm64/amd/amd-seattle-soc.dtsi (props changed) head/sys/gnu/dts/arm64/amd/amd-seattle-xgbe-b.dtsi (props changed) head/sys/gnu/dts/arm64/amd/husky.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-g12a-u200.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gx-p23x-q20x.dtsi (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-nanopi-k2.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-nexbox-a95x.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-odroidc2.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-p200.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-p201.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-p20x.dtsi (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95-meta.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95-pro.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95-telos.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95.dtsi (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek-hub.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek-play2.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek.dtsi (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-mali.dtsi (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-libretech-ac.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-p241.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-p230.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-p231.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-phicomm-n1.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d.dtsi (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-p281.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-tx3-mini.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-hwacom-amazetv.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-p212.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-p212.dtsi (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x.dtsi (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxm-khadas-vim2.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxm-nexbox-a1.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxm-q200.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxm-q201.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxm-rbox-pro.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-gxm-vega-s96.dts (props changed) head/sys/gnu/dts/arm64/apm/apm-merlin.dts (props changed) head/sys/gnu/dts/arm64/apm/apm-mustang.dts (props changed) head/sys/gnu/dts/arm64/arm/foundation-v8-gicv3-psci.dts (props changed) head/sys/gnu/dts/arm64/arm/foundation-v8-gicv3.dts (props changed) head/sys/gnu/dts/arm64/arm/foundation-v8-psci.dts (props changed) head/sys/gnu/dts/arm64/arm/foundation-v8-psci.dtsi (props changed) head/sys/gnu/dts/arm64/arm/foundation-v8-spin-table.dtsi (props changed) head/sys/gnu/dts/arm64/arm/foundation-v8.dts (props changed) head/sys/gnu/dts/arm64/arm/juno-clocks.dtsi (props changed) head/sys/gnu/dts/arm64/arm/juno-cs-r1r2.dtsi (props changed) head/sys/gnu/dts/arm64/arm/juno-motherboard.dtsi (props changed) head/sys/gnu/dts/arm64/bitmain/bm1880-sophon-edge.dts (props changed) head/sys/gnu/dts/arm64/bitmain/bm1880.dtsi (props changed) head/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-3-b-plus.dts (props changed) head/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-3-b.dts (props changed) head/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-cm3-io3.dts (props changed) head/sys/gnu/dts/arm64/broadcom/northstar2/ns2-clock.dtsi (props changed) head/sys/gnu/dts/arm64/broadcom/northstar2/ns2-svk.dts (props changed) head/sys/gnu/dts/arm64/broadcom/northstar2/ns2-xmc.dts (props changed) head/sys/gnu/dts/arm64/broadcom/stingray/bcm958742-base.dtsi (props changed) head/sys/gnu/dts/arm64/broadcom/stingray/bcm958742k.dts (props changed) head/sys/gnu/dts/arm64/broadcom/stingray/bcm958742t.dts (props changed) head/sys/gnu/dts/arm64/broadcom/stingray/bcm958802a802x.dts (props changed) head/sys/gnu/dts/arm64/broadcom/stingray/stingray-board-base.dtsi (props changed) head/sys/gnu/dts/arm64/broadcom/stingray/stingray-clock.dtsi (props changed) head/sys/gnu/dts/arm64/broadcom/stingray/stingray-fs4.dtsi (props changed) head/sys/gnu/dts/arm64/broadcom/stingray/stingray-pcie.dtsi (props changed) head/sys/gnu/dts/arm64/broadcom/stingray/stingray-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm64/broadcom/stingray/stingray-sata.dtsi (props changed) head/sys/gnu/dts/arm64/cavium/thunder-88xx.dts (props changed) head/sys/gnu/dts/arm64/cavium/thunder2-99xx.dts (props changed) head/sys/gnu/dts/arm64/exynos/exynos5433-bus.dtsi (props changed) head/sys/gnu/dts/arm64/exynos/exynos5433-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm64/exynos/exynos5433-tm2-common.dtsi (props changed) head/sys/gnu/dts/arm64/exynos/exynos5433-tm2.dts (props changed) head/sys/gnu/dts/arm64/exynos/exynos5433-tm2e.dts (props changed) head/sys/gnu/dts/arm64/exynos/exynos5433-tmu.dtsi (props changed) head/sys/gnu/dts/arm64/exynos/exynos7-espresso.dts (props changed) head/sys/gnu/dts/arm64/exynos/exynos7-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm64/exynos/exynos7-trip-points.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-frdm.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-frwy.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-qds.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-rdb.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-qds.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1043-post.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1043a-rdb.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1046-post.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1088a-qds.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1088a-rdb.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls2080a-qds.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls2080a-rdb.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls2080a-simu.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls2080a.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls2088a-qds.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls2088a-rdb.dts (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls2088a.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls208xa-qds.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls208xa-rdb.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/fsl-lx2160a-qds.dts (props changed) head/sys/gnu/dts/arm64/freescale/imx8mq-pinfunc.h (props changed) head/sys/gnu/dts/arm64/freescale/qoriq-bman-portals.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-10g-0.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-10g-1.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-0.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-1.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-2.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-3.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-4.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-5.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/qoriq-fman3-0.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/qoriq-qman-portals.dtsi (props changed) head/sys/gnu/dts/arm64/hisilicon/hi3670-hikey970.dts (props changed) head/sys/gnu/dts/arm64/hisilicon/hi6220-coresight.dtsi (props changed) head/sys/gnu/dts/arm64/hisilicon/hikey-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm64/hisilicon/hikey960-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm64/hisilicon/hikey970-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm64/hisilicon/hip05-d02.dts (props changed) head/sys/gnu/dts/arm64/hisilicon/hip06-d03.dts (props changed) head/sys/gnu/dts/arm64/hisilicon/hip07-d05.dts (props changed) head/sys/gnu/dts/arm64/hisilicon/poplar-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm64/lg/lg1312-ref.dts (props changed) head/sys/gnu/dts/arm64/lg/lg1313-ref.dts (props changed) head/sys/gnu/dts/arm64/marvell/armada-371x.dtsi (props changed) head/sys/gnu/dts/arm64/marvell/armada-3720-db.dts (props changed) head/sys/gnu/dts/arm64/marvell/armada-7020.dtsi (props changed) head/sys/gnu/dts/arm64/marvell/armada-7040.dtsi (props changed) head/sys/gnu/dts/arm64/marvell/armada-70x0.dtsi (props changed) head/sys/gnu/dts/arm64/marvell/armada-8020.dtsi (props changed) head/sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts (props changed) head/sys/gnu/dts/arm64/marvell/armada-8040-mcbin-singleshot.dts (props changed) head/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dts (props changed) head/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dtsi (props changed) head/sys/gnu/dts/arm64/marvell/armada-8040.dtsi (props changed) head/sys/gnu/dts/arm64/marvell/armada-8080-db.dts (props changed) head/sys/gnu/dts/arm64/marvell/armada-8080.dtsi (props changed) head/sys/gnu/dts/arm64/marvell/armada-80x0.dtsi (props changed) head/sys/gnu/dts/arm64/marvell/armada-ap810-ap0.dtsi (props changed) head/sys/gnu/dts/arm64/marvell/armada-common.dtsi (props changed) head/sys/gnu/dts/arm64/mediatek/mt2712-pinfunc.h (props changed) head/sys/gnu/dts/arm64/mediatek/mt6380.dtsi (props changed) head/sys/gnu/dts/arm64/mediatek/mt6755-evb.dts (props changed) head/sys/gnu/dts/arm64/mediatek/mt6755.dtsi (props changed) head/sys/gnu/dts/arm64/mediatek/mt6795-evb.dts (props changed) head/sys/gnu/dts/arm64/mediatek/mt6795.dtsi (props changed) head/sys/gnu/dts/arm64/mediatek/mt7622-bananapi-bpi-r64.dts (props changed) head/sys/gnu/dts/arm64/mediatek/mt7622-rfb1.dts (props changed) head/sys/gnu/dts/arm64/mediatek/mt8173-evb.dts (props changed) head/sys/gnu/dts/arm64/mediatek/mt8173-pinfunc.h (props changed) head/sys/gnu/dts/arm64/nvidia/tegra132-norrin.dts (props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-p2180.dtsi (props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-p2371-0000.dts (props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-p2530.dtsi (props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-p2571.dts (props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-p2595.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/apq8016-sbc-pmic-pins.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/apq8016-sbc-soc-pins.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/apq8016-sbc.dts (props changed) head/sys/gnu/dts/arm64/qcom/apq8096-db820c-pins.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/apq8096-db820c-pmic-pins.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/apq8096-db820c.dts (props changed) head/sys/gnu/dts/arm64/qcom/apq8096-db820c.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/ipq8074-hk01.dts (props changed) head/sys/gnu/dts/arm64/qcom/msm8916-mtp.dts (props changed) head/sys/gnu/dts/arm64/qcom/msm8916-mtp.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/msm8916-pins.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/msm8992-bullhead-rev-101.dts (props changed) head/sys/gnu/dts/arm64/qcom/msm8992-pins.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/msm8994-angler-rev-101.dts (props changed) head/sys/gnu/dts/arm64/qcom/msm8994-pins.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/msm8994-smd-rpm.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/msm8996-mtp.dts (props changed) head/sys/gnu/dts/arm64/qcom/msm8996-mtp.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/msm8998-mtp.dts (props changed) head/sys/gnu/dts/arm64/qcom/msm8998-pins.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/pm8004.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/pm8994.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/qcs404-evb-1000.dts (props changed) head/sys/gnu/dts/arm64/qcom/qcs404-evb-4000.dts (props changed) head/sys/gnu/dts/arm64/realtek/rtd1295-mele-v9.dts (props changed) head/sys/gnu/dts/arm64/realtek/rtd1295-probox2-ava.dts (props changed) head/sys/gnu/dts/arm64/realtek/rtd1295-zidoo-x9s.dts (props changed) head/sys/gnu/dts/arm64/realtek/rtd129x.dtsi (props changed) head/sys/gnu/dts/arm64/renesas/r8a7795-es1-h3ulcb-kf.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a7795-es1-h3ulcb.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a7795-es1-salvator-x.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a7795-es1.dtsi (props changed) head/sys/gnu/dts/arm64/renesas/r8a7795-h3ulcb-kf.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a7795-h3ulcb.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a7795-salvator-x.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a7795-salvator-xs.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a7796-m3ulcb-kf.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a7796-m3ulcb.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a7796-salvator-x.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a77965-m3nulcb-kf.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a77965-m3nulcb.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a77965-salvator-x.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a77965-salvator-xs.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a77970-eagle.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a77980-condor.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a77980-v3hsk.dts (props changed) head/sys/gnu/dts/arm64/renesas/salvator-x.dtsi (props changed) head/sys/gnu/dts/arm64/renesas/salvator-xs.dtsi (props changed) head/sys/gnu/dts/arm64/rockchip/px30-evb.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3328-evb.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3368-evb-act8846.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3368-lion-haikou.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-evb.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-ficus.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-firefly.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-gru-bob.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-gru-kevin.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet-inx.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet-kd.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-op1-opp.dtsi (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-opp.dtsi (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-puma-haikou.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-puma.dtsi (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-roc-pc.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-sapphire.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-sapphire.dtsi (props changed) head/sys/gnu/dts/arm64/socionext/uniphier-ld11-global.dts (props changed) head/sys/gnu/dts/arm64/socionext/uniphier-ld11-ref.dts (props changed) head/sys/gnu/dts/arm64/socionext/uniphier-ld20-ref.dts (props changed) head/sys/gnu/dts/arm64/socionext/uniphier-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm64/socionext/uniphier-ref-daughter.dtsi (props changed) head/sys/gnu/dts/arm64/socionext/uniphier-support-card.dtsi (props changed) head/sys/gnu/dts/arm64/sprd/sc9836-openphone.dts (props changed) head/sys/gnu/dts/arm64/sprd/sharkl64.dtsi (props changed) head/sys/gnu/dts/arm64/sprd/whale2.dtsi (props changed) head/sys/gnu/dts/arm64/synaptics/berlin4ct-dmp.dts (props changed) head/sys/gnu/dts/arm64/synaptics/berlin4ct-stb.dts (props changed) head/sys/gnu/dts/arm64/ti/k3-am65-wakeup.dtsi (props changed) head/sys/gnu/dts/arm64/ti/k3-am65.dtsi (props changed) head/sys/gnu/dts/arm64/xilinx/avnet-ultra96-rev1.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-clk.dtsi (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zc1232-revA.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zc1254-revA.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zc1275-revA.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm015-dc1.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm016-dc2.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm017-dc3.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm018-dc4.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm019-dc5.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu102-rev1.0.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu102-revA.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu102-revB.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu104-revA.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu106-revA.dts (props changed) head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu111-revA.dts (props changed) head/sys/gnu/dts/arm64/zte/zx296718-evb.dts (props changed) head/sys/gnu/dts/arm64/zte/zx296718-pcbox.dts (props changed) head/sys/gnu/dts/include/ (props changed) head/sys/gnu/dts/include/dt-bindings/arm/ux500_pm_domains.h (props changed) head/sys/gnu/dts/include/dt-bindings/bus/ti-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/actions,s700-cmu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/actions,s900-cmu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/alphascale,asm9260.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/am3.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/am4.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/aspeed-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/at91.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/axg-audio-clkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/axg-clkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/axis,artpec6-clkctrl.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/bcm-cygnus.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/bcm-ns2.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/bcm-nsp.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/bcm-sr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/bcm21664.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/bcm281xx.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/bcm2835-aux.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/bcm2835.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/berlin2.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/boston-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/cortina,gemini-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/dm814.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/dm816.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/dra7.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/efm32-cmu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos-audss-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos4.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos4415.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos5410.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos5420.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/exynos7-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/gxbb-clkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/hi3516cv300-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/hi3519-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/hi3620-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/hi3660-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/hi3670-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/hi6220-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/hip04-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/histb-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/hix5hd2-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx1-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx21-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx27-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx6qdl-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx6sll-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx6ul-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx7d-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx7ulp-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx8-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/jz4725b-cgu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/jz4740-cgu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/jz4770-cgu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/jz4780-cgu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/lpc18xx-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/lpc18xx-cgu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/lpc32xx-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/lsi,axm5516-clks.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa168.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa1928.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa910.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/maxim,max77620.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/maxim,max77686.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/maxim,max77802.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/maxim,max9485.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/microchip,pic32-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/mpc512x-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt2701-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt6797-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt7622-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt7629-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt8135-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/nuvoton,npcm7xx-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/omap4.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/omap5.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/oxsemi,ox810se.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/oxsemi,ox820.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/pistachio-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/px30-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/pxa-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,camcc-sdm845.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,dispcc-sdm845.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-apq8084.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq4019.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq806x.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq8074.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-mdm9615.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8660.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8916.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8960.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8974.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8994.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8996.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8998.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-qcs404.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sdm660.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sdm845.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gpucc-sdm845.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-ipq806x.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-mdm9615.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-msm8960.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,lpass-sdm845.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-apq8084.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8960.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8974.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8996.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,videocc-sdm845.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r7s72100-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r7s9210-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a73a4-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7740-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7743-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7744-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7745-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77470-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7779-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7790-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7790-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7791-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7791-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7792-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7792-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7793-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7793-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7794-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7794-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7795-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a7796-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77965-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77970-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77980-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77990-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77995-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/r9a06g032-sysctrl.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/renesas-cpg-mssr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3036-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3066a-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3128-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru-common.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3228-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3288-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3328-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3368-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3399-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rk3399-ddr.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rockchip,rk808.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/rv1108-cru.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/s3c2410.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/s3c2412.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/s3c2443.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/s5pv210-audss.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/s5pv210.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/samsung,s2mps11.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/samsung,s3c64xx-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sh73a0-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sprd,sc9860-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/ste-ab8500.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stih407-clks.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stih410-clks.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stih415-clks.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stih416-clks.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stih418-clks.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stm32fx-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stm32h7-clks.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/stratix10-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun4i-a10-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun4i-a10-pll2.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun50i-a64-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun50i-h6-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun50i-h6-r-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun5i-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun6i-a31-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun7i-a20-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun8i-a23-a33-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun8i-a83t-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun8i-de2.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun8i-h3-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun8i-r-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun8i-r40-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun8i-tcon-top.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun8i-v3s-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun9i-a80-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun9i-a80-de.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/sun9i-a80-usb.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/suniv-ccu-f1c100s.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra114-car.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra124-car-common.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra124-car.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra186-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra194-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra20-car.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra210-car.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/tegra30-car.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/vf610-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/xlnx,zynqmp-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/zx296702-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/zx296718-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/display/tda998x.h (props changed) head/sys/gnu/dts/include/dt-bindings/dma/at91.h (props changed) head/sys/gnu/dts/include/dt-bindings/dma/axi-dmac.h (props changed) head/sys/gnu/dts/include/dt-bindings/dma/dw-dmac.h (props changed) head/sys/gnu/dts/include/dt-bindings/dma/jz4780-dma.h (props changed) head/sys/gnu/dts/include/dt-bindings/dma/nbpfaxi.h (props changed) head/sys/gnu/dts/include/dt-bindings/dma/sun4i-a10.h (props changed) head/sys/gnu/dts/include/dt-bindings/firmware/imx/rsrc.h (props changed) head/sys/gnu/dts/include/dt-bindings/gce/mt8173-gce.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/aspeed-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/meson-axg-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/meson-g12a-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/meson-gxbb-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/meson-gxl-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/meson8-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/meson8b-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/tegra-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/tegra186-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/tegra194-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/gpio/uniphier-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/i2c/i2c.h (props changed) head/sys/gnu/dts/include/dt-bindings/iio/adc/at91-sama5d2_adc.h (props changed) head/sys/gnu/dts/include/dt-bindings/iio/adc/fsl-imx25-gcq.h (props changed) head/sys/gnu/dts/include/dt-bindings/iio/adi,ad5592r.h (props changed) head/sys/gnu/dts/include/dt-bindings/iio/qcom,spmi-vadc.h (props changed) head/sys/gnu/dts/include/dt-bindings/input/gpio-keys.h (props changed) head/sys/gnu/dts/include/dt-bindings/input/input.h (props changed) head/sys/gnu/dts/include/dt-bindings/input/ti-drv260x.h (props changed) head/sys/gnu/dts/include/dt-bindings/interconnect/qcom,sdm845.h (props changed) head/sys/gnu/dts/include/dt-bindings/interrupt-controller/arm-gic.h (props changed) head/sys/gnu/dts/include/dt-bindings/interrupt-controller/irq-st.h (props changed) head/sys/gnu/dts/include/dt-bindings/interrupt-controller/irq.h (props changed) head/sys/gnu/dts/include/dt-bindings/interrupt-controller/mips-gic.h (props changed) head/sys/gnu/dts/include/dt-bindings/interrupt-controller/mvebu-icu.h (props changed) head/sys/gnu/dts/include/dt-bindings/leds/common.h (props changed) head/sys/gnu/dts/include/dt-bindings/leds/leds-netxbig.h (props changed) head/sys/gnu/dts/include/dt-bindings/leds/leds-ns2.h (props changed) head/sys/gnu/dts/include/dt-bindings/leds/leds-pca9532.h (props changed) head/sys/gnu/dts/include/dt-bindings/leds/leds-pca955x.h (props changed) head/sys/gnu/dts/include/dt-bindings/mailbox/tegra186-hsp.h (props changed) head/sys/gnu/dts/include/dt-bindings/media/c8sectpfe.h (props changed) head/sys/gnu/dts/include/dt-bindings/media/omap3-isp.h (props changed) head/sys/gnu/dts/include/dt-bindings/media/tda1997x.h (props changed) head/sys/gnu/dts/include/dt-bindings/media/tvp5150.h (props changed) head/sys/gnu/dts/include/dt-bindings/media/xilinx-vip.h (props changed) head/sys/gnu/dts/include/dt-bindings/memory/mt2701-larb-port.h (props changed) head/sys/gnu/dts/include/dt-bindings/memory/mt2712-larb-port.h (props changed) head/sys/gnu/dts/include/dt-bindings/memory/mt8173-larb-port.h (props changed) head/sys/gnu/dts/include/dt-bindings/memory/tegra114-mc.h (props changed) head/sys/gnu/dts/include/dt-bindings/memory/tegra124-mc.h (props changed) head/sys/gnu/dts/include/dt-bindings/memory/tegra186-mc.h (props changed) head/sys/gnu/dts/include/dt-bindings/memory/tegra20-mc.h (props changed) head/sys/gnu/dts/include/dt-bindings/memory/tegra210-mc.h (props changed) head/sys/gnu/dts/include/dt-bindings/memory/tegra30-mc.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/arizona.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/as3722.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/at91-usart.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/atmel-flexcom.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/dbx500-prcmu.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/max77620.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/palmas.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/qcom-rpm.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/st-lpc.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/stm32f4-rcc.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/stm32f7-rcc.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/stm32h7-rcc.h (props changed) head/sys/gnu/dts/include/dt-bindings/mips/lantiq_rcu_gphy.h (props changed) head/sys/gnu/dts/include/dt-bindings/mux/mux.h (props changed) head/sys/gnu/dts/include/dt-bindings/net/microchip-lan78xx.h (props changed) head/sys/gnu/dts/include/dt-bindings/net/mscc-phy-vsc8531.h (props changed) head/sys/gnu/dts/include/dt-bindings/net/rfkill-regulator.h (props changed) head/sys/gnu/dts/include/dt-bindings/net/ti-dp83867.h (props changed) head/sys/gnu/dts/include/dt-bindings/phy/phy-ocelot-serdes.h (props changed) head/sys/gnu/dts/include/dt-bindings/phy/phy-pistachio-usb.h (props changed) head/sys/gnu/dts/include/dt-bindings/phy/phy-qcom-qusb2.h (props changed) head/sys/gnu/dts/include/dt-bindings/phy/phy.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/am33xx.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/am43xx.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/bcm2835.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/brcm,pinctrl-stingray.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/dm814x.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/dra.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/hisi.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/k3.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/keystone.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/mt6397-pinfunc.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/mt65xx.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/mt6797-pinfunc.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/mt7623-pinfunc.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/nomadik.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/omap.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/pads-imx8qm.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/pads-imx8qxp.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra-io-pad.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-gpio.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-mpp.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/r7s72100-pinctrl.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/r7s9210-pinctrl.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/rockchip.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/rzn1-pinctrl.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/samsung.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/stm32-pinfunc.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/stm32f429-pinfunc.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/stm32f746-pinfunc.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/stm32h7-pinfunc.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/sun4i-a10.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/imx7-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/imx8mq-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/mt2701-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/mt2712-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/mt6797-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/mt7622-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/mt7623a-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/owl-s500-powergate.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/owl-s700-powergate.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/owl-s900-powergate.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/px30-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a7743-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a7744-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a7745-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77470-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a774a1-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a774c0-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a7779-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a7790-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a7791-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a7792-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a7793-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a7794-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a7795-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a7796-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77965-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77970-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77980-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77990-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77995-sysc.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/raspberrypi-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3036-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3066-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3128-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3188-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3228-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3288-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3328-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3366-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3368-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/rk3399-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/tegra186-powergate.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/tegra194-powergate.h (props changed) head/sys/gnu/dts/include/dt-bindings/pwm/pwm.h (props changed) head/sys/gnu/dts/include/dt-bindings/regulator/active-semi,8945a-regulator.h (props changed) head/sys/gnu/dts/include/dt-bindings/regulator/maxim,max77802.h (props changed) head/sys/gnu/dts/include/dt-bindings/regulator/qcom,rpmh-regulator.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/actions,s700-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/actions,s900-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr-a10.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr-a10sr.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr-s10.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-axg-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-gxbb-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson8b-clkc-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson8b-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/axg-aoclkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/cortina,gemini-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/gxbb-aoclkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/hisi,hi6220-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/imx7-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/mt2701-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/mt7622-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/mt8135-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/mt8173-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/oxsemi,ox810se.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/oxsemi,ox820.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/pistachio-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-apq8084.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-ipq806x.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-mdm9615.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8660.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8916.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8960.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8974.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-apq8084.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-msm8960.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-msm8974.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,sdm845-aoss.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/qcom,sdm845-pdc.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/snps,hsdk-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/stih407-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/stih415-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/stih416-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/stm32mp1-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun4i-a10-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun50i-a64-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun50i-h6-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun50i-h6-r-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun5i-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun6i-a31-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun8i-a23-a33-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun8i-a83t-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun8i-de2.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun8i-h3-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun8i-r-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun8i-r40-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun8i-v3s-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun9i-a80-ccu.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun9i-a80-de.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/sun9i-a80-usb.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/suniv-ccu-f1c100s.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/tegra124-car.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/tegra186-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/tegra194-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/tegra210-car.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/ti-syscon.h (props changed) head/sys/gnu/dts/include/dt-bindings/soc/qcom,apr.h (props changed) head/sys/gnu/dts/include/dt-bindings/soc/qcom,gsbi.h (props changed) head/sys/gnu/dts/include/dt-bindings/soc/qcom,rpmh-rsc.h (props changed) head/sys/gnu/dts/include/dt-bindings/soc/rockchip,boot-mode.h (props changed) head/sys/gnu/dts/include/dt-bindings/soc/zte,pm_domains.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/apq8016-lpass.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/audio-jack-events.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/cs35l32.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/cs42l42.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/fsl-imx-audmux.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/qcom,q6afe.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/qcom,q6asm.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/rt5640.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/rt5651.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/samsung-i2s.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/tas2552.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/tlv320aic31xx-micbias.h (props changed) head/sys/gnu/dts/include/dt-bindings/spmi/spmi.h (props changed) head/sys/gnu/dts/include/dt-bindings/thermal/lm90.h (props changed) head/sys/gnu/dts/include/dt-bindings/thermal/tegra124-soctherm.h (props changed) head/sys/gnu/dts/include/dt-bindings/thermal/tegra186-bpmp-thermal.h (props changed) head/sys/gnu/dts/include/dt-bindings/thermal/tegra194-bpmp-thermal.h (props changed) head/sys/gnu/dts/include/dt-bindings/thermal/thermal.h (props changed) head/sys/gnu/dts/include/dt-bindings/thermal/thermal_exynos.h (props changed) head/sys/gnu/dts/include/dt-bindings/usb/pd.h (props changed) head/sys/gnu/dts/mips/3G-6200N.dts (props changed) head/sys/gnu/dts/mips/3G-6200NL.dts (props changed) head/sys/gnu/dts/mips/3G150B.dts (props changed) head/sys/gnu/dts/mips/3G300M.dts (props changed) head/sys/gnu/dts/mips/A5-V11.dts (props changed) head/sys/gnu/dts/mips/AI-BR100.dts (props changed) head/sys/gnu/dts/mips/AIR3GII.dts (props changed) head/sys/gnu/dts/mips/ALL0239-3G.dts (props changed) head/sys/gnu/dts/mips/ALL0256N-4M.dts (props changed) head/sys/gnu/dts/mips/ALL0256N-8M.dts (props changed) head/sys/gnu/dts/mips/ALL5002.dts (props changed) head/sys/gnu/dts/mips/ALL5003.dts (props changed) head/sys/gnu/dts/mips/AR670W.dts (props changed) head/sys/gnu/dts/mips/AR725W.dts (props changed) head/sys/gnu/dts/mips/ASL26555-16M.dts (props changed) head/sys/gnu/dts/mips/ASL26555-8M.dts (props changed) head/sys/gnu/dts/mips/ATP-52B.dts (props changed) head/sys/gnu/dts/mips/AWAPN2403.dts (props changed) head/sys/gnu/dts/mips/AWM002-4M.dtsi (props changed) head/sys/gnu/dts/mips/AWM002-8M.dtsi (props changed) head/sys/gnu/dts/mips/AWM002-EVB-4M.dts (props changed) head/sys/gnu/dts/mips/AWM002-EVB-8M.dts (props changed) head/sys/gnu/dts/mips/AWM002.dtsi (props changed) head/sys/gnu/dts/mips/AWM003-EVB.dts (props changed) head/sys/gnu/dts/mips/ArcherC20i.dts (props changed) head/sys/gnu/dts/mips/BC2.dts (props changed) head/sys/gnu/dts/mips/BR-6425.dts (props changed) head/sys/gnu/dts/mips/BR-6475ND.dts (props changed) head/sys/gnu/dts/mips/BROADWAY.dts (props changed) head/sys/gnu/dts/mips/CARAMBOLA.dts (props changed) head/sys/gnu/dts/mips/CF-WR800N.dts (props changed) head/sys/gnu/dts/mips/CS-QR10.dts (props changed) head/sys/gnu/dts/mips/CY-SWR1100.dts (props changed) head/sys/gnu/dts/mips/D105.dts (props changed) head/sys/gnu/dts/mips/DAP-1350.dts (props changed) head/sys/gnu/dts/mips/DB-WRT01.dts (props changed) head/sys/gnu/dts/mips/DCS-930.dts (props changed) head/sys/gnu/dts/mips/DCS-930L-B1.dts (props changed) head/sys/gnu/dts/mips/DIR-300-B1.dts (props changed) head/sys/gnu/dts/mips/DIR-300-B7.dts (props changed) head/sys/gnu/dts/mips/DIR-320-B1.dts (props changed) head/sys/gnu/dts/mips/DIR-600-B1.dts (props changed) head/sys/gnu/dts/mips/DIR-600-B2.dts (props changed) head/sys/gnu/dts/mips/DIR-610-A1.dts (props changed) head/sys/gnu/dts/mips/DIR-615-D.dts (props changed) head/sys/gnu/dts/mips/DIR-615-H1.dts (props changed) head/sys/gnu/dts/mips/DIR-620-A1.dts (props changed) head/sys/gnu/dts/mips/DIR-620-D1.dts (props changed) head/sys/gnu/dts/mips/DIR-645.dts (props changed) head/sys/gnu/dts/mips/DIR-810L.dts (props changed) head/sys/gnu/dts/mips/DIR-860L-B1.dts (props changed) head/sys/gnu/dts/mips/E1700.dts (props changed) head/sys/gnu/dts/mips/ESR-9753.dts (props changed) head/sys/gnu/dts/mips/EX2700.dts (props changed) head/sys/gnu/dts/mips/F5D8235_V1.dts (props changed) head/sys/gnu/dts/mips/F5D8235_V2.dts (props changed) head/sys/gnu/dts/mips/F7C027.dts (props changed) head/sys/gnu/dts/mips/FIREWRT.dts (props changed) head/sys/gnu/dts/mips/FONERA20N.dts (props changed) head/sys/gnu/dts/mips/FREESTATION5.dts (props changed) head/sys/gnu/dts/mips/GL-MT300A.dts (props changed) head/sys/gnu/dts/mips/GL-MT300N.dts (props changed) head/sys/gnu/dts/mips/GL-MT750.dts (props changed) head/sys/gnu/dts/mips/HC5661.dts (props changed) head/sys/gnu/dts/mips/HC5761.dts (props changed) head/sys/gnu/dts/mips/HC5861.dts (props changed) head/sys/gnu/dts/mips/HC5XXX.dtsi (props changed) head/sys/gnu/dts/mips/HG255D.dts (props changed) head/sys/gnu/dts/mips/HLKRM04.dts (props changed) head/sys/gnu/dts/mips/HPM.dts (props changed) head/sys/gnu/dts/mips/HT-TM02.dts (props changed) head/sys/gnu/dts/mips/HW550-3G.dts (props changed) head/sys/gnu/dts/mips/IP2202.dts (props changed) head/sys/gnu/dts/mips/JHR-N805R.dts (props changed) head/sys/gnu/dts/mips/JHR-N825R.dts (props changed) head/sys/gnu/dts/mips/JHR-N926R.dts (props changed) head/sys/gnu/dts/mips/LINKIT7688.dts (props changed) head/sys/gnu/dts/mips/M2M.dts (props changed) head/sys/gnu/dts/mips/M3.dts (props changed) head/sys/gnu/dts/mips/M4-4M.dts (props changed) head/sys/gnu/dts/mips/M4-8M.dts (props changed) head/sys/gnu/dts/mips/MINIEMBPLUG.dts (props changed) head/sys/gnu/dts/mips/MINIEMBWIFI.dts (props changed) head/sys/gnu/dts/mips/MIWIFI-MINI.dts (props changed) head/sys/gnu/dts/mips/MIWIFI-NANO.dts (props changed) head/sys/gnu/dts/mips/MLW221.dts (props changed) head/sys/gnu/dts/mips/MLWG2.dts (props changed) head/sys/gnu/dts/mips/MOFI3500-3GN.dts (props changed) head/sys/gnu/dts/mips/MPRA1.dts (props changed) head/sys/gnu/dts/mips/MPRA2.dts (props changed) head/sys/gnu/dts/mips/MR-102N.dts (props changed) head/sys/gnu/dts/mips/MT7620a.dts (props changed) head/sys/gnu/dts/mips/MT7620a_MT7530.dts (props changed) head/sys/gnu/dts/mips/MT7620a_MT7610e.dts (props changed) head/sys/gnu/dts/mips/MT7620a_V22SG.dts (props changed) head/sys/gnu/dts/mips/MT7621.dts (props changed) head/sys/gnu/dts/mips/MT7628.dts (props changed) head/sys/gnu/dts/mips/MZK-750DHP.dts (props changed) head/sys/gnu/dts/mips/MZK-DP150N.dts (props changed) head/sys/gnu/dts/mips/MZK-EX300NP.dts (props changed) head/sys/gnu/dts/mips/MZK-EX750NP.dts (props changed) head/sys/gnu/dts/mips/MZK-W04N-XX.dts (props changed) head/sys/gnu/dts/mips/MZK-W300NH2.dts (props changed) head/sys/gnu/dts/mips/MZK-WDPR.dts (props changed) head/sys/gnu/dts/mips/MicroWRT.dts (props changed) head/sys/gnu/dts/mips/NA930.dts (props changed) head/sys/gnu/dts/mips/NBG-419N.dts (props changed) head/sys/gnu/dts/mips/NCS601W.dts (props changed) head/sys/gnu/dts/mips/NW718.dts (props changed) head/sys/gnu/dts/mips/OY-0001.dts (props changed) head/sys/gnu/dts/mips/PBR-M1.dts (props changed) head/sys/gnu/dts/mips/PSG1208.dts (props changed) head/sys/gnu/dts/mips/PSR-680W.dts (props changed) head/sys/gnu/dts/mips/PWH2004.dts (props changed) head/sys/gnu/dts/mips/PX-4885-4M.dts (props changed) head/sys/gnu/dts/mips/PX-4885-8M.dts (props changed) head/sys/gnu/dts/mips/PX-4885.dtsi (props changed) head/sys/gnu/dts/mips/RE6500.dts (props changed) head/sys/gnu/dts/mips/RP-N53.dts (props changed) head/sys/gnu/dts/mips/RT-G32-B1.dts (props changed) head/sys/gnu/dts/mips/RT-N10-PLUS.dts (props changed) head/sys/gnu/dts/mips/RT-N13U.dts (props changed) head/sys/gnu/dts/mips/RT-N14U.dts (props changed) head/sys/gnu/dts/mips/RT-N15.dts (props changed) head/sys/gnu/dts/mips/RT-N56U.dts (props changed) head/sys/gnu/dts/mips/RT5350F-OLINUXINO-EVB.dts (props changed) head/sys/gnu/dts/mips/RT5350F-OLINUXINO.dts (props changed) head/sys/gnu/dts/mips/RUT5XX.dts (props changed) head/sys/gnu/dts/mips/SAP-G3200U3.dts (props changed) head/sys/gnu/dts/mips/SK-WB8.dts (props changed) head/sys/gnu/dts/mips/SL-R7205.dts (props changed) head/sys/gnu/dts/mips/TEW-691GR.dts (props changed) head/sys/gnu/dts/mips/TEW-692GR.dts (props changed) head/sys/gnu/dts/mips/TINY-AC.dts (props changed) head/sys/gnu/dts/mips/UBNT-ERX.dts (props changed) head/sys/gnu/dts/mips/UR-326N4G.dts (props changed) head/sys/gnu/dts/mips/UR-336UN.dts (props changed) head/sys/gnu/dts/mips/V11STFE.dts (props changed) head/sys/gnu/dts/mips/V22RW-2X2.dts (props changed) head/sys/gnu/dts/mips/VOCORE-16M.dts (props changed) head/sys/gnu/dts/mips/VOCORE-8M.dts (props changed) head/sys/gnu/dts/mips/VOCORE.dtsi (props changed) head/sys/gnu/dts/mips/W150M.dts (props changed) head/sys/gnu/dts/mips/W306R_V20.dts (props changed) head/sys/gnu/dts/mips/W502U.dts (props changed) head/sys/gnu/dts/mips/WCR150GN.dts (props changed) head/sys/gnu/dts/mips/WF-2881.dts (props changed) head/sys/gnu/dts/mips/WHR-1166D.dts (props changed) head/sys/gnu/dts/mips/WHR-300HP2.dts (props changed) head/sys/gnu/dts/mips/WHR-600D.dts (props changed) head/sys/gnu/dts/mips/WHR-G300N.dts (props changed) head/sys/gnu/dts/mips/WITI.dts (props changed) head/sys/gnu/dts/mips/WIZARD8800.dts (props changed) head/sys/gnu/dts/mips/WIZFI630A.dts (props changed) head/sys/gnu/dts/mips/WL-330N.dts (props changed) head/sys/gnu/dts/mips/WL-330N3G.dts (props changed) head/sys/gnu/dts/mips/WL-341V3.dts (props changed) head/sys/gnu/dts/mips/WL-351.dts (props changed) head/sys/gnu/dts/mips/WLI-TX4-AG300N.dts (props changed) head/sys/gnu/dts/mips/WMR-300.dts (props changed) head/sys/gnu/dts/mips/WNCE2001.dts (props changed) head/sys/gnu/dts/mips/WNDR3700V5.dts (props changed) head/sys/gnu/dts/mips/WR512-3GN-4M.dts (props changed) head/sys/gnu/dts/mips/WR512-3GN-8M.dts (props changed) head/sys/gnu/dts/mips/WR6202.dts (props changed) head/sys/gnu/dts/mips/WRH-300CR.dts (props changed) head/sys/gnu/dts/mips/WRTNODE.dts (props changed) head/sys/gnu/dts/mips/WRTNODE2.dtsi (props changed) head/sys/gnu/dts/mips/WRTNODE2P.dts (props changed) head/sys/gnu/dts/mips/WRTNODE2R.dts (props changed) head/sys/gnu/dts/mips/WSR-1166.dts (props changed) head/sys/gnu/dts/mips/WSR-600.dts (props changed) head/sys/gnu/dts/mips/WT1520-4M.dts (props changed) head/sys/gnu/dts/mips/WT1520-8M.dts (props changed) head/sys/gnu/dts/mips/WT1520.dtsi (props changed) head/sys/gnu/dts/mips/WT3020-4M.dts (props changed) head/sys/gnu/dts/mips/WT3020-8M.dts (props changed) head/sys/gnu/dts/mips/WZR-AGL300NH.dts (props changed) head/sys/gnu/dts/mips/X5.dts (props changed) head/sys/gnu/dts/mips/X8.dts (props changed) head/sys/gnu/dts/mips/XDXRN502J.dts (props changed) head/sys/gnu/dts/mips/Y1.dts (props changed) head/sys/gnu/dts/mips/Y1.dtsi (props changed) head/sys/gnu/dts/mips/Y1S.dts (props changed) head/sys/gnu/dts/mips/YOUKU-YK1.dts (props changed) head/sys/gnu/dts/mips/ZBT-WA05.dts (props changed) head/sys/gnu/dts/mips/ZBT-WE826.dts (props changed) head/sys/gnu/dts/mips/ZBT-WG2626.dts (props changed) head/sys/gnu/dts/mips/ZBT-WG3526.dts (props changed) head/sys/gnu/dts/mips/ZBT-WR8305RT.dts (props changed) head/sys/gnu/dts/mips/ZTE-Q7.dts (props changed) head/sys/gnu/dts/mips/ingenic/canna.dts (props changed) head/sys/gnu/dts/mips/ingenic/ci20.dts (props changed) head/sys/gnu/dts/mips/ingenic/jz4780.dtsi (props changed) head/sys/gnu/dts/mips/ingenic/x1000.dtsi (props changed) head/sys/gnu/dts/mips/mt7620a.dtsi (props changed) head/sys/gnu/dts/mips/mt7620n.dtsi (props changed) head/sys/gnu/dts/mips/mt7621.dtsi (props changed) head/sys/gnu/dts/mips/mt7628an.dtsi (props changed) head/sys/gnu/dts/mips/rt2880.dtsi (props changed) head/sys/gnu/dts/mips/rt3050.dtsi (props changed) head/sys/gnu/dts/mips/rt3352.dtsi (props changed) head/sys/gnu/dts/mips/rt3883.dtsi (props changed) head/sys/gnu/dts/mips/rt5350.dtsi (props changed) Modified: head/sys/gnu/dts/arm/alphascale-asm9260.dtsi ============================================================================== --- head/sys/gnu/dts/arm/alphascale-asm9260.dtsi Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/alphascale-asm9260.dtsi Wed May 8 19:27:30 2019 (r347366) @@ -4,10 +4,11 @@ * Licensed under the X11 license or the GPL v2 (or later) */ -#include "skeleton.dtsi" #include / { + #address-cells = <1>; + #size-cells = <1>; interrupt-parent = <&icoll>; memory { Modified: head/sys/gnu/dts/arm/alpine.dtsi ============================================================================== --- head/sys/gnu/dts/arm/alpine.dtsi Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/alpine.dtsi Wed May 8 19:27:30 2019 (r347366) @@ -25,11 +25,17 @@ */ #include -#include "skeleton64.dtsi" / { + #address-cells = <2>; + #size-cells = <2>; /* SOC compatibility */ compatible = "al,alpine"; + + memory { + device_type = "memory"; + reg = <0 0 0 0>; + }; /* CPU Configuration */ cpus { Modified: head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts Wed May 8 19:27:30 2019 (r347366) @@ -72,7 +72,3 @@ dual_emac_res_vlan = <2>; phy-handle = <&phy1>; }; - -&phy_sel { - rmii-clock-ext = <1>; -}; Modified: head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Wed May 8 19:27:30 2019 (r347366) @@ -114,7 +114,3 @@ dual_emac_res_vlan = <2>; phy-handle = <&phy1>; }; - -&phy_sel { - rmii-clock-ext = <1>; -}; Modified: head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Wed May 8 19:27:30 2019 (r347366) @@ -133,10 +133,6 @@ phy-handle = <&phy1>; }; -&phy_sel { - rmii-clock-ext = <1>; -}; - &dcan1 { pinctrl-names = "default"; pinctrl-0 = <&dcan1_pins>; Modified: head/sys/gnu/dts/arm/am335x-chiliboard.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-chiliboard.dts Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-chiliboard.dts Wed May 8 19:27:30 2019 (r347366) @@ -14,6 +14,10 @@ compatible = "grinn,am335x-chiliboard", "grinn,am335x-chilisom", "ti,am33xx"; + chosen { + stdout-path = &uart0; + }; + leds { compatible = "gpio-leds"; pinctrl-names = "default"; @@ -149,10 +153,6 @@ &cpsw_emac0 { phy-handle = <ðphy0>; phy-mode = "rmii"; -}; - -&phy_sel { - rmii-clock-ext; }; /* USB */ Modified: head/sys/gnu/dts/arm/am335x-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-evm.dts Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-evm.dts Wed May 8 19:27:30 2019 (r347366) @@ -57,6 +57,24 @@ enable-active-high; }; + /* TPS79501 */ + v1_8d_reg: fixedregulator-v1_8d { + compatible = "regulator-fixed"; + regulator-name = "v1_8d"; + vin-supply = <&vbat>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + /* TPS79501 */ + v3_3d_reg: fixedregulator-v3_3d { + compatible = "regulator-fixed"; + regulator-name = "v3_3d"; + vin-supply = <&vbat>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + matrix_keypad: matrix_keypad0 { compatible = "gpio-matrix-keypad"; debounce-delay-ms = <5>; @@ -499,10 +517,10 @@ status = "okay"; /* Regulators */ - AVDD-supply = <&vaux2_reg>; - IOVDD-supply = <&vaux2_reg>; - DRVDD-supply = <&vaux2_reg>; - DVDD-supply = <&vbat>; + AVDD-supply = <&v3_3d_reg>; + IOVDD-supply = <&v3_3d_reg>; + DRVDD-supply = <&v3_3d_reg>; + DVDD-supply = <&v1_8d_reg>; }; }; Modified: head/sys/gnu/dts/arm/am335x-evmsk.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-evmsk.dts Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-evmsk.dts Wed May 8 19:27:30 2019 (r347366) @@ -73,6 +73,24 @@ enable-active-high; }; + /* TPS79518 */ + v1_8d_reg: fixedregulator-v1_8d { + compatible = "regulator-fixed"; + regulator-name = "v1_8d"; + vin-supply = <&vbat>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + /* TPS78633 */ + v3_3d_reg: fixedregulator-v3_3d { + compatible = "regulator-fixed"; + regulator-name = "v3_3d"; + vin-supply = <&vbat>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + leds { pinctrl-names = "default"; pinctrl-0 = <&user_leds_s0>; @@ -501,10 +519,10 @@ status = "okay"; /* Regulators */ - AVDD-supply = <&vaux2_reg>; - IOVDD-supply = <&vaux2_reg>; - DRVDD-supply = <&vaux2_reg>; - DVDD-supply = <&vbat>; + AVDD-supply = <&v3_3d_reg>; + IOVDD-supply = <&v3_3d_reg>; + DRVDD-supply = <&v3_3d_reg>; + DVDD-supply = <&v1_8d_reg>; }; }; Copied: head/sys/gnu/dts/arm/am335x-guardian.dts (from r347363, vendor/device-tree/dist/src/arm/am335x-guardian.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am335x-guardian.dts Wed May 8 19:27:30 2019 (r347366, copy of r347363, vendor/device-tree/dist/src/arm/am335x-guardian.dts) @@ -0,0 +1,511 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2018 Robert Bosch Power Tools GmbH + */ +/dts-v1/; + +#include "am33xx.dtsi" +#include +#include + +/ { + model = "Bosch AM335x Guardian"; + compatible = "bosch,am335x-guardian", "ti,am33xx"; + + chosen { + stdout-path = &uart0; + tick-timer = &timer2; + }; + + cpus { + cpu@0 { + cpu0-supply = <&dcdc2_reg>; + }; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x10000000>; /* 256 MB */ + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&gpio_keys_pins>; + + button21 { + label = "guardian-power-button"; + linux,code = ; + gpios = <&gpio2 21 0>; + wakeup-source; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&leds_pins>; + + led1 { + label = "green:heartbeat"; + gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + + led2 { + label = "green:mmc0"; + gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc0"; + default-state = "off"; + }; + }; + + panel { + compatible = "ti,tilcdc,panel"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&lcd_pins_default &lcd_disen_pins>; + pinctrl-1 = <&lcd_pins_sleep>; + + display-timings { + 320x240 { + hactive = <320>; + vactive = <240>; + hback-porch = <68>; + hfront-porch = <20>; + hsync-len = <1>; + vback-porch = <18>; + vfront-porch = <4>; + vsync-len = <1>; + clock-frequency = <9000000>; + hsync-active = <0>; + vsync-active = <0>; + }; + }; + panel-info { + ac-bias = <255>; + ac-bias-intrpt = <0>; + dma-burst-sz = <16>; + bpp = <24>; + bus-width = <16>; + fdd = <0x80>; + sync-edge = <0>; + sync-ctrl = <1>; + raster-order = <0>; + fifo-th = <0>; + }; + + }; + + pwm7: dmtimer-pwm { + compatible = "ti,omap-dmtimer-pwm"; + ti,timers = <&timer7>; + pinctrl-names = "default"; + pinctrl-0 = <&dmtimer7_pins>; + }; + + vmmcsd_fixed: regulator-3v3 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; +}; + +&cppi41dma { + status = "okay"; +}; + +&elm { + status = "okay"; +}; + +&gpmc { + pinctrl-names = "default"; + pinctrl-0 = <&nandflash_pins>; + ranges = <0 0 0x08000000 0x1000000>; /* CS0: 16MB for NAND */ + status = "okay"; + + nand@0,0 { + compatible = "ti,omap2-nand"; + reg = <0 0 4>; /* CS0, offset 0, IO size 4 */ + interrupt-parent = <&gpmc>; + interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */ + <1 IRQ_TYPE_NONE>; /* termcount */ + rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */ + ti,nand-ecc-opt = "bch16"; + ti,elm-id = <&elm>; + nand-bus-width = <8>; + gpmc,device-width = <1>; + gpmc,sync-clk-ps = <0>; + gpmc,cs-on-ns = <0>; + gpmc,cs-rd-off-ns = <44>; + gpmc,cs-wr-off-ns = <44>; + gpmc,adv-on-ns = <6>; + gpmc,adv-rd-off-ns = <34>; + gpmc,adv-wr-off-ns = <44>; + gpmc,we-on-ns = <0>; + gpmc,we-off-ns = <40>; + gpmc,oe-on-ns = <0>; + gpmc,oe-off-ns = <54>; + gpmc,access-ns = <64>; + gpmc,rd-cycle-ns = <82>; + gpmc,wr-cycle-ns = <82>; + gpmc,bus-turnaround-ns = <0>; + gpmc,cycle2cycle-delay-ns = <0>; + gpmc,clk-activation-ns = <0>; + gpmc,wr-access-ns = <40>; + gpmc,wr-data-mux-bus-ns = <0>; + + /* + * MTD partition table + * + * All SPL-* partitions are sized to minimal length which can + * be independently programmable. For NAND flash this is equal + * to size of erase-block. + */ + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SPL"; + reg = <0x0 0x40000>; + }; + + partition@1 { + label = "SPL.backup1"; + reg = <0x40000 0x40000>; + }; + + partition@2 { + label = "SPL.backup2"; + reg = <0x80000 0x40000>; + }; + + partition@3 { + label = "SPL.backup3"; + reg = <0xc0000 0x40000>; + }; + + partition@4 { + label = "u-boot"; + reg = <0x100000 0x100000>; + }; + + partition@5 { + label = "u-boot.backup1"; + reg = <0x200000 0x100000>; + }; + + partition@6 { + label = "u-boot-env"; + reg = <0x300000 0x40000>; + }; + + partition@7 { + label = "u-boot-env.backup1"; + reg = <0x340000 0x40000>; + }; + + partition@8 { + label = "UBI"; + reg = <0x380000 0x1fc80000>; + }; + }; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + clock-frequency = <400000>; + status = "okay"; + + tps: tps@24 { + reg = <0x24>; + }; +}; + +&lcdc { + blue-and-red-wiring = "crossed"; + status = "okay"; +}; + +&mmc1 { + bus-width = <0x4>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; + vmmc-supply = <&vmmcsd_fixed>; + status = "okay"; +}; + +&rtc { + clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; + clock-names = "ext-clk", "int-clk"; + system-power-controller; +}; + +&spi0 { + ti,pindir-d0-out-d1-in; + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins>; + status = "okay"; +}; + +#include "tps65217.dtsi" + +&tps { + ti,pmic-shutdown-controller; + interrupt-parent = <&intc>; + interrupts = <7>; /* NMI */ + + backlight { + isel = <1>; /* 1 - ISET1, 2 ISET2 */ + fdim = <100>; /* TPS65217_BL_FDIM_100HZ */ + default-brightness = <100>; + }; + + regulators { + dcdc1_reg: regulator@0 { + regulator-name = "vdds_dpr"; + regulator-always-on; + }; + + dcdc2_reg: regulator@1 { + regulator-name = "vdd_mpu"; + regulator-min-microvolt = <925000>; + regulator-max-microvolt = <1351500>; + regulator-boot-on; + regulator-always-on; + }; + + dcdc3_reg: regulator@2 { + regulator-name = "vdd_core"; + regulator-min-microvolt = <925000>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; + }; + + ldo1_reg: regulator@3 { + regulator-name = "vio,vrtc,vdds"; + regulator-always-on; + }; + + ldo2_reg: regulator@4 { + regulator-name = "vdd_3v3aux"; + regulator-always-on; + }; + + ldo3_reg: regulator@5 { + regulator-name = "vdd_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + ldo4_reg: regulator@6 { + regulator-name = "vdd_3v3a"; + regulator-always-on; + }; + }; +}; + +&tscadc { + status = "okay"; + + adc { + ti,adc-channels = <0 1 2 3 4 5 6>; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&usb { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb0 { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb1 { + dr_mode = "host"; + status = "okay"; +}; + +&usb1_phy { + status = "okay"; +}; + +&am33xx_pinmux { + pinctrl-names = "default"; + pinctrl-0 = <&clkout2_pin &gpio_pins>; + + clkout2_pin: pinmux_clkout2_pin { + pinctrl-single,pins = < + AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) + >; + }; + + dmtimer7_pins: pinmux_dmtimer7_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x968, PIN_OUTPUT | MUX_MODE5) + >; + }; + + gpio_keys_pins: pinmux_gpio_keys_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x940, PIN_INPUT | MUX_MODE7) + >; + }; + + gpio_pins: pinmux_gpio_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x928, PIN_OUTPUT | MUX_MODE7) + AM33XX_IOPAD(0x990, PIN_OUTPUT | MUX_MODE7) + >; + }; + + i2c0_pins: pinmux_i2c0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) + >; + }; + + lcd_disen_pins: pinmux_lcd_disen_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x9a4, PIN_OUTPUT_PULLUP | SLEWCTRL_SLOW | MUX_MODE7) + >; + }; + + lcd_pins_default: pinmux_lcd_pins_default { + pinctrl-single,pins = < + AM33XX_IOPAD(0x820, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x824, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x828, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x82c, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x830, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x834, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x838, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x83c, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x8a0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8a4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8a8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8ac, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8b0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8b4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8b8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8bc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8c0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8c4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8c8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8cc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8d0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8d4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8d8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8dc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8e0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8e4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8e8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8ec, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + >; + }; + + lcd_pins_sleep: pinmux_lcd_pins_sleep { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8a0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8a4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8a8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8ac, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8b0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8b4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8b8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8bc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8c0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8c4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8c8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8cc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8d0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8d4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8d8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8dc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8e0, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8e4, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8e8, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8ec, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7) + >; + }; + + leds_pins: pinmux_leds_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x868, PIN_OUTPUT | MUX_MODE7) + AM33XX_IOPAD(0x86c, PIN_OUTPUT | MUX_MODE7) + >; + }; + + mmc1_pins: pinmux_mmc1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) + >; + }; + + spi0_pins: pinmux_spi0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x950, PIN_OUTPUT_PULLDOWN | MUX_MODE0) + AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x95c, PIN_OUTPUT_PULLUP | MUX_MODE0) + >; + }; + + uart0_pins: pinmux_uart0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) + >; + }; + + nandflash_pins: pinmux_nandflash_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x800, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x804, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x808, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x80c, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x810, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x814, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x818, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x81c, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x870, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x874, PIN_OUTPUT | MUX_MODE0) + AM33XX_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE0) + AM33XX_IOPAD(0x890, PIN_OUTPUT | MUX_MODE0) + AM33XX_IOPAD(0x894, PIN_OUTPUT | MUX_MODE0) + AM33XX_IOPAD(0x898, PIN_OUTPUT | MUX_MODE0) + AM33XX_IOPAD(0x89c, PIN_OUTPUT | MUX_MODE0) + >; + }; +}; Modified: head/sys/gnu/dts/arm/am335x-icev2.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-icev2.dts Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-icev2.dts Wed May 8 19:27:30 2019 (r347366) @@ -484,10 +484,6 @@ dual_emac; }; -&phy_sel { - rmii-clock-ext; -}; - &davinci_mdio { pinctrl-names = "default", "sleep"; pinctrl-0 = <&davinci_mdio_default>; Modified: head/sys/gnu/dts/arm/am335x-igep0033.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-igep0033.dtsi Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-igep0033.dtsi Wed May 8 19:27:30 2019 (r347366) @@ -123,10 +123,6 @@ phy-mode = "rmii"; }; -&phy_sel { - rmii-clock-ext; -}; - &elm { status = "okay"; }; Modified: head/sys/gnu/dts/arm/am335x-lxm.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-lxm.dts Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-lxm.dts Wed May 8 19:27:30 2019 (r347366) @@ -328,10 +328,6 @@ dual_emac_res_vlan = <3>; }; -&phy_sel { - rmii-clock-ext; -}; - &mac { pinctrl-names = "default", "sleep"; pinctrl-0 = <&cpsw_default>; Modified: head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi Wed May 8 19:27:30 2019 (r347366) @@ -159,11 +159,6 @@ status = "okay"; }; -&phy_sel { - reg= <0x44e10650 0xf5>; - rmii-clock-ext; -}; - &sham { status = "okay"; }; Modified: head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Wed May 8 19:27:30 2019 (r347366) @@ -446,11 +446,6 @@ dual_emac_res_vlan = <2>; }; -&phy_sel { - reg= <0x44e10650 0xf5>; - rmii-clock-ext; -}; - &sham { status = "okay"; }; Modified: head/sys/gnu/dts/arm/am335x-phycore-som.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-phycore-som.dtsi Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-phycore-som.dtsi Wed May 8 19:27:30 2019 (r347366) @@ -100,10 +100,6 @@ status = "okay"; }; -&phy_sel { - rmii-clock-ext; -}; - /* I2C Busses */ &am33xx_pinmux { i2c0_pins: pinmux_i2c0 { Modified: head/sys/gnu/dts/arm/am335x-shc.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-shc.dts Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am335x-shc.dts Wed May 8 19:27:30 2019 (r347366) @@ -1,11 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 /* * support for the bosch am335x based shc c3 board * * Copyright, C) 2015 Heiko Schocher * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ /dts-v1/; Modified: head/sys/gnu/dts/arm/am33xx-l4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx-l4.dtsi Wed May 8 19:05:58 2019 (r347365) +++ head/sys/gnu/dts/arm/am33xx-l4.dtsi Wed May 8 19:27:30 2019 (r347366) @@ -279,17 +279,9 @@ #pinctrl-cells = <1>; ranges = <0 0 0x2000>; - phy_sel: cpsw-phy-sel@650 { - compatible = "ti,am3352-cpsw-phy-sel"; - reg= <0x650 0x4>; - reg-names = "gmii-sel"; - }; - am33xx_pinmux: pinmux@800 { compatible = "pinctrl-single"; reg = <0x800 0x238>; - #address-cells = <1>; - #size-cells = <0>; #pinctrl-cells = <1>; pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x7f>; @@ -302,6 +294,12 @@ #size-cells = <1>; ranges = <0 0 0x800>; + phy_gmii_sel: phy-gmii-sel { + compatible = "ti,am3352-phy-gmii-sel"; + reg = <0x650 0x4>; + #phy-cells = <2>; + }; + scm_clocks: clocks { #address-cells = <1>; #size-cells = <0>; @@ -717,7 +715,6 @@ interrupts = <40 41 42 43>; ranges = <0 0 0x8000>; syscon = <&scm_conf>; - cpsw-phy-sel = <&phy_sel>; status = "disabled"; davinci_mdio: mdio@1000 { @@ -733,11 +730,13 @@ cpsw_emac0: slave@200 { /* Filled in by U-Boot */ mac-address = [ 00 00 00 00 00 00 ]; + phys = <&phy_gmii_sel 1 1>; }; cpsw_emac1: slave@300 { /* Filled in by U-Boot */ mac-address = [ 00 00 00 00 00 00 ]; + phys = <&phy_gmii_sel 2 1>; }; }; }; @@ -1763,7 +1762,7 @@ reg = <0xcc000 0x4>; reg-names = "rev"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ - clocks = <&l4ls_clkctrl AM3_D_CAN0_CLKCTRL 0>; + clocks = <&l4ls_clkctrl AM3_L4LS_D_CAN0_CLKCTRL 0>; clock-names = "fck"; #address-cells = <1>; #size-cells = <1>; @@ -1786,7 +1785,7 @@ reg = <0xd0000 0x4>; reg-names = "rev"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ - clocks = <&l4ls_clkctrl AM3_D_CAN1_CLKCTRL 0>; + clocks = <&l4ls_clkctrl AM3_L4LS_D_CAN1_CLKCTRL 0>; clock-names = "fck"; #address-cells = <1>; #size-cells = <1>; Copied: head/sys/gnu/dts/arm/am3874-iceboard.dts (from r347363, vendor/device-tree/dist/src/arm/am3874-iceboard.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am3874-iceboard.dts Wed May 8 19:27:30 2019 (r347366, copy of r347363, vendor/device-tree/dist/src/arm/am3874-iceboard.dts) @@ -0,0 +1,496 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device tree for Winterland IceBoard + * + * http://mcgillcosmology.com + * http://threespeedlogic.com + * + * This is an ARM + FPGA instrumentation board used at telescopes in + * Antarctica (the South Pole Telescope), Chile (POLARBEAR), and at the DRAO + * observatory in British Columbia (CHIME). + * + * Copyright (c) 2019 Three-Speed Logic, Inc. + */ + +/dts-v1/; + +#include "dm814x.dtsi" +#include + +/ { + model = "Winterland IceBoard"; + compatible = "ti,dm8148", "ti,dm814"; + + chosen { + stdout-path = "serial1:115200n8"; + bootargs = "earlycon"; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x40000000>; /* 1 GB */ + }; + + vmmcsd_fixed: fixedregulator0 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; +}; + +/* The MAC provides internal delay for the transmit path ONLY, which is enabled + * provided no -id/-txid/-rxid suffix is provided to "phy-mode". + * + * The receive path is delayed at the PHY. The recommended register settings + * are 0xf0 for the control bits, and 0x7777 for the data bits. However, the + * conversion code in the kernel lies: the PHY's registers are 120 ps per tap, + * and the kernel assumes 200 ps per tap. So we have fudged the numbers here to + * obtain the correct register settings. + */ +&mac { dual_emac = <1>; }; +&cpsw_emac0 { + phy-handle = <ðphy0>; + phy-mode = "rgmii"; + dual_emac_res_vlan = <1>; +}; +&cpsw_emac1 { + phy-handle = <ðphy1>; + phy-mode = "rgmii"; + dual_emac_res_vlan = <2>; +}; + +&davinci_mdio { + ethphy0: ethernet-phy@0 { + reg = <0x2>; + + rxc-skew-ps = <3000>; + rxdv-skew-ps = <0>; + + rxd3-skew-ps = <0>; + rxd2-skew-ps = <0>; + rxd1-skew-ps = <0>; + rxd0-skew-ps = <0>; + + phy-reset-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; + }; + + ethphy1: ethernet-phy@1 { + reg = <0x1>; + + rxc-skew-ps = <3000>; + rxdv-skew-ps = <0>; + + rxd3-skew-ps = <0>; + rxd2-skew-ps = <0>; + rxd1-skew-ps = <0>; + rxd0-skew-ps = <0>; + + phy-reset-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + }; +}; + +&mmc1 { status = "disabled"; }; +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_pins>; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <4>; +}; +&mmc3 { status = "disabled"; }; + +&i2c1 { + /* Most I2C activity happens through this port, with the sole exception + * of the backplane. Since there are multiply assigned addresses, the + * "i2c-mux-idle-disconnect" is important. + */ + + pca9548@70 { + compatible = "nxp,pca9548"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + /* FMC A */ + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + i2c-mux-idle-disconnect; + }; + + i2c@1 { + /* FMC B */ + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + i2c-mux-idle-disconnect; + }; + + i2c@2 { + /* QSFP A */ + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + i2c-mux-idle-disconnect; + }; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 8 20:01:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6794115922CB; Wed, 8 May 2019 20:01:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B2298C313; Wed, 8 May 2019 20:01:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9397A988; Wed, 8 May 2019 20:01:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48K19iQ050923; Wed, 8 May 2019 20:01:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48K19dR050922; Wed, 8 May 2019 20:01:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905082001.x48K19dR050922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 May 2019 20:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347368 - head/sys/dev/cpuctl X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/cpuctl X-SVN-Commit-Revision: 347368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B2298C313 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 20:01:10 -0000 Author: kib Date: Wed May 8 20:01:09 2019 New Revision: 347368 URL: https://svnweb.freebsd.org/changeset/base/347368 Log: x86: Put other CPUs into tight loop when updating Intel microcode from loaded OS. This should prevent at least some theoretical issues whith code execution on HT sibling of the core where the update is loaded. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20201 Modified: head/sys/dev/cpuctl/cpuctl.c Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Wed May 8 19:42:00 2019 (r347367) +++ head/sys/dev/cpuctl/cpuctl.c Wed May 8 20:01:09 2019 (r347368) @@ -330,9 +330,26 @@ cpuctl_do_update(int cpu, cpuctl_update_args_t *data, return (ret); } +struct ucode_update_data { + void *ptr; + int cpu; + int ret; +}; + +static void +ucode_intel_load_rv(void *arg) +{ + struct ucode_update_data *d; + + d = arg; + if (PCPU_GET(cpuid) == d->cpu) + d->ret = ucode_intel_load(d->ptr, true, NULL, NULL); +} + static int update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td) { + struct ucode_update_data d; void *ptr; int is_bound, oldcpu, ret; @@ -360,12 +377,11 @@ update_intel(int cpu, cpuctl_update_args_t *args, stru oldcpu = td->td_oncpu; is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); - critical_enter(); - - ret = ucode_intel_load(ptr, true, NULL, NULL); - - critical_exit(); + d.ptr = ptr; + d.cpu = cpu; + smp_rendezvous(NULL, ucode_intel_load_rv, NULL, &d); restore_cpu(oldcpu, is_bound, td); + ret = d.ret; /* * Replace any existing update. This ensures that the new update From owner-svn-src-all@freebsd.org Wed May 8 20:18:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 531621592AE7; Wed, 8 May 2019 20:18:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA8E58D2B3; Wed, 8 May 2019 20:18:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9A56ABCC; Wed, 8 May 2019 20:18:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48KIBiK062387; Wed, 8 May 2019 20:18:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48KIBoU062386; Wed, 8 May 2019 20:18:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905082018.x48KIBoU062386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 8 May 2019 20:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347369 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 347369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA8E58D2B3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 20:18:12 -0000 Author: imp Date: Wed May 8 20:18:11 2019 New Revision: 347369 URL: https://svnweb.freebsd.org/changeset/base/347369 Log: rename nvme_ctrlr_destroy_qpair to nvme_ctrlr_destroy_qpairs Maintain symmetry with nvme_ctrlr_create_qpairs, making it easier to match init/uninit scenarios. Signed-off-by: John Meneghini Submitted by: Michael Hordijk Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D19781 Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Wed May 8 20:01:09 2019 (r347368) +++ head/sys/dev/nvme/nvme_ctrlr.c Wed May 8 20:18:11 2019 (r347369) @@ -515,28 +515,33 @@ nvme_ctrlr_create_qpairs(struct nvme_controller *ctrlr } static int -nvme_ctrlr_destroy_qpair(struct nvme_controller *ctrlr, struct nvme_qpair *qpair) +nvme_ctrlr_destroy_qpairs(struct nvme_controller *ctrlr) { struct nvme_completion_poll_status status; + struct nvme_qpair *qpair; - status.done = 0; - nvme_ctrlr_cmd_delete_io_sq(ctrlr, qpair, - nvme_completion_poll_cb, &status); - while (!atomic_load_acq_int(&status.done)) - pause("nvme", 1); - if (nvme_completion_is_error(&status.cpl)) { - nvme_printf(ctrlr, "nvme_destroy_io_sq failed!\n"); - return (ENXIO); - } + for (int i = 0; i < ctrlr->num_io_queues; i++) { + qpair = &ctrlr->ioq[i]; - status.done = 0; - nvme_ctrlr_cmd_delete_io_cq(ctrlr, qpair, - nvme_completion_poll_cb, &status); - while (!atomic_load_acq_int(&status.done)) - pause("nvme", 1); - if (nvme_completion_is_error(&status.cpl)) { - nvme_printf(ctrlr, "nvme_destroy_io_cq failed!\n"); - return (ENXIO); + status.done = 0; + nvme_ctrlr_cmd_delete_io_sq(ctrlr, qpair, + nvme_completion_poll_cb, &status); + while (!atomic_load_acq_int(&status.done)) + pause("nvme", 1); + if (nvme_completion_is_error(&status.cpl)) { + nvme_printf(ctrlr, "nvme_destroy_io_sq failed!\n"); + return (ENXIO); + } + + status.done = 0; + nvme_ctrlr_cmd_delete_io_cq(ctrlr, qpair, + nvme_completion_poll_cb, &status); + while (!atomic_load_acq_int(&status.done)) + pause("nvme", 1); + if (nvme_completion_is_error(&status.cpl)) { + nvme_printf(ctrlr, "nvme_destroy_io_cq failed!\n"); + return (ENXIO); + } } return (0); @@ -1314,8 +1319,8 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, dev if (ctrlr->cdev) destroy_dev(ctrlr->cdev); + nvme_ctrlr_destroy_qpairs(ctrlr); for (i = 0; i < ctrlr->num_io_queues; i++) { - nvme_ctrlr_destroy_qpair(ctrlr, &ctrlr->ioq[i]); nvme_io_qpair_destroy(&ctrlr->ioq[i]); } free(ctrlr->ioq, M_NVME); From owner-svn-src-all@freebsd.org Wed May 8 21:03:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 382391593B43; Wed, 8 May 2019 21:03:04 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D12798ECF2; Wed, 8 May 2019 21:03:03 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA968B413; Wed, 8 May 2019 21:03:03 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48L33dA089796; Wed, 8 May 2019 21:03:03 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48L33O5089795; Wed, 8 May 2019 21:03:03 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201905082103.x48L33O5089795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Wed, 8 May 2019 21:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347370 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 347370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D12798ECF2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 21:03:04 -0000 Author: cperciva Date: Wed May 8 21:03:03 2019 New Revision: 347370 URL: https://svnweb.freebsd.org/changeset/base/347370 Log: Bump EC2 AMI filesystem size up to 4000 MB. AMIs have been breaking for the past month due to insufficient disk space. Due to the small amount of overhead in the disk image, the EC2 AMIs end up with the same (4GB) minimum disk size. Reported by: Michal Krawczyk Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Wed May 8 20:18:11 2019 (r347369) +++ head/release/tools/ec2.conf Wed May 8 21:03:03 2019 (r347370) @@ -19,12 +19,12 @@ fi # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_loghostkey firstboot_freebsd_update firstboot_pkgs ntpd" -# Build with a 3 GB UFS partition; the growfs rc.d script will expand +# Build with a 3.9 GB UFS partition; the growfs rc.d script will expand # the partition to fill the root disk after the EC2 instance is launched. # Note that if this is set to G, we will end up with an GB disk # image since VMSIZE is the size of the UFS partition, not the disk which # it resides within. -export VMSIZE=3072M +export VMSIZE=4000M # No swap space; the ec2_ephemeralswap rc.d script will allocate swap # space on EC2 ephemeral disks. (If they exist -- the T2 low-cost instances From owner-svn-src-all@freebsd.org Wed May 8 21:26:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67AE81594085; Wed, 8 May 2019 21:26:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3F0A8F6B6; Wed, 8 May 2019 21:26:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7403B781; Wed, 8 May 2019 21:26:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48LQB6H000495; Wed, 8 May 2019 21:26:11 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48LQBma000494; Wed, 8 May 2019 21:26:11 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905082126.x48LQBma000494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 May 2019 21:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347371 - head/etc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 347371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3F0A8F6B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 21:26:12 -0000 Author: manu Date: Wed May 8 21:26:11 2019 New Revision: 347371 URL: https://svnweb.freebsd.org/changeset/base/347371 Log: etc/Makefile: Remove empty newline This was commited accidently in r347356 and cause distribution with NO_ROOT set to fail. Reported by: ci, kib MFC after: 2 weeks X-MFC-With: r347356 Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed May 8 21:03:03 2019 (r347370) +++ head/etc/Makefile Wed May 8 21:26:11 2019 (r347371) @@ -83,7 +83,6 @@ distribution: echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \ echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ - ) | ${METALOG.add} .endif ${_+_}cd ${.CURDIR}/gss; ${MAKE} install From owner-svn-src-all@freebsd.org Wed May 8 23:13:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1334B15962CF; Wed, 8 May 2019 23:13:29 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CE896C1CF; Wed, 8 May 2019 23:13:28 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 540ECCB5C; Wed, 8 May 2019 23:13:28 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48NDSHh057416; Wed, 8 May 2019 23:13:28 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48NDSPp057415; Wed, 8 May 2019 23:13:28 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201905082313.x48NDSPp057415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 8 May 2019 23:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347373 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 347373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CE896C1CF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 23:13:29 -0000 Author: erj Date: Wed May 8 23:13:27 2019 New Revision: 347373 URL: https://svnweb.freebsd.org/changeset/base/347373 Log: iflib: Add missing return statement that was left out from r347197 Modified: stable/11/sys/net/iflib.c Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Wed May 8 22:28:13 2019 (r347372) +++ stable/11/sys/net/iflib.c Wed May 8 23:13:27 2019 (r347373) @@ -3758,6 +3758,7 @@ _task_fn_admin(void *context) if ((!running & !oactive) && !(ctx->ifc_sctx->isc_flags & IFLIB_ADMIN_ALWAYS_RUN)) + return; if (in_detach) return; From owner-svn-src-all@freebsd.org Wed May 8 23:24:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90D7B159676A; Wed, 8 May 2019 23:24:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35CAC6C965; Wed, 8 May 2019 23:24:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9C90CCFA; Wed, 8 May 2019 23:24:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48NOlHG062686; Wed, 8 May 2019 23:24:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48NOlcJ062685; Wed, 8 May 2019 23:24:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905082324.x48NOlcJ062685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 8 May 2019 23:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347374 - stable/11/sys/amd64/vmm/io X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/amd64/vmm/io X-SVN-Commit-Revision: 347374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35CAC6C965 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.932,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 23:24:48 -0000 Author: jhb Date: Wed May 8 23:24:47 2019 New Revision: 347374 URL: https://svnweb.freebsd.org/changeset/base/347374 Log: MFC 333174: Use PCI power-mgmt to reset a device if FLR fails. A large number of devices don't support PCIe FLR, in particular graphics adapters. Use PCI power management to perform the reset if FLR fails or isn't available, by cycling the device through the D3 state. This has been tested by a number of users with Nvidia and AMD GPUs. Modified: stable/11/sys/amd64/vmm/io/ppt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/io/ppt.c ============================================================================== --- stable/11/sys/amd64/vmm/io/ppt.c Wed May 8 23:13:27 2019 (r347373) +++ stable/11/sys/amd64/vmm/io/ppt.c Wed May 8 23:24:47 2019 (r347374) @@ -351,6 +351,30 @@ ppt_is_mmio(struct vm *vm, vm_paddr_t gpa) return (FALSE); } +static void +ppt_pci_reset(device_t dev) +{ + int ps; + + if (pcie_flr(dev, + max(pcie_get_max_completion_timeout(dev) / 1000, 10), + true)) + return; + + /* + * If FLR fails, attempt a power-management reset by cycling + * the device in/out of D3 state. + * PCI spec says we can only go into D3 state from D0 state. + * Transition from D[12] into D0 before going to D3 state. + */ + ps = pci_get_powerstate(dev); + if (ps != PCI_POWERSTATE_D0 && ps != PCI_POWERSTATE_D3) + pci_set_powerstate(dev, PCI_POWERSTATE_D0); + if (pci_get_powerstate(dev) != PCI_POWERSTATE_D3) + pci_set_powerstate(dev, PCI_POWERSTATE_D3); + pci_set_powerstate(dev, ps); +} + int ppt_assign_device(struct vm *vm, int bus, int slot, int func) { @@ -366,9 +390,7 @@ ppt_assign_device(struct vm *vm, int bus, int slot, in return (EBUSY); pci_save_state(ppt->dev); - pcie_flr(ppt->dev, - max(pcie_get_max_completion_timeout(ppt->dev) / 1000, 10), - true); + ppt_pci_reset(ppt->dev); pci_restore_state(ppt->dev); ppt->vm = vm; iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); @@ -391,9 +413,7 @@ ppt_unassign_device(struct vm *vm, int bus, int slot, return (EBUSY); pci_save_state(ppt->dev); - pcie_flr(ppt->dev, - max(pcie_get_max_completion_timeout(ppt->dev) / 1000, 10), - true); + ppt_pci_reset(ppt->dev); pci_restore_state(ppt->dev); ppt_unmap_mmio(vm, ppt); ppt_teardown_msi(ppt); From owner-svn-src-all@freebsd.org Wed May 8 23:39:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAB3915969DE; Wed, 8 May 2019 23:39:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 709216CE0E; Wed, 8 May 2019 23:39:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A2B9CECE; Wed, 8 May 2019 23:39:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x48NdP3s067904; Wed, 8 May 2019 23:39:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x48NdOq3067899; Wed, 8 May 2019 23:39:24 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201905082339.x48NdOq3067899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 8 May 2019 23:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347375 - in head/sys: net netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: net netinet X-SVN-Commit-Revision: 347375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 709216CE0E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2019 23:39:26 -0000 Author: glebius Date: Wed May 8 23:39:24 2019 New Revision: 347375 URL: https://svnweb.freebsd.org/changeset/base/347375 Log: Existense of PCB route caching doesn't allow us to use new fast route lookup KPI in ip_output() like it is already used in ip_forward(). However, when there is no PCB provided we can use fast KPI, gaining performance advantage. Typical case when ip_output() is called without a PCB pointer is a sendto(2) on a not connected UDP socket. In practice DNS servers do this. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D19804 Modified: head/sys/net/route.h head/sys/net/route_var.h head/sys/netinet/in_fib.c head/sys/netinet/in_fib.h head/sys/netinet/ip_output.c Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Wed May 8 23:24:47 2019 (r347374) +++ head/sys/net/route.h Wed May 8 23:39:24 2019 (r347375) @@ -210,6 +210,7 @@ struct rtentry { #define NHF_DEFAULT 0x0080 /* Default route */ #define NHF_BROADCAST 0x0100 /* RTF_BROADCAST */ #define NHF_GATEWAY 0x0200 /* RTF_GATEWAY */ +#define NHF_HOST 0x0400 /* RTF_HOST */ /* Nexthop request flags */ #define NHR_IFAIF 0x01 /* Return ifa_ifp interface */ Modified: head/sys/net/route_var.h ============================================================================== --- head/sys/net/route_var.h Wed May 8 23:24:47 2019 (r347374) +++ head/sys/net/route_var.h Wed May 8 23:39:24 2019 (r347375) @@ -67,6 +67,7 @@ fib_rte_to_nh_flags(int rt_flags) uint16_t res; res = (rt_flags & RTF_REJECT) ? NHF_REJECT : 0; + res |= (rt_flags & RTF_HOST) ? NHF_HOST : 0; res |= (rt_flags & RTF_BLACKHOLE) ? NHF_BLACKHOLE : 0; res |= (rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) ? NHF_REDIRECT : 0; res |= (rt_flags & RTF_BROADCAST) ? NHF_BROADCAST : 0; Modified: head/sys/netinet/in_fib.c ============================================================================== --- head/sys/netinet/in_fib.c Wed May 8 23:24:47 2019 (r347374) +++ head/sys/netinet/in_fib.c Wed May 8 23:39:24 2019 (r347375) @@ -96,7 +96,6 @@ fib4_rte_to_nh_extended(struct rtentry *rte, struct in uint32_t flags, struct nhop4_extended *pnh4) { struct sockaddr_in *gw; - struct in_ifaddr *ia; if ((flags & NHR_IFAIF) != 0) pnh4->nh_ifp = rte->rt_ifa->ifa_ifp; @@ -113,10 +112,8 @@ fib4_rte_to_nh_extended(struct rtentry *rte, struct in gw = (struct sockaddr_in *)rt_key(rte); if (gw->sin_addr.s_addr == 0) pnh4->nh_flags |= NHF_DEFAULT; - /* XXX: Set RTF_BROADCAST if GW address is broadcast */ - - ia = ifatoia(rte->rt_ifa); - pnh4->nh_src = IA_SIN(ia)->sin_addr; + pnh4->nh_ia = ifatoia(rte->rt_ifa); + pnh4->nh_src = IA_SIN(pnh4->nh_ia)->sin_addr; } /* Modified: head/sys/netinet/in_fib.h ============================================================================== --- head/sys/netinet/in_fib.h Wed May 8 23:24:47 2019 (r347374) +++ head/sys/netinet/in_fib.h Wed May 8 23:39:24 2019 (r347375) @@ -43,12 +43,13 @@ struct nhop4_basic { /* Extended nexthop info used for control protocols */ struct nhop4_extended { struct ifnet *nh_ifp; /* Logical egress interface */ + struct in_ifaddr *nh_ia; /* Associated address */ uint16_t nh_mtu; /* nexthop mtu */ uint16_t nh_flags; /* nhop flags */ uint8_t spare[4]; struct in_addr nh_addr; /* GW/DST IPv4 address */ struct in_addr nh_src; /* default source IPv4 address */ - uint64_t spare2[2]; + uint64_t spare2; }; int fib4_lookup_nh_basic(uint32_t fibnum, struct in_addr dst, uint32_t flags, Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed May 8 23:24:47 2019 (r347374) +++ head/sys/netinet/ip_output.c Wed May 8 23:39:24 2019 (r347375) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -227,13 +228,12 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou int hlen = sizeof (struct ip); int mtu; int error = 0; - struct sockaddr_in *dst; + struct sockaddr_in *dst, sin; const struct sockaddr_in *gw; struct in_ifaddr *ia; + struct in_addr src; int isbroadcast; uint16_t ip_len, ip_off; - struct route iproute; - struct rtentry *rte; /* cache for ro->ro_rt */ uint32_t fibnum; #if defined(IPSEC) || defined(IPSEC_SUPPORT) int no_route_but_check_spd = 0; @@ -252,11 +252,6 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou #endif } - if (ro == NULL) { - ro = &iproute; - bzero(ro, sizeof (*ro)); - } - if (opt) { int len = 0; m = ip_insertoptions(m, opt, &len); @@ -281,26 +276,28 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou /* * dst/gw handling: * - * dst can be rewritten but always points to &ro->ro_dst. * gw is readonly but can point either to dst OR rt_gateway, * therefore we need restore gw if we're redoing lookup. */ - gw = dst = (struct sockaddr_in *)&ro->ro_dst; fibnum = (inp != NULL) ? inp->inp_inc.inc_fibnum : M_GETFIB(m); - rte = ro->ro_rt; - if (rte == NULL) { + if (ro != NULL) + dst = (struct sockaddr_in *)&ro->ro_dst; + else + dst = &sin; + if (ro == NULL || ro->ro_rt == NULL) { bzero(dst, sizeof(*dst)); dst->sin_family = AF_INET; dst->sin_len = sizeof(*dst); dst->sin_addr = ip->ip_dst; } + gw = dst; NET_EPOCH_ENTER(et); again: /* * Validate route against routing table additions; * a better/more specific route might have been added. */ - if (inp) + if (inp != NULL && ro != NULL && ro->ro_rt != NULL) RT_VALIDATE(ro, &inp->inp_rt_cookie, fibnum); /* * If there is a cached route, @@ -310,15 +307,12 @@ again: * cache with IPv6. * Also check whether routing cache needs invalidation. */ - rte = ro->ro_rt; - if (rte && ((rte->rt_flags & RTF_UP) == 0 || - rte->rt_ifp == NULL || - !RT_LINK_IS_UP(rte->rt_ifp) || - dst->sin_family != AF_INET || - dst->sin_addr.s_addr != ip->ip_dst.s_addr)) { + if (ro != NULL && ro->ro_rt != NULL && + ((ro->ro_rt->rt_flags & RTF_UP) == 0 || + ro->ro_rt->rt_ifp == NULL || !RT_LINK_IS_UP(ro->ro_rt->rt_ifp) || + dst->sin_family != AF_INET || + dst->sin_addr.s_addr != ip->ip_dst.s_addr)) RO_INVALIDATE_CACHE(ro); - rte = NULL; - } ia = NULL; /* * If routing to interface only, short circuit routing lookup. @@ -338,8 +332,10 @@ again: ip->ip_dst.s_addr = INADDR_BROADCAST; dst->sin_addr = ip->ip_dst; ifp = ia->ia_ifp; + mtu = ifp->if_mtu; ip->ip_ttl = 1; isbroadcast = 1; + src = IA_SIN(ia)->sin_addr; } else if (flags & IP_ROUTETOIF) { if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst), M_GETFIB(m)))) == NULL && @@ -350,9 +346,11 @@ again: goto bad; } ifp = ia->ia_ifp; + mtu = ifp->if_mtu; ip->ip_ttl = 1; isbroadcast = ifp->if_flags & IFF_BROADCAST ? in_ifaddr_broadcast(dst->sin_addr, ia) : 0; + src = IA_SIN(ia)->sin_addr; } else if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) && imo != NULL && imo->imo_multicast_ifp != NULL) { /* @@ -360,15 +358,17 @@ again: * packets if the interface is specified. */ ifp = imo->imo_multicast_ifp; + mtu = ifp->if_mtu; IFP_TO_IA(ifp, ia, &in_ifa_tracker); isbroadcast = 0; /* fool gcc */ - } else { - /* - * We want to do any cloning requested by the link layer, - * as this is probably required in all cases for correct - * operation (as it is for ARP). - */ - if (rte == NULL) { + src = IA_SIN(ia)->sin_addr; + } else if (ro != NULL) { + if (ro->ro_rt == NULL) { + /* + * We want to do any cloning requested by the link + * layer, as this is probably required in all cases + * for correct operation (as it is for ARP). + */ #ifdef RADIX_MPATH rtalloc_mpath_fib(ro, ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr), @@ -376,12 +376,47 @@ again: #else in_rtalloc_ign(ro, 0, fibnum); #endif - rte = ro->ro_rt; + if (ro->ro_rt == NULL || + (ro->ro_rt->rt_flags & RTF_UP) == 0 || + ro->ro_rt->rt_ifp == NULL || + !RT_LINK_IS_UP(ro->ro_rt->rt_ifp)) { +#if defined(IPSEC) || defined(IPSEC_SUPPORT) + /* + * There is no route for this packet, but it is + * possible that a matching SPD entry exists. + */ + no_route_but_check_spd = 1; + mtu = 0; /* Silence GCC warning. */ + goto sendit; +#endif + IPSTAT_INC(ips_noroute); + error = EHOSTUNREACH; + goto bad; + } } - if (rte == NULL || - (rte->rt_flags & RTF_UP) == 0 || - rte->rt_ifp == NULL || - !RT_LINK_IS_UP(rte->rt_ifp)) { + ia = ifatoia(ro->ro_rt->rt_ifa); + ifp = ro->ro_rt->rt_ifp; + counter_u64_add(ro->ro_rt->rt_pksent, 1); + rt_update_ro_flags(ro); + if (ro->ro_rt->rt_flags & RTF_GATEWAY) + gw = (struct sockaddr_in *)ro->ro_rt->rt_gateway; + if (ro->ro_rt->rt_flags & RTF_HOST) + isbroadcast = (ro->ro_rt->rt_flags & RTF_BROADCAST); + else if (ifp->if_flags & IFF_BROADCAST) + isbroadcast = in_ifaddr_broadcast(gw->sin_addr, ia); + else + isbroadcast = 0; + if (ro->ro_rt->rt_flags & RTF_HOST) + mtu = ro->ro_rt->rt_mtu; + else + mtu = ifp->if_mtu; + src = IA_SIN(ia)->sin_addr; + } else { + struct nhop4_extended nh; + + bzero(&nh, sizeof(nh)); + if (fib4_lookup_nh_ext(M_GETFIB(m), ip->ip_dst, 0, 0, &nh) != + 0) { #if defined(IPSEC) || defined(IPSEC_SUPPORT) /* * There is no route for this packet, but it is @@ -395,31 +430,29 @@ again: error = EHOSTUNREACH; goto bad; } - ia = ifatoia(rte->rt_ifa); - ifp = rte->rt_ifp; - counter_u64_add(rte->rt_pksent, 1); - rt_update_ro_flags(ro); - if (rte->rt_flags & RTF_GATEWAY) - gw = (struct sockaddr_in *)rte->rt_gateway; - if (rte->rt_flags & RTF_HOST) - isbroadcast = (rte->rt_flags & RTF_BROADCAST); - else if (ifp->if_flags & IFF_BROADCAST) - isbroadcast = in_ifaddr_broadcast(gw->sin_addr, ia); - else - isbroadcast = 0; + ifp = nh.nh_ifp; + mtu = nh.nh_mtu; + /* + * We are rewriting here dst to be gw actually, contradicting + * comment at the beginning of the function. However, in this + * case we are always dealing with on stack dst. + * In case if pfil(9) sends us back to beginning of the + * function, the dst would be rewritten by ip_output_pfil(). + */ + MPASS(dst == &sin); + dst->sin_addr = nh.nh_addr; + ia = nh.nh_ia; + src = nh.nh_src; + isbroadcast = (((nh.nh_flags & (NHF_HOST | NHF_BROADCAST)) == + (NHF_HOST | NHF_BROADCAST)) || + ((ifp->if_flags & IFF_BROADCAST) && + in_ifaddr_broadcast(dst->sin_addr, ia))); } - /* - * Calculate MTU. If we have a route that is up, use that, - * otherwise use the interface's MTU. - */ - if (rte != NULL && (rte->rt_flags & (RTF_UP|RTF_HOST))) - mtu = rte->rt_mtu; - else - mtu = ifp->if_mtu; /* Catch a possible divide by zero later. */ - KASSERT(mtu > 0, ("%s: mtu %d <= 0, rte=%p (rt_flags=0x%08x) ifp=%p", - __func__, mtu, rte, (rte != NULL) ? rte->rt_flags : 0, ifp)); + KASSERT(mtu > 0, ("%s: mtu %d <= 0, ro=%p (rt_flags=0x%08x) ifp=%p", + __func__, mtu, ro, + (ro != NULL && ro->ro_rt != NULL) ? ro->ro_rt->rt_flags : 0, ifp)); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { m->m_flags |= M_MCAST; @@ -455,11 +488,8 @@ again: * If source address not specified yet, use address * of outgoing interface. */ - if (ip->ip_src.s_addr == INADDR_ANY) { - /* Interface may have no addresses. */ - if (ia != NULL) - ip->ip_src = IA_SIN(ia)->sin_addr; - } + if (ip->ip_src.s_addr == INADDR_ANY) + ip->ip_src = src; if ((imo == NULL && in_mcast_loop) || (imo && imo->imo_multicast_loop)) { @@ -522,12 +552,8 @@ again: * If the source address is not specified yet, use the address * of the outoing interface. */ - if (ip->ip_src.s_addr == INADDR_ANY) { - /* Interface may have no addresses. */ - if (ia != NULL) { - ip->ip_src = IA_SIN(ia)->sin_addr; - } - } + if (ip->ip_src.s_addr == INADDR_ANY) + ip->ip_src = src; /* * Look for broadcast address and @@ -587,9 +613,10 @@ sendit: case -1: /* Need to try again */ /* Reset everything for a new round */ - RO_RTFREE(ro); - ro->ro_prepend = NULL; - rte = NULL; + if (ro != NULL) { + RO_RTFREE(ro); + ro->ro_prepend = NULL; + } gw = dst; ip = mtod(m, struct ip *); goto again; @@ -733,15 +760,6 @@ sendit: IPSTAT_INC(ips_fragmented); done: - if (ro == &iproute) - RO_RTFREE(ro); - else if (rte == NULL) - /* - * If the caller supplied a route but somehow the reference - * to it has been released need to prevent the caller - * calling RTFREE on it again. - */ - ro->ro_rt = NULL; NET_EPOCH_EXIT(et); return (error); bad: From owner-svn-src-all@freebsd.org Thu May 9 01:16:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DFDB1598953; Thu, 9 May 2019 01:16:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42C3D6FD6A; Thu, 9 May 2019 01:16:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D712DFA5; Thu, 9 May 2019 01:16:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x491G3dX020860; Thu, 9 May 2019 01:16:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x491G3RX020857; Thu, 9 May 2019 01:16:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905090116.x491G3RX020857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 May 2019 01:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347376 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 347376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42C3D6FD6A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 01:16:04 -0000 Author: kevans Date: Thu May 9 01:16:03 2019 New Revision: 347376 URL: https://svnweb.freebsd.org/changeset/base/347376 Log: MFC r339121 (tuexen): Use strlcpy() instead of strncpy(). CID: 1395980, 1395981 Modified: stable/11/sys/net/if_tap.c stable/11/sys/net/if_tun.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_tap.c ============================================================================== --- stable/11/sys/net/if_tap.c Wed May 8 23:39:24 2019 (r347375) +++ stable/11/sys/net/if_tap.c Thu May 9 01:16:03 2019 (r347376) @@ -742,7 +742,7 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, i return (EPROTOTYPE); mtx_lock(&tp->tap_mtx); if (ifp->if_mtu != tapp->mtu) { - strncpy(ifr.ifr_name, if_name(ifp), IFNAMSIZ); + strlcpy(ifr.ifr_name, if_name(ifp), IFNAMSIZ); ifr.ifr_mtu = tapp->mtu; CURVNET_SET(ifp->if_vnet); error = ifhwioctl(SIOCSIFMTU, ifp, Modified: stable/11/sys/net/if_tun.c ============================================================================== --- stable/11/sys/net/if_tun.c Wed May 8 23:39:24 2019 (r347375) +++ stable/11/sys/net/if_tun.c Thu May 9 01:16:03 2019 (r347376) @@ -729,7 +729,7 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, i return (EPROTOTYPE); mtx_lock(&tp->tun_mtx); if (TUN2IFP(tp)->if_mtu != tunp->mtu) { - strncpy(ifr.ifr_name, if_name(TUN2IFP(tp)), IFNAMSIZ); + strlcpy(ifr.ifr_name, if_name(TUN2IFP(tp)), IFNAMSIZ); ifr.ifr_mtu = tunp->mtu; CURVNET_SET(TUN2IFP(tp)->if_vnet); error = ifhwioctl(SIOCSIFMTU, TUN2IFP(tp), From owner-svn-src-all@freebsd.org Thu May 9 03:51:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 830EA159BFF7; Thu, 9 May 2019 03:51:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AA04746E7; Thu, 9 May 2019 03:51:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06591FAA4; Thu, 9 May 2019 03:51:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x493pYR9004539; Thu, 9 May 2019 03:51:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x493pYID004536; Thu, 9 May 2019 03:51:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905090351.x493pYID004536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 May 2019 03:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347378 - in stable: 11/sys/geom 11/sys/net 12/sys/geom 12/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/geom 11/sys/net 12/sys/geom 12/sys/net X-SVN-Commit-Revision: 347378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2AA04746E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 03:51:35 -0000 Author: kevans Date: Thu May 9 03:51:34 2019 New Revision: 347378 URL: https://svnweb.freebsd.org/changeset/base/347378 Log: MFC r346602, r346670-r346671, r347183: tun/tap race fixes r346602: tun(4): Defer clearing TUN_OPEN until much later tun destruction will not continue until TUN_OPEN is cleared. There are brief moments in tunclose where the mutex is dropped and we've already cleared TUN_OPEN, so tun_destroy would be able to proceed while we're in the middle of cleaning up the tun still. tun_destroy should be blocked until these parts (address/route purges, mostly) are complete. r346670: tun/tap: close race between destroy/ioctl handler It seems that there should be a better way to handle this, but this seems to be the more common approach and it should likely get replaced in all of the places it happens... Basically, thread 1 is in the process of destroying the tun/tap while thread 2 is executing one of the ioctls that requires the tun/tap mutex and the mutex is destroyed before the ioctl handler can acquire it. This is only one of the races described/found in PR 233955. r346671: tun(4): Don't allow open of open or dying devices Previously, a pid check was used to prevent open of the tun(4); this works, but may not make the most sense as we don't prevent the owner process from opening the tun device multiple times. The potential race described near tun_pid should not be an issue: if a tun(4) is to be handed off, its fd has to have been sent via control message or some other mechanism that duplicates the fd to the receiving process so that it may set the pid. Otherwise, the pid gets cleared when the original process closes it and you have no effective handoff mechanism. Close up another potential issue with handing a tun(4) off by not clobbering state if the closer isn't the controller anymore. If we want some state to be cleared, we should do that a little more surgically. Additionally, nothing prevents a dying tun(4) from being "reopened" in the middle of tun_destroy as soon as the mutex is unlocked, quickly leading to a bad time. Return EBUSY if we're marked for destruction, as well, and the consumer will need to deal with it. The associated character device will be destroyed in short order. r347183: geom: fix initialization order There's a race between the initialization of devsoftc.mtx (by devinit) and the creation of the geom worker thread g_run_events, which calls devctl_queue_data_f. Both of those are initialized at SI_SUB_DRIVERS and SI_ORDER_FIRST, which means the geom worked thread can be created before the mutex has been initialized, leading to the panic below: wpanic: mtx_lock() of spin mutex (null) @ /usr/home/osstest/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 cpuid = 3 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe003b968710 vpanic() at vpanic+0x19d/frame 0xfffffe003b968760 panic() at panic+0x43/frame 0xfffffe003b9687c0 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xfffffe003b968810 devctl_queue_data_f() at devctl_queue_data_f+0x6a/frame 0xfffffe003b968840 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003b968a00 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003b968a30 g_run_events() at g_run_events+0x197/frame 0xfffffe003b968a70 fork_exit() at fork_exit+0x84/frame 0xfffffe003b968ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe003b968ab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- KDB: enter: panic [ thread pid 13 tid 100029 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why Fix this by initializing geom at SI_ORDER_SECOND instead of SI_ORDER_FIRST. PR: 233955 Modified: stable/11/sys/geom/geom.h stable/11/sys/net/if_tap.c stable/11/sys/net/if_tun.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/geom/geom.h stable/12/sys/net/if_tap.c stable/12/sys/net/if_tun.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/geom/geom.h ============================================================================== --- stable/11/sys/geom/geom.h Thu May 9 01:16:34 2019 (r347377) +++ stable/11/sys/geom/geom.h Thu May 9 03:51:34 2019 (r347378) @@ -400,7 +400,7 @@ g_free(void *ptr) static moduledata_t name##_mod = { \ #name, g_modevent, &class \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); + DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); int g_is_geom_thread(struct thread *td); Modified: stable/11/sys/net/if_tap.c ============================================================================== --- stable/11/sys/net/if_tap.c Thu May 9 01:16:34 2019 (r347377) +++ stable/11/sys/net/if_tap.c Thu May 9 03:51:34 2019 (r347378) @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -54,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -163,6 +165,9 @@ MALLOC_DECLARE(M_TAP); MALLOC_DEFINE(M_TAP, CDEV_NAME, "Ethernet tunnel interface"); SYSCTL_INT(_debug, OID_AUTO, if_tap_debug, CTLFLAG_RW, &tapdebug, 0, ""); +static struct sx tap_ioctl_sx; +SX_SYSINIT(tap_ioctl_sx, &tap_ioctl_sx, "tap_ioctl"); + SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, OID_AUTO, tap, CTLFLAG_RW, 0, "Ethernet tunnel software network interface"); @@ -218,6 +223,10 @@ tap_destroy(struct tap_softc *tp) struct ifnet *ifp = tp->tap_ifp; CURVNET_SET(ifp->if_vnet); + sx_xlock(&tap_ioctl_sx); + ifp->if_softc = NULL; + sx_xunlock(&tap_ioctl_sx); + destroy_dev(tp->tap_dev); seldrain(&tp->tap_rsel); knlist_clear(&tp->tap_rsel.si_note, 0); @@ -601,12 +610,18 @@ tapifinit(void *xtp) static int tapifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct tap_softc *tp = ifp->if_softc; + struct tap_softc *tp; struct ifreq *ifr = (struct ifreq *)data; struct ifstat *ifs = NULL; struct ifmediareq *ifmr = NULL; int dummy, error = 0; + sx_xlock(&tap_ioctl_sx); + tp = ifp->if_softc; + if (tp == NULL) { + error = ENXIO; + goto bad; + } switch (cmd) { case SIOCSIFFLAGS: /* XXX -- just like vmnet does */ case SIOCADDMULTI: @@ -649,6 +664,8 @@ tapifioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; } +bad: + sx_xunlock(&tap_ioctl_sx); return (error); } /* tapifioctl */ Modified: stable/11/sys/net/if_tun.c ============================================================================== --- stable/11/sys/net/if_tun.c Thu May 9 01:16:34 2019 (r347377) +++ stable/11/sys/net/if_tun.c Thu May 9 03:51:34 2019 (r347378) @@ -20,6 +20,7 @@ #include "opt_inet6.h" #include +#include #include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -79,16 +81,10 @@ struct tun_softc { #define TUN_RWAIT 0x0040 #define TUN_ASYNC 0x0080 #define TUN_IFHEAD 0x0100 +#define TUN_DYING 0x0200 #define TUN_READY (TUN_OPEN | TUN_INITED) - /* - * XXXRW: tun_pid is used to exclusively lock /dev/tun. Is this - * actually needed? Can we just return EBUSY if already open? - * Problem is that this involved inherent races when a tun device - * is handed off from one process to another, as opposed to just - * being slightly stale informationally. - */ pid_t tun_pid; /* owning pid */ struct ifnet *tun_ifp; /* the interface */ struct sigio *tun_sigio; /* information for async I/O */ @@ -115,6 +111,9 @@ static struct clonedevs *tunclones; static TAILQ_HEAD(,tun_softc) tunhead = TAILQ_HEAD_INITIALIZER(tunhead); SYSCTL_INT(_debug, OID_AUTO, if_tun_debug, CTLFLAG_RW, &tundebug, 0, ""); +static struct sx tun_ioctl_sx; +SX_SYSINIT(tun_ioctl_sx, &tun_ioctl_sx, "tun_ioctl"); + SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, OID_AUTO, tun, CTLFLAG_RW, 0, "IP tunnel software network interface."); @@ -272,12 +271,17 @@ tun_destroy(struct tun_softc *tp) struct cdev *dev; mtx_lock(&tp->tun_mtx); + tp->tun_flags |= TUN_DYING; if ((tp->tun_flags & TUN_OPEN) != 0) cv_wait_unlock(&tp->tun_cv, &tp->tun_mtx); else mtx_unlock(&tp->tun_mtx); CURVNET_SET(TUN2IFP(tp)->if_vnet); + sx_xlock(&tun_ioctl_sx); + TUN2IFP(tp)->if_softc = NULL; + sx_xunlock(&tun_ioctl_sx); + dev = tp->tun_dev; bpfdetach(TUN2IFP(tp)); if_detach(TUN2IFP(tp)); @@ -464,19 +468,13 @@ tunopen(struct cdev *dev, int flag, int mode, struct t tp = dev->si_drv1; } - /* - * XXXRW: This use of tun_pid is subject to error due to the - * fact that a reference to the tunnel can live beyond the - * death of the process that created it. Can we replace this - * with a simple busy flag? - */ mtx_lock(&tp->tun_mtx); - if (tp->tun_pid != 0 && tp->tun_pid != td->td_proc->p_pid) { + if ((tp->tun_flags & (TUN_OPEN | TUN_DYING)) != 0) { mtx_unlock(&tp->tun_mtx); return (EBUSY); } - tp->tun_pid = td->td_proc->p_pid; + tp->tun_pid = td->td_proc->p_pid; tp->tun_flags |= TUN_OPEN; ifp = TUN2IFP(tp); if_link_state_change(ifp, LINK_STATE_UP); @@ -500,8 +498,16 @@ tunclose(struct cdev *dev, int foo, int bar, struct th ifp = TUN2IFP(tp); mtx_lock(&tp->tun_mtx); - tp->tun_flags &= ~TUN_OPEN; - tp->tun_pid = 0; + /* + * Simply close the device if this isn't the controlling process. This + * may happen if, for instance, the tunnel has been handed off to + * another process. The original controller should be able to close it + * without putting us into an inconsistent state. + */ + if (td->td_proc->p_pid != tp->tun_pid) { + mtx_unlock(&tp->tun_mtx); + return (0); + } /* * junk all pending output @@ -540,6 +546,8 @@ tunclose(struct cdev *dev, int foo, int bar, struct th selwakeuppri(&tp->tun_rsel, PZERO + 1); KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); TUNDEBUG (ifp, "closed\n"); + tp->tun_flags &= ~TUN_OPEN; + tp->tun_pid = 0; cv_broadcast(&tp->tun_cv); mtx_unlock(&tp->tun_mtx); @@ -588,10 +596,16 @@ static int tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ifreq *ifr = (struct ifreq *)data; - struct tun_softc *tp = ifp->if_softc; + struct tun_softc *tp; struct ifstat *ifs; int error = 0; + sx_xlock(&tun_ioctl_sx); + tp = ifp->if_softc; + if (tp == NULL) { + error = ENXIO; + goto bad; + } switch(cmd) { case SIOCGIFSTATUS: ifs = (struct ifstat *)data; @@ -618,6 +632,8 @@ tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data default: error = EINVAL; } +bad: + sx_xunlock(&tun_ioctl_sx); return (error); } From owner-svn-src-all@freebsd.org Thu May 9 03:51:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 461D5159BFFB; Thu, 9 May 2019 03:51:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2850746E9; Thu, 9 May 2019 03:51:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0022FAA5; Thu, 9 May 2019 03:51:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x493pZ3w004547; Thu, 9 May 2019 03:51:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x493pZVT004544; Thu, 9 May 2019 03:51:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905090351.x493pZVT004544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 May 2019 03:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347378 - in stable: 11/sys/geom 11/sys/net 12/sys/geom 12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/geom 11/sys/net 12/sys/geom 12/sys/net X-SVN-Commit-Revision: 347378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2850746E9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 03:51:36 -0000 Author: kevans Date: Thu May 9 03:51:34 2019 New Revision: 347378 URL: https://svnweb.freebsd.org/changeset/base/347378 Log: MFC r346602, r346670-r346671, r347183: tun/tap race fixes r346602: tun(4): Defer clearing TUN_OPEN until much later tun destruction will not continue until TUN_OPEN is cleared. There are brief moments in tunclose where the mutex is dropped and we've already cleared TUN_OPEN, so tun_destroy would be able to proceed while we're in the middle of cleaning up the tun still. tun_destroy should be blocked until these parts (address/route purges, mostly) are complete. r346670: tun/tap: close race between destroy/ioctl handler It seems that there should be a better way to handle this, but this seems to be the more common approach and it should likely get replaced in all of the places it happens... Basically, thread 1 is in the process of destroying the tun/tap while thread 2 is executing one of the ioctls that requires the tun/tap mutex and the mutex is destroyed before the ioctl handler can acquire it. This is only one of the races described/found in PR 233955. r346671: tun(4): Don't allow open of open or dying devices Previously, a pid check was used to prevent open of the tun(4); this works, but may not make the most sense as we don't prevent the owner process from opening the tun device multiple times. The potential race described near tun_pid should not be an issue: if a tun(4) is to be handed off, its fd has to have been sent via control message or some other mechanism that duplicates the fd to the receiving process so that it may set the pid. Otherwise, the pid gets cleared when the original process closes it and you have no effective handoff mechanism. Close up another potential issue with handing a tun(4) off by not clobbering state if the closer isn't the controller anymore. If we want some state to be cleared, we should do that a little more surgically. Additionally, nothing prevents a dying tun(4) from being "reopened" in the middle of tun_destroy as soon as the mutex is unlocked, quickly leading to a bad time. Return EBUSY if we're marked for destruction, as well, and the consumer will need to deal with it. The associated character device will be destroyed in short order. r347183: geom: fix initialization order There's a race between the initialization of devsoftc.mtx (by devinit) and the creation of the geom worker thread g_run_events, which calls devctl_queue_data_f. Both of those are initialized at SI_SUB_DRIVERS and SI_ORDER_FIRST, which means the geom worked thread can be created before the mutex has been initialized, leading to the panic below: wpanic: mtx_lock() of spin mutex (null) @ /usr/home/osstest/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 cpuid = 3 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe003b968710 vpanic() at vpanic+0x19d/frame 0xfffffe003b968760 panic() at panic+0x43/frame 0xfffffe003b9687c0 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xfffffe003b968810 devctl_queue_data_f() at devctl_queue_data_f+0x6a/frame 0xfffffe003b968840 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003b968a00 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003b968a30 g_run_events() at g_run_events+0x197/frame 0xfffffe003b968a70 fork_exit() at fork_exit+0x84/frame 0xfffffe003b968ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe003b968ab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- KDB: enter: panic [ thread pid 13 tid 100029 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why Fix this by initializing geom at SI_ORDER_SECOND instead of SI_ORDER_FIRST. PR: 233955 Modified: stable/12/sys/geom/geom.h stable/12/sys/net/if_tap.c stable/12/sys/net/if_tun.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/geom/geom.h stable/11/sys/net/if_tap.c stable/11/sys/net/if_tun.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/geom/geom.h ============================================================================== --- stable/12/sys/geom/geom.h Thu May 9 01:16:34 2019 (r347377) +++ stable/12/sys/geom/geom.h Thu May 9 03:51:34 2019 (r347378) @@ -415,7 +415,7 @@ g_free(void *ptr) static moduledata_t name##_mod = { \ #name, g_modevent, &class \ }; \ - DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); + DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); int g_is_geom_thread(struct thread *td); Modified: stable/12/sys/net/if_tap.c ============================================================================== --- stable/12/sys/net/if_tap.c Thu May 9 01:16:34 2019 (r347377) +++ stable/12/sys/net/if_tap.c Thu May 9 03:51:34 2019 (r347378) @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -55,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -163,6 +165,9 @@ MALLOC_DECLARE(M_TAP); MALLOC_DEFINE(M_TAP, CDEV_NAME, "Ethernet tunnel interface"); SYSCTL_INT(_debug, OID_AUTO, if_tap_debug, CTLFLAG_RW, &tapdebug, 0, ""); +static struct sx tap_ioctl_sx; +SX_SYSINIT(tap_ioctl_sx, &tap_ioctl_sx, "tap_ioctl"); + SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, OID_AUTO, tap, CTLFLAG_RW, 0, "Ethernet tunnel software network interface"); @@ -218,6 +223,10 @@ tap_destroy(struct tap_softc *tp) struct ifnet *ifp = tp->tap_ifp; CURVNET_SET(ifp->if_vnet); + sx_xlock(&tap_ioctl_sx); + ifp->if_softc = NULL; + sx_xunlock(&tap_ioctl_sx); + destroy_dev(tp->tap_dev); seldrain(&tp->tap_rsel); knlist_clear(&tp->tap_rsel.si_note, 0); @@ -601,12 +610,18 @@ tapifinit(void *xtp) static int tapifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct tap_softc *tp = ifp->if_softc; + struct tap_softc *tp; struct ifreq *ifr = (struct ifreq *)data; struct ifstat *ifs = NULL; struct ifmediareq *ifmr = NULL; int dummy, error = 0; + sx_xlock(&tap_ioctl_sx); + tp = ifp->if_softc; + if (tp == NULL) { + error = ENXIO; + goto bad; + } switch (cmd) { case SIOCSIFFLAGS: /* XXX -- just like vmnet does */ case SIOCADDMULTI: @@ -649,6 +664,8 @@ tapifioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; } +bad: + sx_xunlock(&tap_ioctl_sx); return (error); } /* tapifioctl */ Modified: stable/12/sys/net/if_tun.c ============================================================================== --- stable/12/sys/net/if_tun.c Thu May 9 01:16:34 2019 (r347377) +++ stable/12/sys/net/if_tun.c Thu May 9 03:51:34 2019 (r347378) @@ -20,6 +20,7 @@ #include "opt_inet6.h" #include +#include #include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -79,16 +81,10 @@ struct tun_softc { #define TUN_RWAIT 0x0040 #define TUN_ASYNC 0x0080 #define TUN_IFHEAD 0x0100 +#define TUN_DYING 0x0200 #define TUN_READY (TUN_OPEN | TUN_INITED) - /* - * XXXRW: tun_pid is used to exclusively lock /dev/tun. Is this - * actually needed? Can we just return EBUSY if already open? - * Problem is that this involved inherent races when a tun device - * is handed off from one process to another, as opposed to just - * being slightly stale informationally. - */ pid_t tun_pid; /* owning pid */ struct ifnet *tun_ifp; /* the interface */ struct sigio *tun_sigio; /* information for async I/O */ @@ -115,6 +111,9 @@ static struct clonedevs *tunclones; static TAILQ_HEAD(,tun_softc) tunhead = TAILQ_HEAD_INITIALIZER(tunhead); SYSCTL_INT(_debug, OID_AUTO, if_tun_debug, CTLFLAG_RW, &tundebug, 0, ""); +static struct sx tun_ioctl_sx; +SX_SYSINIT(tun_ioctl_sx, &tun_ioctl_sx, "tun_ioctl"); + SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, OID_AUTO, tun, CTLFLAG_RW, 0, "IP tunnel software network interface."); @@ -272,12 +271,17 @@ tun_destroy(struct tun_softc *tp) struct cdev *dev; mtx_lock(&tp->tun_mtx); + tp->tun_flags |= TUN_DYING; if ((tp->tun_flags & TUN_OPEN) != 0) cv_wait_unlock(&tp->tun_cv, &tp->tun_mtx); else mtx_unlock(&tp->tun_mtx); CURVNET_SET(TUN2IFP(tp)->if_vnet); + sx_xlock(&tun_ioctl_sx); + TUN2IFP(tp)->if_softc = NULL; + sx_xunlock(&tun_ioctl_sx); + dev = tp->tun_dev; bpfdetach(TUN2IFP(tp)); if_detach(TUN2IFP(tp)); @@ -464,19 +468,13 @@ tunopen(struct cdev *dev, int flag, int mode, struct t tp = dev->si_drv1; } - /* - * XXXRW: This use of tun_pid is subject to error due to the - * fact that a reference to the tunnel can live beyond the - * death of the process that created it. Can we replace this - * with a simple busy flag? - */ mtx_lock(&tp->tun_mtx); - if (tp->tun_pid != 0 && tp->tun_pid != td->td_proc->p_pid) { + if ((tp->tun_flags & (TUN_OPEN | TUN_DYING)) != 0) { mtx_unlock(&tp->tun_mtx); return (EBUSY); } - tp->tun_pid = td->td_proc->p_pid; + tp->tun_pid = td->td_proc->p_pid; tp->tun_flags |= TUN_OPEN; ifp = TUN2IFP(tp); if_link_state_change(ifp, LINK_STATE_UP); @@ -500,8 +498,16 @@ tunclose(struct cdev *dev, int foo, int bar, struct th ifp = TUN2IFP(tp); mtx_lock(&tp->tun_mtx); - tp->tun_flags &= ~TUN_OPEN; - tp->tun_pid = 0; + /* + * Simply close the device if this isn't the controlling process. This + * may happen if, for instance, the tunnel has been handed off to + * another process. The original controller should be able to close it + * without putting us into an inconsistent state. + */ + if (td->td_proc->p_pid != tp->tun_pid) { + mtx_unlock(&tp->tun_mtx); + return (0); + } /* * junk all pending output @@ -540,6 +546,8 @@ tunclose(struct cdev *dev, int foo, int bar, struct th selwakeuppri(&tp->tun_rsel, PZERO + 1); KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); TUNDEBUG (ifp, "closed\n"); + tp->tun_flags &= ~TUN_OPEN; + tp->tun_pid = 0; cv_broadcast(&tp->tun_cv); mtx_unlock(&tp->tun_mtx); @@ -588,10 +596,16 @@ static int tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ifreq *ifr = (struct ifreq *)data; - struct tun_softc *tp = ifp->if_softc; + struct tun_softc *tp; struct ifstat *ifs; int error = 0; + sx_xlock(&tun_ioctl_sx); + tp = ifp->if_softc; + if (tp == NULL) { + error = ENXIO; + goto bad; + } switch(cmd) { case SIOCGIFSTATUS: ifs = (struct ifstat *)data; @@ -618,6 +632,8 @@ tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data default: error = EINVAL; } +bad: + sx_xunlock(&tun_ioctl_sx); return (error); } From owner-svn-src-all@freebsd.org Thu May 9 04:16:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEBAC159CB2B; Thu, 9 May 2019 04:16:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 548CD754D8; Thu, 9 May 2019 04:16:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BD0AFE46; Thu, 9 May 2019 04:16:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x494G7xX015541; Thu, 9 May 2019 04:16:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x494G6H1015538; Thu, 9 May 2019 04:16:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905090416.x494G6H1015538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 9 May 2019 04:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347379 - stable/12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/scsi X-SVN-Commit-Revision: 347379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 548CD754D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 04:16:07 -0000 Author: mav Date: Thu May 9 04:16:06 2019 New Revision: 347379 URL: https://svnweb.freebsd.org/changeset/base/347379 Log: MFC r347198: Drop periph lock around cam_periph_unmapmem(). Since r345656 it may call copyout(), that may sleep. Modified: stable/12/sys/cam/scsi/scsi_pass.c stable/12/sys/cam/scsi/scsi_sg.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_pass.c Thu May 9 03:51:34 2019 (r347378) +++ stable/12/sys/cam/scsi/scsi_pass.c Thu May 9 04:16:06 2019 (r347379) @@ -2261,7 +2261,9 @@ passsendccb(struct cam_periph *periph, union ccb *ccb, /* sense_flags */ SF_RETRY_UA | SF_NO_PRINT, softc->device_stats); + cam_periph_unlock(periph); cam_periph_unmapmem(ccb, &mapinfo); + cam_periph_lock(periph); ccb->ccb_h.cbfcnp = NULL; ccb->ccb_h.periph_priv = inccb->ccb_h.periph_priv; Modified: stable/12/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_sg.c Thu May 9 03:51:34 2019 (r347378) +++ stable/12/sys/cam/scsi/scsi_sg.c Thu May 9 04:16:06 2019 (r347379) @@ -915,7 +915,9 @@ sgsendccb(struct cam_periph *periph, union ccb *ccb) SF_RETRY_UA, softc->device_stats); + cam_periph_unlock(periph); cam_periph_unmapmem(ccb, &mapinfo); + cam_periph_lock(periph); return (error); } From owner-svn-src-all@freebsd.org Thu May 9 04:16:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60D04159CB78; Thu, 9 May 2019 04:16:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0636E755DF; Thu, 9 May 2019 04:16:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C97F7FE47; Thu, 9 May 2019 04:16:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x494GVcb015616; Thu, 9 May 2019 04:16:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x494GVtY015615; Thu, 9 May 2019 04:16:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905090416.x494GVtY015615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 9 May 2019 04:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347380 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 347380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0636E755DF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 04:16:32 -0000 Author: mav Date: Thu May 9 04:16:31 2019 New Revision: 347380 URL: https://svnweb.freebsd.org/changeset/base/347380 Log: MFC r347198: Drop periph lock around cam_periph_unmapmem(). Since r345656 it may call copyout(), that may sleep. Modified: stable/11/sys/cam/scsi/scsi_pass.c stable/11/sys/cam/scsi/scsi_sg.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_pass.c Thu May 9 04:16:06 2019 (r347379) +++ stable/11/sys/cam/scsi/scsi_pass.c Thu May 9 04:16:31 2019 (r347380) @@ -2262,7 +2262,9 @@ passsendccb(struct cam_periph *periph, union ccb *ccb, /* sense_flags */ SF_RETRY_UA | SF_NO_PRINT, softc->device_stats); + cam_periph_unlock(periph); cam_periph_unmapmem(ccb, &mapinfo); + cam_periph_lock(periph); ccb->ccb_h.cbfcnp = NULL; ccb->ccb_h.periph_priv = inccb->ccb_h.periph_priv; Modified: stable/11/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_sg.c Thu May 9 04:16:06 2019 (r347379) +++ stable/11/sys/cam/scsi/scsi_sg.c Thu May 9 04:16:31 2019 (r347380) @@ -916,7 +916,9 @@ sgsendccb(struct cam_periph *periph, union ccb *ccb) SF_RETRY_UA, softc->device_stats); + cam_periph_unlock(periph); cam_periph_unmapmem(ccb, &mapinfo); + cam_periph_lock(periph); return (error); } From owner-svn-src-all@freebsd.org Thu May 9 07:11:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14CC6159F6EC; Thu, 9 May 2019 07:11:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A922081930; Thu, 9 May 2019 07:11:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 845D919B6C; Thu, 9 May 2019 07:11:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x497B9Cc005307; Thu, 9 May 2019 07:11:09 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x497B8DY004889; Thu, 9 May 2019 07:11:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905090711.x497B8DY004889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 9 May 2019 07:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347381 - head/sys/netinet/cc X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/cc X-SVN-Commit-Revision: 347381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A922081930 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 07:11:10 -0000 Author: tuexen Date: Thu May 9 07:11:08 2019 New Revision: 347381 URL: https://svnweb.freebsd.org/changeset/base/347381 Log: Prevent cwnd to collapse down to 1 MSS after exiting recovery. This is descrined in RFC 6582, which updates RFC 3782. Submitted by: Richard Scheffenegger Reviewed by: lstewart@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D17614 Modified: head/sys/netinet/cc/cc_cubic.c head/sys/netinet/cc/cc_htcp.c head/sys/netinet/cc/cc_newreno.c Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Thu May 9 04:16:31 2019 (r347380) +++ head/sys/netinet/cc/cc_cubic.c Thu May 9 07:11:08 2019 (r347381) @@ -324,7 +324,12 @@ cubic_post_recovery(struct cc_var *ccv) pipe = CCV(ccv, snd_max) - ccv->curack; if (pipe < CCV(ccv, snd_ssthresh)) - CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg); + /* + * Ensure that cwnd does not collapse to 1 MSS under + * adverse conditions. Implements RFC6582 + */ + CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) + + CCV(ccv, t_maxseg); else /* Update cwnd based on beta and adjusted max_cwnd. */ CCV(ccv, snd_cwnd) = max(1, ((CUBIC_BETA * Modified: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- head/sys/netinet/cc/cc_htcp.c Thu May 9 04:16:31 2019 (r347380) +++ head/sys/netinet/cc/cc_htcp.c Thu May 9 07:11:08 2019 (r347381) @@ -366,7 +366,12 @@ htcp_post_recovery(struct cc_var *ccv) pipe = CCV(ccv, snd_max) - ccv->curack; if (pipe < CCV(ccv, snd_ssthresh)) - CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg); + /* + * Ensure that cwnd down not collape to 1 MSS under + * adverse conditions. Implements RFC6582 + */ + CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) + + CCV(ccv, t_maxseg); else CCV(ccv, snd_cwnd) = max(1, ((htcp_data->beta * htcp_data->prev_cwnd / CCV(ccv, t_maxseg)) Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Thu May 9 04:16:31 2019 (r347380) +++ head/sys/netinet/cc/cc_newreno.c Thu May 9 07:11:08 2019 (r347381) @@ -295,7 +295,12 @@ newreno_post_recovery(struct cc_var *ccv) pipe = CCV(ccv, snd_max) - ccv->curack; if (pipe < CCV(ccv, snd_ssthresh)) - CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg); + /* + * Ensure that cwnd does not collapse to 1 MSS under + * adverse conditons. Implements RFC6582 + */ + CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) + + CCV(ccv, t_maxseg); else CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); } From owner-svn-src-all@freebsd.org Thu May 9 07:34:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F29F159FBCC; Thu, 9 May 2019 07:34:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6B2382589; Thu, 9 May 2019 07:34:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E0D919F2E; Thu, 9 May 2019 07:34:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x497YG7i020375; Thu, 9 May 2019 07:34:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x497YGWi020373; Thu, 9 May 2019 07:34:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905090734.x497YGWi020373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 9 May 2019 07:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347382 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 347382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C6B2382589 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 07:34:17 -0000 Author: tuexen Date: Thu May 9 07:34:15 2019 New Revision: 347382 URL: https://svnweb.freebsd.org/changeset/base/347382 Log: Receiver side DSACK implemenation. This adds initial support for RFC 2883. Submitted by: Richard Scheffenegger Reviewed by: rrs@ Differential Revision: https://reviews.freebsd.org/D19334 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_sack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu May 9 07:11:08 2019 (r347381) +++ head/sys/netinet/tcp_input.c Thu May 9 07:34:15 2019 (r347382) @@ -2258,6 +2258,17 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru TCPSTAT_INC(tcps_rcvpartduppack); TCPSTAT_ADD(tcps_rcvpartdupbyte, todrop); } + /* + * DSACK - add SACK block for dropped range + */ + if (tp->t_flags & TF_SACK_PERMIT) { + tcp_update_sack_list(tp, th->th_seq, th->th_seq+tlen); + /* + * ACK now, as the next in-sequence segment + * will clear the DSACK block again + */ + tp->t_flags |= TF_ACKNOW; + } drop_hdrlen += todrop; /* drop from the top afterwards */ th->th_seq += todrop; tlen -= todrop; @@ -2986,6 +2997,8 @@ dodata: /* XXX */ if ((tlen || (thflags & TH_FIN) || tfo_syn) && TCPS_HAVERCVDFIN(tp->t_state) == 0) { tcp_seq save_start = th->th_seq; + tcp_seq save_rnxt = tp->rcv_nxt; + int save_tlen = tlen; m_adj(m, drop_hdrlen); /* delayed header drop */ /* * Insert segment which includes th into TCP reassembly queue @@ -3025,11 +3038,28 @@ dodata: /* XXX */ * m_adj() doesn't actually frees any mbufs * when trimming from the head. */ - thflags = tcp_reass(tp, th, &save_start, &tlen, m); + tcp_seq temp = save_start; + thflags = tcp_reass(tp, th, &temp, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if (tlen > 0 && (tp->t_flags & TF_SACK_PERMIT)) - tcp_update_sack_list(tp, save_start, save_start + tlen); + if (tp->t_flags & TF_SACK_PERMIT) { + if (((tlen == 0) && (save_tlen > 0) && + (SEQ_LT(save_start, save_rnxt)))) { + // DSACK actually handled in the fastpath above + tcp_update_sack_list(tp, save_start, save_start + save_tlen); + } else + if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { + // cleaning sackblks by using zero length update + tcp_update_sack_list(tp, save_start, save_start); + } else + if ((tlen > 0) && (tlen >= save_tlen)) { + // update of sackblks + tcp_update_sack_list(tp, save_start, save_start + save_tlen); + } else + if (tlen > 0) { + tcp_update_sack_list(tp, save_start, save_start+tlen); + } + } #if 0 /* * Note the amount of data that peer has sent into Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Thu May 9 07:11:08 2019 (r347381) +++ head/sys/netinet/tcp_sack.c Thu May 9 07:34:15 2019 (r347382) @@ -168,7 +168,7 @@ tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_sta INP_WLOCK_ASSERT(tp->t_inpcb); /* Check arguments. */ - KASSERT(SEQ_LT(rcv_start, rcv_end), ("rcv_start < rcv_end")); + KASSERT(SEQ_LEQ(rcv_start, rcv_end), ("rcv_start <= rcv_end")); /* SACK block for the received segment. */ head_blk.start = rcv_start; @@ -193,12 +193,54 @@ tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_sta * Merge this SACK block into head_blk. This SACK * block itself will be discarded. */ - if (SEQ_GT(head_blk.start, start)) + /* + * |-| + * |---| merge + * + * |-| + * |---| merge + * + * |-----| + * |-| DSACK smaller + * + * |-| + * |-----| DSACK smaller + */ + if (head_blk.start == end) head_blk.start = start; - if (SEQ_LT(head_blk.end, end)) + else if (head_blk.end == start) head_blk.end = end; + else { + if (SEQ_LT(head_blk.start, start)) { + tcp_seq temp = start; + start = head_blk.start; + head_blk.start = temp; + } + if (SEQ_GT(head_blk.end, end)) { + tcp_seq temp = end; + end = head_blk.end; + head_blk.end = temp; + } + if ((head_blk.start != start) || + (head_blk.end != end)) { + if ((num_saved >= 1) && + SEQ_GEQ(saved_blks[num_saved-1].start, start) && + SEQ_LEQ(saved_blks[num_saved-1].end, end)) + num_saved--; + saved_blks[num_saved].start = start; + saved_blks[num_saved].end = end; + num_saved++; + } + } } else { /* + * This block supercedes the prior block + */ + if ((num_saved >= 1) && + SEQ_GEQ(saved_blks[num_saved-1].start, start) && + SEQ_LEQ(saved_blks[num_saved-1].end, end)) + num_saved--; + /* * Save this SACK block. */ saved_blks[num_saved].start = start; @@ -211,7 +253,7 @@ tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_sta * Update SACK list in tp->sackblks[]. */ num_head = 0; - if (SEQ_GT(head_blk.start, tp->rcv_nxt)) { + if (SEQ_LT(rcv_start, rcv_end)) { /* * The received data segment is an out-of-order segment. Put * head_blk at the top of SACK list. From owner-svn-src-all@freebsd.org Thu May 9 07:57:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94ECF15A0520; Thu, 9 May 2019 07:57:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B604831D8; Thu, 9 May 2019 07:57:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12D321A2A7; Thu, 9 May 2019 07:57:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x497vXgH030655; Thu, 9 May 2019 07:57:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x497vXBO030654; Thu, 9 May 2019 07:57:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905090757.x497vXBO030654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 9 May 2019 07:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347383 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 347383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B604831D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 07:57:34 -0000 Author: ae Date: Thu May 9 07:57:33 2019 New Revision: 347383 URL: https://svnweb.freebsd.org/changeset/base/347383 Log: In mld_v2_cancel_link_timers() check number of references and disconnect inm before releasing the last reference. This fixes possible panics and assertion. PR: 237329 Reviewed by: mmacy MFC after: 2 weeks Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu May 9 07:34:15 2019 (r347382) +++ head/sys/netinet6/mld6.c Thu May 9 07:57:33 2019 (r347383) @@ -1708,6 +1708,8 @@ mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) * version, we need to release the final * reference held for issuing the INCLUDE {}. */ + if (inm->in6m_refcount == 1) + in6m_disconnect_locked(&inmh, inm); in6m_rele_locked(&inmh, inm); /* FALLTHROUGH */ case MLD_G_QUERY_PENDING_MEMBER: From owner-svn-src-all@freebsd.org Thu May 9 08:35:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99A0015A1A7D; Thu, 9 May 2019 08:35:51 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FCD884A66; Thu, 9 May 2019 08:35:51 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 172711A977; Thu, 9 May 2019 08:35:51 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x498Zo4Y051653; Thu, 9 May 2019 08:35:50 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x498ZoJ6051650; Thu, 9 May 2019 08:35:50 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201905090835.x498ZoJ6051650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 9 May 2019 08:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347384 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: smh X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 347384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3FCD884A66 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 08:35:51 -0000 Author: smh Date: Thu May 9 08:35:50 2019 New Revision: 347384 URL: https://svnweb.freebsd.org/changeset/base/347384 Log: MFC r346594: Add ATA power mode support to camcontrol Sponsored by: Multiplay Modified: stable/12/sbin/camcontrol/camcontrol.8 stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.8 Thu May 9 07:57:33 2019 (r347383) +++ stable/12/sbin/camcontrol/camcontrol.8 Thu May 9 08:35:50 2019 (r347384) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2017 +.Dd May 9, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -242,6 +242,10 @@ .Op device id .Op generic args .Nm +.Ic powermode +.Op device id +.Op generic args +.Nm .Ic apm .Op device id .Op generic args @@ -1382,6 +1386,8 @@ Value 0 disables timer. Put ATA device into SLEEP state. Note that the only way get device out of this state may be reset. +.It Ic powermode +Report ATA device power mode. .It Ic apm It optional parameter .Pq Fl l Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu May 9 07:57:33 2019 (r347383) +++ stable/12/sbin/camcontrol/camcontrol.c Thu May 9 08:35:50 2019 (r347384) @@ -109,7 +109,8 @@ typedef enum { CAM_CMD_ZONE = 0x00000026, CAM_CMD_EPC = 0x00000027, CAM_CMD_TIMESTAMP = 0x00000028, - CAM_CMD_MMCSD_CMD = 0x00000029 + CAM_CMD_MMCSD_CMD = 0x00000029, + CAM_CMD_POWER_MODE = 0x0000002a, } cam_cmdmask; typedef enum { @@ -236,6 +237,7 @@ static struct camcontrol_opts option_table[] = { {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, + {"powermode", CAM_CMD_POWER_MODE, CAM_ARG_NONE, ""}, {"apm", CAM_CMD_APM, CAM_ARG_NONE, "l:"}, {"aam", CAM_CMD_AAM, CAM_ARG_NONE, "l:"}, {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:qsy"}, @@ -8876,6 +8878,61 @@ bailout: } static int +atapm_proc_resp(struct cam_device *device, union ccb *ccb) +{ + struct ata_res *res; + + res = &ccb->ataio.res; + if (res->status & ATA_STATUS_ERROR) { + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + printf("error = 0x%02x, sector_count = 0x%04x, " + "device = 0x%02x, status = 0x%02x\n", + res->error, res->sector_count, + res->device, res->status); + } + + return (1); + } + + if (arglist & CAM_ARG_VERBOSE) { + fprintf(stdout, "%s%d: Raw native check power data:\n", + device->device_name, device->dev_unit_num); + /* res is 4 byte aligned */ + dump_data((uint16_t*)(uintptr_t)res, sizeof(struct ata_res)); + + printf("error = 0x%02x, sector_count = 0x%04x, device = 0x%02x, " + "status = 0x%02x\n", res->error, res->sector_count, + res->device, res->status); + } + + printf("%s%d: ", device->device_name, device->dev_unit_num); + switch (res->sector_count) { + case 0x00: + printf("Standby mode\n"); + break; + case 0x40: + printf("NV Cache Power Mode and the spindle is spun down or spinning down\n"); + break; + case 0x41: + printf("NV Cache Power Mode and the spindle is spun up or spinning up\n"); + break; + case 0x80: + printf("Idle mode\n"); + break; + case 0xff: + printf("Active or Idle mode\n"); + break; + default: + printf("Unknown mode 0x%02x\n", res->sector_count); + break; + } + + return (0); +} + +static int atapm(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout) { @@ -8883,6 +8940,7 @@ atapm(struct cam_device *device, int argc, char **argv int retval = 0; int t = -1; int c; + u_int8_t ata_flags = 0; u_char cmd, sc; ccb = cam_getccb(device); @@ -8911,6 +8969,10 @@ atapm(struct cam_device *device, int argc, char **argv cmd = ATA_STANDBY_IMMEDIATE; else cmd = ATA_STANDBY_CMD; + } else if (strcmp(argv[1], "powermode") == 0) { + cmd = ATA_CHECK_POWER_MODE; + ata_flags = AP_FLAG_CHK_COND; + t = -1; } else { cmd = ATA_SLEEP; t = -1; @@ -8928,11 +8990,12 @@ atapm(struct cam_device *device, int argc, char **argv else sc = 253; - retval = ata_do_28bit_cmd(device, + retval = ata_do_cmd(device, ccb, /*retries*/retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/AP_PROTO_NON_DATA, + /*ata_flags*/ata_flags, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/0, @@ -8944,7 +9007,11 @@ atapm(struct cam_device *device, int argc, char **argv /*quiet*/1); cam_freeccb(ccb); - return (retval); + + if (retval || cmd != ATA_CHECK_POWER_MODE) + return (retval); + + return (atapm_proc_resp(device, ccb)); } static int @@ -9557,6 +9624,7 @@ usage(int printlong) " camcontrol idle [dev_id][generic args][-t time]\n" " camcontrol standby [dev_id][generic args][-t time]\n" " camcontrol sleep [dev_id][generic args]\n" +" camcontrol powermode [dev_id][generic args]\n" " camcontrol apm [dev_id][generic args][-l level]\n" " camcontrol aam [dev_id][generic args][-l level]\n" " camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-q]\n" @@ -9620,6 +9688,7 @@ usage(int printlong) "idle send the ATA IDLE command to the named device\n" "standby send the ATA STANDBY command to the named device\n" "sleep send the ATA SLEEP command to the named device\n" +"powermode send the ATA CHECK POWER MODE command to the named device\n" "fwdownload program firmware of the named device with the given image\n" "security report or send ATA security commands to the named device\n" "persist send the SCSI PERSISTENT RESERVE IN or OUT commands\n" @@ -10190,6 +10259,7 @@ main(int argc, char **argv) case CAM_CMD_IDLE: case CAM_CMD_STANDBY: case CAM_CMD_SLEEP: + case CAM_CMD_POWER_MODE: error = atapm(cam_dev, argc, argv, combinedopt, retry_count, timeout); break; From owner-svn-src-all@freebsd.org Thu May 9 09:21:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C61215A313A; Thu, 9 May 2019 09:21:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CF3B86249; Thu, 9 May 2019 09:21:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x499LepQ084980 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 9 May 2019 12:21:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x499LepQ084980 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x499LerO084978; Thu, 9 May 2019 12:21:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 9 May 2019 12:21:40 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r347374 - stable/11/sys/amd64/vmm/io Message-ID: <20190509092140.GD2748@kib.kiev.ua> References: <201905082324.x48NOlcJ062685@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905082324.x48NOlcJ062685@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 09:21:49 -0000 On Wed, May 08, 2019 at 11:24:47PM +0000, John Baldwin wrote: > Author: jhb > Date: Wed May 8 23:24:47 2019 > New Revision: 347374 > URL: https://svnweb.freebsd.org/changeset/base/347374 > > Log: > MFC 333174: Use PCI power-mgmt to reset a device if FLR fails. > > A large number of devices don't support PCIe FLR, in particular > graphics adapters. Use PCI power management to perform the > reset if FLR fails or isn't available, by cycling the device > through the D3 state. > > This has been tested by a number of users with Nvidia and AMD GPUs. Now stable/11 ppt_pci_reset() can be made identical to the HEAD version, I merged all reset changes some time ago. > > Modified: > stable/11/sys/amd64/vmm/io/ppt.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/sys/amd64/vmm/io/ppt.c > ============================================================================== > --- stable/11/sys/amd64/vmm/io/ppt.c Wed May 8 23:13:27 2019 (r347373) > +++ stable/11/sys/amd64/vmm/io/ppt.c Wed May 8 23:24:47 2019 (r347374) > @@ -351,6 +351,30 @@ ppt_is_mmio(struct vm *vm, vm_paddr_t gpa) > return (FALSE); > } > > +static void > +ppt_pci_reset(device_t dev) > +{ > + int ps; > + > + if (pcie_flr(dev, > + max(pcie_get_max_completion_timeout(dev) / 1000, 10), > + true)) > + return; > + > + /* > + * If FLR fails, attempt a power-management reset by cycling > + * the device in/out of D3 state. > + * PCI spec says we can only go into D3 state from D0 state. > + * Transition from D[12] into D0 before going to D3 state. > + */ > + ps = pci_get_powerstate(dev); > + if (ps != PCI_POWERSTATE_D0 && ps != PCI_POWERSTATE_D3) > + pci_set_powerstate(dev, PCI_POWERSTATE_D0); > + if (pci_get_powerstate(dev) != PCI_POWERSTATE_D3) > + pci_set_powerstate(dev, PCI_POWERSTATE_D3); > + pci_set_powerstate(dev, ps); > +} > + > int > ppt_assign_device(struct vm *vm, int bus, int slot, int func) > { > @@ -366,9 +390,7 @@ ppt_assign_device(struct vm *vm, int bus, int slot, in > return (EBUSY); > > pci_save_state(ppt->dev); > - pcie_flr(ppt->dev, > - max(pcie_get_max_completion_timeout(ppt->dev) / 1000, 10), > - true); > + ppt_pci_reset(ppt->dev); > pci_restore_state(ppt->dev); > ppt->vm = vm; > iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); > @@ -391,9 +413,7 @@ ppt_unassign_device(struct vm *vm, int bus, int slot, > return (EBUSY); > > pci_save_state(ppt->dev); > - pcie_flr(ppt->dev, > - max(pcie_get_max_completion_timeout(ppt->dev) / 1000, 10), > - true); > + ppt_pci_reset(ppt->dev); > pci_restore_state(ppt->dev); > ppt_unmap_mmio(vm, ppt); > ppt_teardown_msi(ppt); From owner-svn-src-all@freebsd.org Thu May 9 09:45:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CED215A3996; Thu, 9 May 2019 09:45:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7E7086E88; Thu, 9 May 2019 09:45:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 945DD1B522; Thu, 9 May 2019 09:45:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x499jJCl088634; Thu, 9 May 2019 09:45:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x499jJoV088633; Thu, 9 May 2019 09:45:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905090945.x499jJoV088633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 May 2019 09:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347385 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 347385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7E7086E88 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 09:45:20 -0000 Author: hselasky Date: Thu May 9 09:45:19 2019 New Revision: 347385 URL: https://svnweb.freebsd.org/changeset/base/347385 Log: Fix regression issue after r346645 in the LinuxKPI. Make sure LinuxKPI PCI devices get a default BUSDMA tag. Found by: Thomas Laus 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 Thu May 9 08:35:50 2019 (r347384) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu May 9 09:45:19 2019 (r347385) @@ -89,6 +89,7 @@ static int linux_pdev_dma_init(struct pci_dev *pdev) { struct linux_dma_priv *priv; + int error; priv = malloc(sizeof(*priv), M_DEVBUF, M_WAITOK | M_ZERO); pdev->dev.dma_priv = priv; @@ -97,7 +98,14 @@ linux_pdev_dma_init(struct pci_dev *pdev) pctrie_init(&priv->ptree); - return (0); + /* create a default DMA tag */ + error = linux_dma_tag_init(&pdev->dev, DMA_BIT_MASK(64)); + if (error) { + mtx_destroy(&priv->lock); + free(priv, M_DEVBUF); + pdev->dev.dma_priv = NULL; + } + return (error); } static int @@ -241,7 +249,7 @@ linux_pci_attach(device_t dev) pdev->irq = pdev->dev.irq; error = linux_pdev_dma_init(pdev); if (error) - goto out; + goto out_dma_init; if (pdev->bus == NULL) { pbus = malloc(sizeof(*pbus), M_DEVBUF, M_WAITOK | M_ZERO); @@ -255,15 +263,18 @@ linux_pci_attach(device_t dev) spin_unlock(&pci_lock); error = pdrv->probe(pdev, id); -out: - if (error) { - spin_lock(&pci_lock); - list_del(&pdev->links); - spin_unlock(&pci_lock); - put_device(&pdev->dev); - error = -error; - } - return (error); + if (error) + goto out_probe; + return (0); + +out_probe: + linux_pdev_dma_uninit(pdev); +out_dma_init: + spin_lock(&pci_lock); + list_del(&pdev->links); + spin_unlock(&pci_lock); + put_device(&pdev->dev); + return (-error); } static int From owner-svn-src-all@freebsd.org Thu May 9 09:49:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC8E415A3B69; Thu, 9 May 2019 09:49:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60C4A870B4; Thu, 9 May 2019 09:49:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BB6F1B529; Thu, 9 May 2019 09:49:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x499n8Mv088853; Thu, 9 May 2019 09:49:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x499n8J7088852; Thu, 9 May 2019 09:49:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905090949.x499n8J7088852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 9 May 2019 09:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347386 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 347386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 60C4A870B4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 09:49:09 -0000 Author: kib Date: Thu May 9 09:49:07 2019 New Revision: 347386 URL: https://svnweb.freebsd.org/changeset/base/347386 Log: MFC r347019: Cleanup for rtld_malloc.c. PR: 237577 Modified: stable/12/libexec/rtld-elf/rtld_malloc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld_malloc.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld_malloc.c Thu May 9 09:45:19 2019 (r347385) +++ stable/12/libexec/rtld-elf/rtld_malloc.c Thu May 9 09:49:07 2019 (r347386) @@ -45,17 +45,14 @@ static char *rcsid = "$FreeBSD$"; * This is designed for use in a virtual memory environment. */ -#include +#include #include +#include #include #include #include -#include -#include #include #include -#include -#include #include "rtld.h" #include "rtld_printf.h" #include "paths.h" @@ -81,10 +78,6 @@ union overhead { struct { u_char ovu_magic; /* magic number */ u_char ovu_index; /* bucket # */ -#ifdef RCHECK - u_short ovu_rmagic; /* range magic number */ - u_int ovu_size; /* actual block size */ -#endif } ovu; #define ov_magic ovu.ovu_magic #define ov_index ovu.ovu_index @@ -100,12 +93,6 @@ static int findbucket(union overhead *freep, int srchl #define MAGIC 0xef /* magic # on accounting info */ #define RMAGIC 0x5555 /* magic # on range info */ -#ifdef RCHECK -#define RSLOP sizeof (u_short) -#else -#define RSLOP 0 -#endif - /* * nextf[i] is the pointer to the next free block of size 2^(i+3). The * smallest allocatable block is 8 bytes. The overhead information @@ -117,34 +104,7 @@ static union overhead *nextf[NBUCKETS]; static int pagesz; /* page size */ static int pagebucket; /* page size bucket */ -#ifdef MSTATS /* - * nmalloc[i] is the difference between the number of mallocs and frees - * for a given block size. - */ -static u_int nmalloc[NBUCKETS]; -#include -#endif - -#if defined(MALLOC_DEBUG) || defined(RCHECK) -#define ASSERT(p) if (!(p)) botch("p") -#include -static void -botch(s) - char *s; -{ - fprintf(stderr, "\r\nassertion botched: %s\r\n", s); - (void) fflush(stderr); /* just in case user buffered it */ - abort(); -} -#else -#define ASSERT(p) -#endif - -/* Debugging stuff */ -#define TRACE() rtld_printf("TRACE %s:%d\n", __FILE__, __LINE__) - -/* * The array of supported page sizes is provided by the user, i.e., the * program that calls this storage allocator. That program must initialize * the array before making its first call to allocate storage. The array @@ -188,15 +148,10 @@ __crt_malloc(size_t nbytes) * stored in hash buckets which satisfies request. * Account for space used per block for accounting. */ - if (nbytes <= (unsigned long)(n = pagesz - sizeof (*op) - RSLOP)) { -#ifndef RCHECK + if (nbytes <= (unsigned long)(n = pagesz - sizeof(*op))) { amt = 8; /* size of first bucket */ bucket = 0; -#else - amt = 16; /* size of first bucket */ - bucket = 1; -#endif - n = -(sizeof (*op) + RSLOP); + n = -sizeof(*op); } else { amt = pagesz; bucket = pagebucket; @@ -220,18 +175,6 @@ __crt_malloc(size_t nbytes) nextf[bucket] = op->ov_next; op->ov_magic = MAGIC; op->ov_index = bucket; -#ifdef MSTATS - nmalloc[bucket]++; -#endif -#ifdef RCHECK - /* - * Record allocated size of block and - * bound space with magic numbers. - */ - op->ov_size = roundup2(nbytes, RSLOP); - op->ov_rmagic = RMAGIC; - *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif return ((char *)(op + 1)); } @@ -266,13 +209,9 @@ morecore(int bucket) * sbrk_size <= 0 only for big, FLUFFY, requests (about * 2^30 bytes on a VAX, I think) or for a negative arg. */ - sz = 1 << (bucket + 3); -#ifdef MALLOC_DEBUG - ASSERT(sz > 0); -#else - if (sz <= 0) + if ((unsigned)bucket >= NBBY * sizeof(int) - 4) return; -#endif + sz = 1 << (bucket + 3); if (sz < pagesz) { amt = pagesz; nblks = amt / sz; @@ -306,23 +245,11 @@ __crt_free(void *cp) if (cp == NULL) return; op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); -#ifdef MALLOC_DEBUG - ASSERT(op->ov_magic == MAGIC); /* make sure it was in use */ -#else if (op->ov_magic != MAGIC) return; /* sanity */ -#endif -#ifdef RCHECK - ASSERT(op->ov_rmagic == RMAGIC); - ASSERT(*(u_short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC); -#endif size = op->ov_index; - ASSERT(size < NBUCKETS); op->ov_next = nextf[size]; /* also clobbers ov_magic */ nextf[size] = op; -#ifdef MSTATS - nmalloc[size]--; -#endif } /* @@ -374,26 +301,21 @@ __crt_realloc(void *cp, size_t nbytes) } onb = 1 << (i + 3); if (onb < (u_int)pagesz) - onb -= sizeof (*op) + RSLOP; + onb -= sizeof(*op); else - onb += pagesz - sizeof (*op) - RSLOP; + onb += pagesz - sizeof(*op); /* avoid the copy if same size block */ if (was_alloced) { if (i) { i = 1 << (i + 2); if (i < pagesz) - i -= sizeof (*op) + RSLOP; + i -= sizeof(*op); else - i += pagesz - sizeof (*op) - RSLOP; + i += pagesz - sizeof(*op); } - if (nbytes <= onb && nbytes > (size_t)i) { -#ifdef RCHECK - op->ov_size = roundup2(nbytes, RSLOP); - *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif - return(cp); - } else - __crt_free(cp); + if (nbytes <= onb && nbytes > (size_t)i) + return (cp); + __crt_free(cp); } if ((res = __crt_malloc(nbytes)) == NULL) return (NULL); @@ -423,39 +345,6 @@ findbucket(union overhead *freep, int srchlen) } return (-1); } - -#ifdef MSTATS -/* - * mstats - print out statistics about malloc - * - * Prints two lines of numbers, one showing the length of the free list - * for each size category, the second showing the number of mallocs - - * frees for each size category. - */ -mstats(char * s) -{ - int i, j; - union overhead *p; - int totfree = 0, - totused = 0; - - fprintf(stderr, "Memory allocation statistics %s\nfree:\t", s); - for (i = 0; i < NBUCKETS; i++) { - for (j = 0, p = nextf[i]; p; p = p->ov_next, j++) - ; - fprintf(stderr, " %d", j); - totfree += j * (1 << (i + 3)); - } - fprintf(stderr, "\nused:\t"); - for (i = 0; i < NBUCKETS; i++) { - fprintf(stderr, " %d", nmalloc[i]); - totused += nmalloc[i] * (1 << (i + 3)); - } - fprintf(stderr, "\n\tTotal in use: %d, total free: %d\n", - totused, totfree); -} -#endif - static int morepages(int n) From owner-svn-src-all@freebsd.org Thu May 9 10:23:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1816215A487F; Thu, 9 May 2019 10:23:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B05818851C; Thu, 9 May 2019 10:23:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B13D1BBBC; Thu, 9 May 2019 10:23:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49ANgBQ009963; Thu, 9 May 2019 10:23:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49ANgDw009962; Thu, 9 May 2019 10:23:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905091023.x49ANgDw009962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 May 2019 10:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347387 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 347387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B05818851C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 10:23:43 -0000 Author: hselasky Date: Thu May 9 10:23:42 2019 New Revision: 347387 URL: https://svnweb.freebsd.org/changeset/base/347387 Log: Fix memory leak of PCI BUS structure in the LinuxKPI. MFC after: 1 week 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 Thu May 9 09:49:07 2019 (r347386) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu May 9 10:23:42 2019 (r347387) @@ -251,12 +251,10 @@ linux_pci_attach(device_t dev) if (error) goto out_dma_init; - if (pdev->bus == NULL) { - pbus = malloc(sizeof(*pbus), M_DEVBUF, M_WAITOK | M_ZERO); - pbus->self = pdev; - pbus->number = pci_get_bus(dev); - pdev->bus = pbus; - } + pbus = malloc(sizeof(*pbus), M_DEVBUF, M_WAITOK | M_ZERO); + pbus->self = pdev; + pbus->number = pci_get_bus(dev); + pdev->bus = pbus; spin_lock(&pci_lock); list_add(&pdev->links, &pci_devices); @@ -268,6 +266,7 @@ linux_pci_attach(device_t dev) return (0); out_probe: + free(pdev->bus, M_DEVBUF); linux_pdev_dma_uninit(pdev); out_dma_init: spin_lock(&pci_lock); @@ -286,6 +285,8 @@ linux_pci_detach(device_t dev) pdev = device_get_softc(dev); pdev->pdrv->remove(pdev); + + free(pdev->bus, M_DEVBUF); linux_pdev_dma_uninit(pdev); spin_lock(&pci_lock); From owner-svn-src-all@freebsd.org Thu May 9 10:37:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6335815A4BC7; Thu, 9 May 2019 10:37:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 075C288A08; Thu, 9 May 2019 10:37:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD1F11BD5E; Thu, 9 May 2019 10:37:57 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49Abv4s015628; Thu, 9 May 2019 10:37:57 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49AbvXW015627; Thu, 9 May 2019 10:37:57 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905091037.x49AbvXW015627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 9 May 2019 10:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347388 - in head/stand: efi/libefi i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand: efi/libefi i386/libi386 X-SVN-Commit-Revision: 347388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 075C288A08 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 10:37:58 -0000 Author: tsoome Date: Thu May 9 10:37:57 2019 New Revision: 347388 URL: https://svnweb.freebsd.org/changeset/base/347388 Log: loader: implement proper 8 char tab stops The current console code is printing out 8 spaces for tab, calculate the amount of spaces based on tab stops. Modified: head/stand/efi/libefi/efi_console.c head/stand/i386/libi386/vidconsole.c Modified: head/stand/efi/libefi/efi_console.c ============================================================================== --- head/stand/efi/libefi/efi_console.c Thu May 9 10:23:42 2019 (r347387) +++ head/stand/efi/libefi/efi_console.c Thu May 9 10:37:57 2019 (r347388) @@ -135,11 +135,13 @@ efi_cons_rawputchar(int c) UINTN x, y; conout->QueryMode(conout, conout->Mode->Mode, &x, &y); - if (c == '\t') - /* XXX lame tab expansion */ - for (i = 0; i < 8; i++) + if (c == '\t') { + int n; + + n = 8 - ((curx + 8) % 8); + for (i = 0; i < n; i++) efi_cons_rawputchar(' '); - else { + } else { #ifndef TERM_EMU if (c == '\n') efi_cons_efiputchar('\r'); Modified: head/stand/i386/libi386/vidconsole.c ============================================================================== --- head/stand/i386/libi386/vidconsole.c Thu May 9 10:23:42 2019 (r347387) +++ head/stand/i386/libi386/vidconsole.c Thu May 9 10:37:57 2019 (r347388) @@ -136,11 +136,13 @@ vidc_rawputchar(int c) { int i; - if (c == '\t') - /* lame tab expansion */ - for (i = 0; i < 8; i++) + if (c == '\t') { + int n; + + n = 8 - ((curx + 8) % 8); + for (i = 0; i < n; i++) vidc_rawputchar(' '); - else { + } else { #ifndef TERM_EMU vidc_biosputchar(c); #else From owner-svn-src-all@freebsd.org Thu May 9 11:04:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15BC915A5367; Thu, 9 May 2019 11:04:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE1E889646; Thu, 9 May 2019 11:04:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 712861C26E; Thu, 9 May 2019 11:04:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49B4AZv030951; Thu, 9 May 2019 11:04:10 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49B4ANp030950; Thu, 9 May 2019 11:04:10 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905091104.x49B4ANp030950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 9 May 2019 11:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347389 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 347389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE1E889646 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 11:04:11 -0000 Author: tsoome Date: Thu May 9 11:04:10 2019 New Revision: 347389 URL: https://svnweb.freebsd.org/changeset/base/347389 Log: loader: ptable_print() needs two tabs sometimes Since the partition/slice names do vary in length, check the length of the fixed part of the line against 3 * 8, if the lenth is less than 3 tab stops, print out extra tab. use snprintf() instead of sprintf. Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Thu May 9 10:37:57 2019 (r347388) +++ head/stand/common/disk.c Thu May 9 11:04:10 2019 (r347389) @@ -75,7 +75,7 @@ display_size(uint64_t size, u_int sectorsize) size /= 1024; unit = 'M'; } - sprintf(buf, "%4ld%cB", (long)size, unit); + snprintf(buf, sizeof(buf), "%4ld%cB", (long)size, unit); return (buf); } @@ -118,11 +118,24 @@ ptable_print(void *arg, const char *pname, const struc od = (struct open_disk *)pa->dev->dd.d_opendata; sectsize = od->sectorsize; partsize = part->end - part->start + 1; - sprintf(line, " %s%s: %s\t%s\n", pa->prefix, pname, - parttype2str(part->type), - pa->verbose ? display_size(partsize, sectsize) : ""); + snprintf(line, sizeof(line), " %s%s: %s", pa->prefix, pname, + parttype2str(part->type)); if (pager_output(line)) - return 1; + return (1); + + if (pa->verbose) { + /* Emit extra tab when the line is shorter than 3 tab stops */ + if (strlen(line) < 24) + (void) pager_output("\t"); + + snprintf(line, sizeof(line), "\t%s", + display_size(partsize, sectsize)); + if (pager_output(line)) + return (1); + } + if (pager_output("\n")) + return (1); + res = 0; if (part->type == PART_FREEBSD) { /* Open slice with BSD label */ @@ -133,7 +146,8 @@ ptable_print(void *arg, const char *pname, const struc if (disk_open(&dev, partsize, sectsize) == 0) { table = ptable_open(&dev, partsize, sectsize, ptblread); if (table != NULL) { - sprintf(line, " %s%s", pa->prefix, pname); + snprintf(line, sizeof(line), " %s%s", + pa->prefix, pname); bsd.dev = pa->dev; bsd.prefix = line; bsd.verbose = pa->verbose; From owner-svn-src-all@freebsd.org Thu May 9 11:34:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9DF615A6410; Thu, 9 May 2019 11:34:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EE118AB78; Thu, 9 May 2019 11:34:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 620AE1C760; Thu, 9 May 2019 11:34:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49BYliS051863; Thu, 9 May 2019 11:34:47 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49BYlDj051862; Thu, 9 May 2019 11:34:47 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201905091134.x49BYlDj051862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 9 May 2019 11:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347390 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8EE118AB78 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 11:34:48 -0000 Author: marius Date: Thu May 9 11:34:46 2019 New Revision: 347390 URL: https://svnweb.freebsd.org/changeset/base/347390 Log: - Merge r338254 from cxgbe(4): Use fcmpset instead of cmpset when appropriate. - Revert r277226 of cxgbe(4), obsolete since r334320. Modified: head/sys/net/mp_ring.c Modified: head/sys/net/mp_ring.c ============================================================================== --- head/sys/net/mp_ring.c Thu May 9 11:04:10 2019 (r347389) +++ head/sys/net/mp_ring.c Thu May 9 11:34:46 2019 (r347390) @@ -36,12 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#if defined(__i386__) -#define atomic_cmpset_acq_64 atomic_cmpset_64 -#define atomic_cmpset_rel_64 atomic_cmpset_64 -#endif - #include union ring_state { @@ -195,11 +189,12 @@ drain_ring_lockless(struct ifmp_ring *r, union ring_st n = r->drain(r, cidx, pidx); if (n == 0) { critical_enter(); + os.state = r->state; do { - os.state = ns.state = r->state; + ns.state = os.state; ns.cidx = cidx; ns.flags = STALLED; - } while (atomic_cmpset_64(&r->state, os.state, + } while (atomic_fcmpset_64(&r->state, &os.state, ns.state) == 0); critical_exit(); if (prev != STALLED) @@ -222,11 +217,13 @@ drain_ring_lockless(struct ifmp_ring *r, union ring_st if (cidx != pidx && pending < 64 && total < budget) continue; critical_enter(); + os.state = r->state; do { - os.state = ns.state = r->state; + ns.state = os.state; ns.cidx = cidx; ns.flags = state_to_flags(ns, total >= budget); - } while (atomic_cmpset_acq_64(&r->state, os.state, ns.state) == 0); + } while (atomic_fcmpset_acq_64(&r->state, &os.state, + ns.state) == 0); critical_exit(); if (ns.flags == ABDICATED) @@ -379,10 +376,8 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i if (abdicate) { if (os.flags == IDLE) ns.flags = ABDICATED; - } - else { + } else ns.flags = BUSY; - } r->state = ns.state; counter_u64_add(r->enqueues, n); @@ -398,7 +393,6 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i mtx_unlock(&r->lock); return (0); } - #else int ifmp_ring_enqueue(struct ifmp_ring *r, void **items, int n, int budget, int abdicate) @@ -414,8 +408,8 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i * Reserve room for the new items. Our reservation, if successful, is * from 'pidx_start' to 'pidx_stop'. */ + os.state = r->state; for (;;) { - os.state = r->state; if (n >= space_available(r, os)) { counter_u64_add(r->drops, n); MPASS(os.flags != IDLE); @@ -426,7 +420,7 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i ns.state = os.state; ns.pidx_head = increment_idx(r, os.pidx_head, n); critical_enter(); - if (atomic_cmpset_64(&r->state, os.state, ns.state)) + if (atomic_fcmpset_64(&r->state, &os.state, ns.state)) break; critical_exit(); cpu_spinwait(); @@ -456,17 +450,16 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i * Update the ring's pidx_tail. The release style atomic guarantees * that the items are visible to any thread that sees the updated pidx. */ + os.state = r->state; do { - os.state = ns.state = r->state; + ns.state = os.state; ns.pidx_tail = pidx_stop; if (abdicate) { if (os.flags == IDLE) ns.flags = ABDICATED; - } - else { + } else ns.flags = BUSY; - } - } while (atomic_cmpset_rel_64(&r->state, os.state, ns.state) == 0); + } while (atomic_fcmpset_rel_64(&r->state, &os.state, ns.state) == 0); critical_exit(); counter_u64_add(r->enqueues, n); From owner-svn-src-all@freebsd.org Thu May 9 12:14:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E2E415A7CB0; Thu, 9 May 2019 12:14:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0316F8C6B0; Thu, 9 May 2019 12:14:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3F371CE0B; Thu, 9 May 2019 12:14:52 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49CEqPs073622; Thu, 9 May 2019 12:14:52 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49CEqIT073620; Thu, 9 May 2019 12:14:52 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905091214.x49CEqIT073620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 9 May 2019 12:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347391 - in head/stand: efi/libefi i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand: efi/libefi i386/libi386 X-SVN-Commit-Revision: 347391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0316F8C6B0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 12:14:53 -0000 Author: tsoome Date: Thu May 9 12:14:52 2019 New Revision: 347391 URL: https://svnweb.freebsd.org/changeset/base/347391 Log: loader: no-TERM_EMU is broken now If TERM_EMU is not defined, we do not have curx variable. Use conout mode for efi and expose get_pos() for i386. Modified: head/stand/efi/libefi/efi_console.c head/stand/i386/libi386/vidconsole.c Modified: head/stand/efi/libefi/efi_console.c ============================================================================== --- head/stand/efi/libefi/efi_console.c Thu May 9 11:34:46 2019 (r347390) +++ head/stand/efi/libefi/efi_console.c Thu May 9 12:14:52 2019 (r347391) @@ -138,7 +138,7 @@ efi_cons_rawputchar(int c) if (c == '\t') { int n; - n = 8 - ((curx + 8) % 8); + n = 8 - ((conout->Mode->CursorColumn + 8) % 8); for (i = 0; i < n; i++) efi_cons_rawputchar(' '); } else { Modified: head/stand/i386/libi386/vidconsole.c ============================================================================== --- head/stand/i386/libi386/vidconsole.c Thu May 9 11:34:46 2019 (r347390) +++ head/stand/i386/libi386/vidconsole.c Thu May 9 12:14:52 2019 (r347391) @@ -49,6 +49,8 @@ static int vidc_ischar(void); static int vidc_started; +void get_pos(int *x, int *y); + #ifdef TERM_EMU #define MAXARGS 8 #define DEFAULT_FGCOLOR 7 @@ -57,7 +59,6 @@ static int vidc_started; void end_term(void); void bail_out(int c); void vidc_term_emu(int c); -void get_pos(int *x, int *y); void curs_move(int *_x, int *_y, int x, int y); void write_char(int c, int fg, int bg); void scroll_up(int rows, int fg, int bg); @@ -138,7 +139,12 @@ vidc_rawputchar(int c) if (c == '\t') { int n; +#ifndef TERM_EMU + int curx, cury; + get_pos(&curx, %cury); +#endif + n = 8 - ((curx + 8) % 8); for (i = 0; i < n; i++) vidc_rawputchar(' '); @@ -190,8 +196,6 @@ vidc_rawputchar(int c) } } -#ifdef TERM_EMU - /* Get cursor position on the screen. Result is in edx. Sets * curx and cury appropriately. */ @@ -207,6 +211,8 @@ get_pos(int *x, int *y) *x = v86.edx & 0x00ff; *y = (v86.edx & 0xff00) >> 8; } + +#ifdef TERM_EMU /* Move cursor to x rows and y cols (0-based). */ void From owner-svn-src-all@freebsd.org Thu May 9 12:58:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0DD515A8D6D; Thu, 9 May 2019 12:58:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84AD48DFFE; Thu, 9 May 2019 12:58:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CBAC1D4C7; Thu, 9 May 2019 12:58:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49CwYnd095201; Thu, 9 May 2019 12:58:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49CwYr0095200; Thu, 9 May 2019 12:58:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905091258.x49CwYr0095200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 May 2019 12:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347392 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 347392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84AD48DFFE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 12:58:35 -0000 Author: kevans Date: Thu May 9 12:58:33 2019 New Revision: 347392 URL: https://svnweb.freebsd.org/changeset/base/347392 Log: ifconfig(8): Partial revert of r347241 r347241 introduced an ifname <-> kld mapping table, mostly so tun/tap/vmnet can autoload the correct module on use. It also inadvertently made bogus some previously valid uses of sizeof(). Revert back to ifkind on the stack for simplicity sake. This reduces the diff from the previous version of ifmaybeload for easiser auditing. Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Thu May 9 12:14:52 2019 (r347391) +++ head/sbin/ifconfig/ifconfig.c Thu May 9 12:58:33 2019 (r347392) @@ -1433,7 +1433,7 @@ ifmaybeload(const char *name) #define MOD_PREFIX_LEN 3 /* "if_" */ struct module_stat mstat; int i, fileid, modid; - char ifname[IFNAMSIZ], *ifkind, *dp; + char ifkind[IFNAMSIZ + MOD_PREFIX_LEN], ifname[IFNAMSIZ], *dp; const char *cp; struct module_map_entry *mme; @@ -1450,21 +1450,17 @@ ifmaybeload(const char *name) } /* Either derive it from the map or guess otherwise */ - ifkind = NULL; + *ifkind = '\0'; for (i = 0; i < nitems(module_map); ++i) { mme = &module_map[i]; if (strcmp(mme->ifname, ifname) == 0) { - ifkind = strdup(mme->kldname); - if (ifkind == NULL) - err(EXIT_FAILURE, "ifmaybeload"); + strlcpy(ifkind, mme->kldname, sizeof(ifkind)); break; } } /* We didn't have an alias for it... we'll guess. */ - if (ifkind == NULL) { - ifkind = malloc(IFNAMSIZ + MOD_PREFIX_LEN); - + if (*ifkind == '\0') { /* turn interface and unit into module name */ strlcpy(ifkind, "if_", sizeof(ifkind)); strlcat(ifkind, ifname, sizeof(ifkind)); @@ -1487,7 +1483,7 @@ ifmaybeload(const char *name) /* already loaded? */ if (strcmp(ifname, cp) == 0 || strcmp(ifkind, cp) == 0) - goto out; + return; } } @@ -1496,8 +1492,6 @@ ifmaybeload(const char *name) * infer the names of all drivers (eg mlx4en(4)). */ (void) kldload(ifkind); -out: - free(ifkind); } static struct cmd basic_cmds[] = { From owner-svn-src-all@freebsd.org Thu May 9 13:12:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D330B15A93F6; Thu, 9 May 2019 13:12:44 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79C978EA13; Thu, 9 May 2019 13:12:44 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54DB81D81A; Thu, 9 May 2019 13:12:44 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49DCisX005240; Thu, 9 May 2019 13:12:44 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49DChr2005235; Thu, 9 May 2019 13:12:43 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905091312.x49DChr2005235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 9 May 2019 13:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347393 - in head/stand: common i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand: common i386/libi386 X-SVN-Commit-Revision: 347393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79C978EA13 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 13:12:45 -0000 Author: tsoome Date: Thu May 9 13:12:43 2019 New Revision: 347393 URL: https://svnweb.freebsd.org/changeset/base/347393 Log: loader: use DPRINTF in biosdisk.c and define safe DPRINTF r345066 did miss biosdisk.c. Also define DPRINTF as ((void)0) for case we do not want debug printouts. MFC after: 1 week Modified: head/stand/common/disk.c head/stand/common/interp_forth.c head/stand/common/part.c head/stand/i386/libi386/biosdisk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Thu May 9 12:58:33 2019 (r347392) +++ head/stand/common/disk.c Thu May 9 13:12:43 2019 (r347393) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #ifdef DISK_DEBUG # define DPRINTF(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args) #else -# define DPRINTF(fmt, args...) +# define DPRINTF(fmt, args...) ((void)0) #endif struct open_disk { Modified: head/stand/common/interp_forth.c ============================================================================== --- head/stand/common/interp_forth.c Thu May 9 12:58:33 2019 (r347392) +++ head/stand/common/interp_forth.c Thu May 9 13:12:43 2019 (r347393) @@ -41,7 +41,7 @@ INTERP_DEFINE("4th"); #ifdef BFORTH_DEBUG #define DPRINTF(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, args...) ((void)0) #endif /* Modified: head/stand/common/part.c ============================================================================== --- head/stand/common/part.c Thu May 9 12:58:33 2019 (r347392) +++ head/stand/common/part.c Thu May 9 13:12:43 2019 (r347393) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #ifdef PART_DEBUG #define DPRINTF(fmt, args...) printf("%s: " fmt "\n", __func__, ## args) #else -#define DPRINTF(fmt, args...) +#define DPRINTF(fmt, args...) ((void)0) #endif #ifdef LOADER_GPT_SUPPORT Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Thu May 9 12:58:33 2019 (r347392) +++ head/stand/i386/libi386/biosdisk.c Thu May 9 13:12:43 2019 (r347393) @@ -65,9 +65,9 @@ __FBSDID("$FreeBSD$"); #define CDMAJOR 15 #ifdef DISK_DEBUG -#define DEBUG(fmt, args...) printf("%s: " fmt "\n", __func__, ## args) +#define DPRINTF(fmt, args...) printf("%s: " fmt "\n", __func__, ## args) #else -#define DEBUG(fmt, args...) +#define DPRINTF(fmt, args...) ((void)0) #endif struct specification_packet { @@ -218,12 +218,12 @@ bd_bios2unit(int biosdev) bdinfo_t *bd; int i, unit; - DEBUG("looking for bios device 0x%x", biosdev); + DPRINTF("looking for bios device 0x%x", biosdev); for (i = 0; bdi[i] != NULL; i++) { unit = 0; STAILQ_FOREACH(bd, bdi[i], bd_link) { if (bd->bd_unit == biosdev) { - DEBUG("bd unit %d is BIOS device 0x%x", unit, + DPRINTF("bd unit %d is BIOS device 0x%x", unit, bd->bd_unit); return (unit); } @@ -620,7 +620,7 @@ bd_int13probe(bdinfo_t *bd) if (bd->bd_sectors == 0) bd->bd_sectors = (uint64_t)bd->bd_cyl * bd->bd_hds * bd->bd_sec; - DEBUG("unit 0x%x geometry %d/%d/%d\n", bd->bd_unit, bd->bd_cyl, + DPRINTF("unit 0x%x geometry %d/%d/%d\n", bd->bd_unit, bd->bd_cyl, bd->bd_hds, bd->bd_sec); return (true); @@ -919,7 +919,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s return (EIO); } - DEBUG("open_disk %p", dev); + DPRINTF("open_disk %p", dev); offset = dblk * BIOSDISK_SECSIZE; dblk = offset / bd->bd_sectorsize; @@ -932,7 +932,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s * while translating block count to bytes. */ if (size > INT_MAX) { - DEBUG("too large I/O: %zu bytes", size); + DPRINTF("too large I/O: %zu bytes", size); return (EIO); } @@ -972,7 +972,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s if (dblk + blks >= d_offset + disk_blocks) { blks = d_offset + disk_blocks - dblk; size = blks * bd->bd_sectorsize; - DEBUG("short I/O %d", blks); + DPRINTF("short I/O %d", blks); } bio_size = min(BIO_BUFFER_SIZE, size); @@ -997,7 +997,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s switch (rw & F_MASK) { case F_READ: - DEBUG("read %d from %lld to %p", x, dblk, buf); + DPRINTF("read %d from %lld to %p", x, dblk, buf); bsize = bd->bd_sectorsize * x - blkoff; if (rest < bsize) bsize = rest; @@ -1010,7 +1010,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s bcopy(bbuf + blkoff, buf, bsize); break; case F_WRITE : - DEBUG("write %d from %lld to %p", x, dblk, buf); + DPRINTF("write %d from %lld to %p", x, dblk, buf); if (blkoff != 0) { /* * We got offset to sector, read 1 sector to @@ -1259,7 +1259,7 @@ bd_getdev(struct i386_devdesc *d) return (-1); biosdev = bd_unit2bios(d); - DEBUG("unit %d BIOS device %d", dev->dd.d_unit, biosdev); + DPRINTF("unit %d BIOS device %d", dev->dd.d_unit, biosdev); if (biosdev == -1) /* not a BIOS device */ return (-1); @@ -1312,6 +1312,6 @@ bd_getdev(struct i386_devdesc *d) } rootdev = MAKEBOOTDEV(major, slice, unit, partition); - DEBUG("dev is 0x%x\n", rootdev); + DPRINTF("dev is 0x%x\n", rootdev); return (rootdev); } From owner-svn-src-all@freebsd.org Thu May 9 14:06:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F63415AA8C6; Thu, 9 May 2019 14:06:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2239D69F5B; Thu, 9 May 2019 14:06:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1652B1E08E; Thu, 9 May 2019 14:06:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49E6Of1032113; Thu, 9 May 2019 14:06:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49E6OfK032112; Thu, 9 May 2019 14:06:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905091406.x49E6OfK032112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 May 2019 14:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347394 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2239D69F5B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 14:06:25 -0000 Author: kevans Date: Thu May 9 14:06:24 2019 New Revision: 347394 URL: https://svnweb.freebsd.org/changeset/base/347394 Log: tuntap: Properly detach tap ifp Modified: head/sys/net/if_tuntap.c Modified: head/sys/net/if_tuntap.c ============================================================================== --- head/sys/net/if_tuntap.c Thu May 9 13:12:43 2019 (r347393) +++ head/sys/net/if_tuntap.c Thu May 9 14:06:24 2019 (r347394) @@ -529,7 +529,6 @@ out: static void tun_destroy(struct tuntap_softc *tp) { - struct cdev *dev; TUN_LOCK(tp); tp->tun_flags |= TUN_DYING; @@ -543,15 +542,18 @@ tun_destroy(struct tuntap_softc *tp) TUN2IFP(tp)->if_softc = NULL; sx_xunlock(&tun_ioctl_sx); - dev = tp->tun_dev; - bpfdetach(TUN2IFP(tp)); - if_detach(TUN2IFP(tp)); - free_unr(tp->tun_drv->unrhdr, TUN2IFP(tp)->if_dunit); - if_free(TUN2IFP(tp)); - destroy_dev(dev); + destroy_dev(tp->tun_dev); seldrain(&tp->tun_rsel); knlist_clear(&tp->tun_rsel.si_note, 0); knlist_destroy(&tp->tun_rsel.si_note); + if ((tp->tun_flags & TUN_L2) != 0) { + ether_ifdetach(TUN2IFP(tp)); + } else { + bpfdetach(TUN2IFP(tp)); + if_detach(TUN2IFP(tp)); + } + free_unr(tp->tun_drv->unrhdr, TUN2IFP(tp)->if_dunit); + if_free(TUN2IFP(tp)); mtx_destroy(&tp->tun_mtx); cv_destroy(&tp->tun_cv); free(tp, M_TUN); From owner-svn-src-all@freebsd.org Thu May 9 17:02:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFDAA15883CF; Thu, 9 May 2019 17:02:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7625B707E8; Thu, 9 May 2019 17:02:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68DB11FEC7; Thu, 9 May 2019 17:02:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49H2fQs034927; Thu, 9 May 2019 17:02:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49H2fUo034926; Thu, 9 May 2019 17:02:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905091702.x49H2fUo034926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 9 May 2019 17:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347396 - stable/11/lib/libclang_rt X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libclang_rt X-SVN-Commit-Revision: 347396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7625B707E8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 17:02:42 -0000 Author: ngie Date: Thu May 9 17:02:40 2019 New Revision: 347396 URL: https://svnweb.freebsd.org/changeset/base/347396 Log: MFC r346578: Build libclang_rt/profile on all clang-supported architectures There's no reason why a special case needs to be added specifically for amd64, arm, and i386, as the code is written in machine architecture agnostic C/C++. This will make it possible for all supporting clang architectures to produce runtime coverage with `--coverage`. Modified: stable/11/lib/libclang_rt/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libclang_rt/Makefile ============================================================================== --- stable/11/lib/libclang_rt/Makefile Thu May 9 16:25:01 2019 (r347395) +++ stable/11/lib/libclang_rt/Makefile Thu May 9 17:02:40 2019 (r347396) @@ -24,9 +24,6 @@ SUBDIR+= ubsan_standalone SUBDIR+= ubsan_standalone_cxx .endif -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \ - (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") SUBDIR+= profile -.endif .include From owner-svn-src-all@freebsd.org Thu May 9 17:02:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 082B9158841D; Thu, 9 May 2019 17:02:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15028708AF; Thu, 9 May 2019 17:02:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63FB41FEC8; Thu, 9 May 2019 17:02:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49H2mP5034977; Thu, 9 May 2019 17:02:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49H2mVG034976; Thu, 9 May 2019 17:02:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905091702.x49H2mVG034976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 9 May 2019 17:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347397 - stable/12/lib/libclang_rt X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/12/lib/libclang_rt X-SVN-Commit-Revision: 347397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 15028708AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 17:02:52 -0000 Author: ngie Date: Thu May 9 17:02:47 2019 New Revision: 347397 URL: https://svnweb.freebsd.org/changeset/base/347397 Log: MFC r346578: Build libclang_rt/profile on all clang-supported architectures There's no reason why a special case needs to be added specifically for amd64, arm, and i386, as the code is written in machine architecture agnostic C/C++. This will make it possible for all supporting clang architectures to produce runtime coverage with `--coverage`. Modified: stable/12/lib/libclang_rt/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libclang_rt/Makefile ============================================================================== --- stable/12/lib/libclang_rt/Makefile Thu May 9 17:02:40 2019 (r347396) +++ stable/12/lib/libclang_rt/Makefile Thu May 9 17:02:47 2019 (r347397) @@ -22,9 +22,6 @@ SUBDIR+= ubsan_standalone SUBDIR+= ubsan_standalone_cxx .endif -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" SUBDIR+= profile -.endif .include From owner-svn-src-all@freebsd.org Thu May 9 17:27:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 358921588B24; Thu, 9 May 2019 17:27:13 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7F2871461; Thu, 9 May 2019 17:27:12 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x42c.google.com with SMTP id t87so1677226pfa.2; Thu, 09 May 2019 10:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=4ZEE3js+BECroBMxIMi5vcXsMsWm8TVRwlLj48nVLa0=; b=LeuXhQ/8wOS4TCC6d0DPcAp1+2c5dvPeX1WogK9rt+iWtHPl/3QAZ4cYhmmXSE6h6o +/luw3k/oWOLMhycc4g63OLRcm8LhOg9OdiH2ROZMk/A2G8Lm/tCPPN5cBb0q/HUmG/6 OJ2l7Yj3aWRDawlA3lWp9eHnA3mnmInRmiiKD9Y3Z3MOejzt5gDQWyQ4YcY3BcfbmMBx z1btKwB4qdcGuLPtx12Q3X3Zq2+SgFem7xM8iVngQlYl9oHyuoMQESUozd9tUPiqIboI 7CycLE9qVtBDOIygyTyfh8u0i5BAmSS0rZ7HtaMeJUhKxmaQHPLSpA/xWfNfqg/KrN5g tkHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=4ZEE3js+BECroBMxIMi5vcXsMsWm8TVRwlLj48nVLa0=; b=nfvVNdh5q+PchUxik/ax0icGBD4QUtpQncUjEumWSFMG57w+tl0wDLOND8O+cB/oRK sYI3ZyQnmQJYLvnH/K+0TzHbtFPVkoDSIMzp5c8YkE7zIY4i2GjT2fo5iTGLdtcIqjBZ TwA3xDhP74aqxJ94k7trer77it+T4HFFmKYHgQXVPtR86OxpCkC7NvADbqsMf9kObkWB mVt4EOVDRopi90MASPo/TfBE4K5N6MmYRCD+8hur/k/qI5PQNUKj6nWjDVP9N0YPQVrp CWxle3oILpT9uzsLyV+tXKtVeh2wFow8If8GQGkDs8ew6/fdwT5VacCzPsWQYBBrm1Fy vpVA== X-Gm-Message-State: APjAAAX0m7hShtR1m09z6RmQqPnEAPo0aSXkWxP4zLu+s0ZJcUvjQFNF r+Kh4ccPIkIAlwYzmUUw/k/CpFi+Ow0= X-Google-Smtp-Source: APXvYqxoikhP31MyAjRiUyeso9NttN5YWHFOcLB/g1v0f+wBKX4il/QlWP7xa6RDhYmXsxDzK8hbzA== X-Received: by 2002:a62:14d6:: with SMTP id 205mr7002848pfu.4.1557422831026; Thu, 09 May 2019 10:27:11 -0700 (PDT) Received: from [192.168.20.21] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id q10sm2964525pgh.93.2019.05.09.10.27.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 10:27:10 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r347392 - head/sbin/ifconfig From: "Enji Cooper (yaneurabeya)" In-Reply-To: <201905091258.x49CwYr0095200@repo.freebsd.org> Date: Thu, 9 May 2019 10:27:09 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201905091258.x49CwYr0095200@repo.freebsd.org> To: Kyle Evans X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: A7F2871461 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 17:27:13 -0000 > On May 9, 2019, at 05:58, Kyle Evans wrote: >=20 > Author: kevans > Date: Thu May 9 12:58:33 2019 > New Revision: 347392 > URL: https://svnweb.freebsd.org/changeset/base/347392 >=20 > Log: > ifconfig(8): Partial revert of r347241 >=20 > r347241 introduced an ifname <-> kld mapping table, mostly so = tun/tap/vmnet > can autoload the correct module on use. It also inadvertently made = bogus > some previously valid uses of sizeof(). >=20 > Revert back to ifkind on the stack for simplicity sake. This reduces = the > diff from the previous version of ifmaybeload for easiser auditing. Hi Kyle, Thank you for this revert. This change fixed the FreeBSD test = suite runs, which are once again green after this change. A number of = tests which use ifconfig were failing because they couldn=E2=80=99t = configure interfaces: = https://ci.freebsd.org/job/FreeBSD-head-amd64-test/11134/testReport/ .=20= Cheers! -Enji= From owner-svn-src-all@freebsd.org Thu May 9 18:06:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BB3F158978D; Thu, 9 May 2019 18:06:12 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31B0C72A51; Thu, 9 May 2019 18:06:12 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04A93208C5; Thu, 9 May 2019 18:06:12 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49I6BZI067180; Thu, 9 May 2019 18:06:11 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49I6Bx9067179; Thu, 9 May 2019 18:06:11 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905091806.x49I6Bx9067179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 9 May 2019 18:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347402 - head/sys/modules/ipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/modules/ipsec X-SVN-Commit-Revision: 347402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31B0C72A51 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 18:06:12 -0000 Author: ae Date: Thu May 9 18:06:11 2019 New Revision: 347402 URL: https://svnweb.freebsd.org/changeset/base/347402 Log: Add if_ipsec.ko symlink to ipsec.ko kernel module. This add ability to automatically load ipsec kernel module, when if_ipsec(4) virtual interface is created using ifconfig(8). Reviewed by: gallatin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20169 Modified: head/sys/modules/ipsec/Makefile Modified: head/sys/modules/ipsec/Makefile ============================================================================== --- head/sys/modules/ipsec/Makefile Thu May 9 17:57:04 2019 (r347401) +++ head/sys/modules/ipsec/Makefile Thu May 9 18:06:11 2019 (r347402) @@ -7,6 +7,7 @@ SRCS= if_ipsec.c ipsec.c ipsec_input.c ipsec_mbuf.c ip ipsec_output.c xform_ah.c xform_esp.c xform_ipcomp.c \ opt_inet.h opt_inet6.h opt_ipsec.h opt_sctp.h SRCS.INET= udpencap.c +SYMLINKS= ${KMOD}.ko ${KMODDIR}/if_${KMOD}.ko opt_ipsec.h: @echo "#define IPSEC_SUPPORT 1" > ${.TARGET} From owner-svn-src-all@freebsd.org Thu May 9 18:30:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77B5E158A16F; Thu, 9 May 2019 18:30:19 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E11F73BA1; Thu, 9 May 2019 18:30:18 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id EE007145CE; Thu, 9 May 2019 18:30:14 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f179.google.com with SMTP id 14so2885586ljj.5; Thu, 09 May 2019 11:30:14 -0700 (PDT) X-Gm-Message-State: APjAAAXdOFDgKXKVy6Ugn4a48aoUOkJ+4/BpAkm0nW3TxBuis8Ob0M0g EDfbFkW5TWJOp0P4FCVbf7WtIw4Coz2iI8LuQiE= X-Google-Smtp-Source: APXvYqypNTwZEMY5TmuGvtIHrBKVYdoa+CDwXvikSUL/Zlq5rOxoc/k55/kXB4YPzgZpJgEOEYQrACAnRg0Slg10QtI= X-Received: by 2002:a2e:9a17:: with SMTP id o23mr3142531lji.108.1557426613527; Thu, 09 May 2019 11:30:13 -0700 (PDT) MIME-Version: 1.0 References: <201905091258.x49CwYr0095200@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Thu, 9 May 2019 13:29:30 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347392 - head/sbin/ifconfig To: "Enji Cooper (yaneurabeya)" Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 8E11F73BA1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 18:30:19 -0000 On Thu, May 9, 2019 at 12:27 PM Enji Cooper (yaneurabeya) wrote: > > > > On May 9, 2019, at 05:58, Kyle Evans wrote: > > > > Author: kevans > > Date: Thu May 9 12:58:33 2019 > > New Revision: 347392 > > URL: https://svnweb.freebsd.org/changeset/base/347392 > > > > Log: > > ifconfig(8): Partial revert of r347241 > > > > r347241 introduced an ifname <-> kld mapping table, mostly so tun/tap/= vmnet > > can autoload the correct module on use. It also inadvertently made bog= us > > some previously valid uses of sizeof(). > > > > Revert back to ifkind on the stack for simplicity sake. This reduces t= he > > diff from the previous version of ifmaybeload for easiser auditing. > > Hi Kyle, > Thank you for this revert. This change fixed the FreeBSD test sui= te runs, which are once again green after this change. A number of tests wh= ich use ifconfig were failing because they couldn=E2=80=99t configure inter= faces: https://ci.freebsd.org/job/FreeBSD-head-amd64-test/11134/testReport/= . > Cheers! > -Enji Hi, Sorry- I failed in the commit message. =3D( Reported by: ci (via lwhsu) lwhsu clued me in this morning. =3D) Thanks! Kyle Evans From owner-svn-src-all@freebsd.org Thu May 9 18:37:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70422158A81D; Thu, 9 May 2019 18:37:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FE3274A83; Thu, 9 May 2019 18:37:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id BCC1C146E3; Thu, 9 May 2019 18:37:40 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f173.google.com with SMTP id n4so2908075ljg.4; Thu, 09 May 2019 11:37:40 -0700 (PDT) X-Gm-Message-State: APjAAAUo0LwyD7aKD1IxN0uJIJLIkiTmKtepm0ljIYpj8RTfSaRH9Iqu y3B8BPkhj7HJIvJPeVD43+FUolY6rd9yGIzKfI0= X-Google-Smtp-Source: APXvYqyhZ+hMyi4cPfAdbAZn7f01k3M0adIijowj5K3OCA2/uHAjcDGdx7K206za/OpuT+Pie9zonmTObU1nLBNoOEo= X-Received: by 2002:a2e:9a17:: with SMTP id o23mr3161480lji.108.1557427059369; Thu, 09 May 2019 11:37:39 -0700 (PDT) MIME-Version: 1.0 References: <201905091806.x49I6Bx9067179@repo.freebsd.org> In-Reply-To: <201905091806.x49I6Bx9067179@repo.freebsd.org> From: Kyle Evans Date: Thu, 9 May 2019 13:36:56 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347402 - head/sys/modules/ipsec To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 0FE3274A83 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 18:37:41 -0000 On Thu, May 9, 2019 at 1:06 PM Andrey V. Elsukov wrote: > > Author: ae > Date: Thu May 9 18:06:11 2019 > New Revision: 347402 > URL: https://svnweb.freebsd.org/changeset/base/347402 > > Log: > Add if_ipsec.ko symlink to ipsec.ko kernel module. > > This add ability to automatically load ipsec kernel module, when > if_ipsec(4) virtual interface is created using ifconfig(8). > > Reviewed by: gallatin > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D20169 > Hi, Any chance the mechanism I introduced for ifconfig mapping ifname <-> kld in r347241 would solve the same set of problems this would? (unsure if there are any non-ifconfig(8) problems in consideration) If we have more consumers of it than just vmnet (from a stable/ point of view) then I'd be more than happy to MFC that separately from the rest of the commit. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Thu May 9 18:43:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F6FC158AD02; Thu, 9 May 2019 18:43:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (unknown [IPv6:2a02:6b8:0:827::1:9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "butcher-nb.yandex.net", Issuer "butcher-nb.yandex.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 145A4750FE; Thu, 9 May 2019 18:43:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (localhost [127.0.0.1]) by butcher-nb.yandex.net (8.15.2/8.15.2) with ESMTP id x49IfrYZ008210; Thu, 9 May 2019 21:41:53 +0300 (MSK) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r347402 - head/sys/modules/ipsec To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head@freebsd.org References: <201905091806.x49I6Bx9067179@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=ae@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0IkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz6JATsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxC5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <1362fc5c-c5dd-438b-9696-de3ec3a538ca@FreeBSD.org> Date: Thu, 9 May 2019 21:41:49 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="YicSEeeifIh1lpe7iF7XwWNr0rUh7wyWM" X-Rspamd-Queue-Id: 145A4750FE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.89 / 15.00]; NEURAL_HAM_MEDIUM(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.91)[-0.911,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 18:43:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --YicSEeeifIh1lpe7iF7XwWNr0rUh7wyWM Content-Type: multipart/mixed; boundary="X6L4hmGHw5pibuEHpMgw3MJ8mD2d3iyyW"; protected-headers="v1" From: "Andrey V. Elsukov" To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Message-ID: <1362fc5c-c5dd-438b-9696-de3ec3a538ca@FreeBSD.org> Subject: Re: svn commit: r347402 - head/sys/modules/ipsec References: <201905091806.x49I6Bx9067179@repo.freebsd.org> In-Reply-To: --X6L4hmGHw5pibuEHpMgw3MJ8mD2d3iyyW Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.05.2019 21:36, Kyle Evans wrote: > Any chance the mechanism I introduced for ifconfig mapping ifname <-> > kld in r347241 would solve the same set of problems this would? > (unsure if there are any non-ifconfig(8) problems in consideration) If > we have more consumers of it than just vmnet (from a stable/ point of > view) then I'd be more than happy to MFC that separately from the rest > of the commit. >=20 Hi, there is two IPsec related interfaces that have problem with automatic loading - if_enc and if_ipsec. So, if you add both to the mapping list, this will be useful. CAM enc driver has conflicting name and prevents to automatic loading of if_enc(4). It is probably always build in the kernel, but renaming it into "ses" may break some third-party device drivers. --=20 WBR, Andrey V. Elsukov --X6L4hmGHw5pibuEHpMgw3MJ8mD2d3iyyW-- --YicSEeeifIh1lpe7iF7XwWNr0rUh7wyWM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlzUdG0ACgkQAcXqBBDI oXrdbwf8D85p1x43wnfnqRBia2M/UJUSzGrArYoGTdwgGLhHF+PDZbl81S0kLRxa +92/nJYqBWj2x2V3baSCP0Dl9GK2S6vc11rHJSNe7hQg3/fI/cJ2Fo3IXPTC8+a9 yhVj1xzsyPQ1/KWNS7XSWkGi01SOmh44gN966McM4R60mOer0N6DjGkzoKTnkQ3M 3pGNE1g1AViALcWspB0KUtRr+slg8o6TM4B+NOeGDN9bWdBZshG02zw7cA5sTTVs pJzAeNSEq/UZOtI3y77o38SYw2FffX4xE1A7maRP6ozOMehz4jbjo5lJ4m4slbJX W94mGbgqg3Q1rzJQDC66l6f+8/fd4g== =0I93 -----END PGP SIGNATURE----- --YicSEeeifIh1lpe7iF7XwWNr0rUh7wyWM-- From owner-svn-src-all@freebsd.org Thu May 9 18:54:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14C59158B0A4; Thu, 9 May 2019 18:54:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB6EF758DF; Thu, 9 May 2019 18:54:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 875DF21133; Thu, 9 May 2019 18:54:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49IsT28098279; Thu, 9 May 2019 18:54:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49IsTXi098278; Thu, 9 May 2019 18:54:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905091854.x49IsTXi098278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 May 2019 18:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347404 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AB6EF758DF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 18:54:30 -0000 Author: kevans Date: Thu May 9 18:54:29 2019 New Revision: 347404 URL: https://svnweb.freebsd.org/changeset/base/347404 Log: tuntap: Don't down tap interfaces if LINK0 is set Modified: head/sys/net/if_tuntap.c Modified: head/sys/net/if_tuntap.c ============================================================================== --- head/sys/net/if_tuntap.c Thu May 9 18:23:09 2019 (r347403) +++ head/sys/net/if_tuntap.c Thu May 9 18:54:29 2019 (r347404) @@ -947,7 +947,8 @@ tunclose(struct cdev *dev, int foo, int bar, struct th } /* For vmnet, we won't do most of the address/route bits */ - if ((tp->tun_flags & TUN_VMNET) != 0) + if ((tp->tun_flags & TUN_VMNET) != 0 || + (l2tun && (ifp->if_flags & IFF_LINK0) != 0)) goto out; if (ifp->if_flags & IFF_UP) { From owner-svn-src-all@freebsd.org Thu May 9 19:03:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8892158B36F; Thu, 9 May 2019 19:03:53 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D3AC75E89; Thu, 9 May 2019 19:03:53 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38274212E8; Thu, 9 May 2019 19:03:53 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49J3rQ9003391; Thu, 9 May 2019 19:03:53 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49J3rmv003390; Thu, 9 May 2019 19:03:53 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201905091903.x49J3rmv003390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Thu, 9 May 2019 19:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347405 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 347405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D3AC75E89 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 19:03:54 -0000 Author: 0mp (ports committer) Date: Thu May 9 19:03:52 2019 New Revision: 347405 URL: https://svnweb.freebsd.org/changeset/base/347405 Log: nfsd.8: Fix mandoc -Tlint and igor warnings - Remove Tn macros - Refernce sysctl(8) instead of sysctl(1) - Start new sentences on new lines - Capitalize NFS where needed - Use Fx for FreeBSD - Remove a list block (Bl) that was added to the manual page by accident in r335174 Reviewed by: bcr Approved by: doc (bcr) Differential Revision: https://reviews.freebsd.org/D20215 Modified: head/usr.sbin/nfsd/nfsd.8 Modified: head/usr.sbin/nfsd/nfsd.8 ============================================================================== --- head/usr.sbin/nfsd/nfsd.8 Thu May 9 18:54:29 2019 (r347404) +++ head/usr.sbin/nfsd/nfsd.8 Thu May 9 19:03:52 2019 (r347405) @@ -34,8 +34,7 @@ .Sh NAME .Nm nfsd .Nd remote -.Tn NFS -server +NFS server .Sh SYNOPSIS .Nm .Op Fl ardute @@ -49,23 +48,18 @@ server .Sh DESCRIPTION The .Nm -utility runs on a server machine to service -.Tn NFS -requests from client machines. +utility runs on a server machine to service NFS requests from client machines. At least one .Nm must be running for a machine to operate as a server. .Pp -Unless otherwise specified, eight servers per CPU for -.Tn UDP -transport are started. +Unless otherwise specified, eight servers per CPU for UDP transport are +started. .Pp The following options are available: .Bl -tag -width Ds .It Fl r -Register the -.Tn NFS -service with +Register the NFS service with .Xr rpcbind 8 without creating any servers. This option can be used along with the @@ -74,16 +68,15 @@ or .Fl t options to re-register NFS if the rpcbind server is restarted. .It Fl d -Unregister the -.Tn NFS -service with +Unregister the NFS service with .Xr rpcbind 8 without creating any servers. .It Fl V Ar virtual_hostname Specifies a hostname to be used as a principal name, instead of the default hostname. .It Fl n Ar threads -Specifies how many servers to create. This option is equivalent to specifying +Specifies how many servers to create. +This option is equivalent to specifying .Fl Fl maxthreads and .Fl Fl minthreads @@ -114,13 +107,14 @@ Enables pNFS support in the server and specifies the i daemon needs to start it. This option can only be used on one server and specifies that this server will be the MetaData Server (MDS) for the pNFS service. -This can only be done if there is at least one FreeBSD system configured +This can only be done if there is at least one +.Fx +system configured as a Data Server (DS) for it to use. .Pp The .Ar pnfs_setup string is a set of fields separated by ',' characters: -.Bl -tag -width Ds Each of these fields specifies one DS. It consists of a server hostname, followed by a ':' and the directory path where the DS's data storage file system is mounted on @@ -159,7 +153,6 @@ data files for .Dq /export1 and nfsv4-data1 will be used to store data files for .Dq /export2 . -.El .sp When using IPv6 addresses for DSs be wary of using link local addresses. @@ -201,28 +194,20 @@ If mirroring is enabled, the server must use the Flexi layout. If mirroring is not enabled, the server will use the File layout by default, but this default can be changed to the Flexible File layout if the -.Xr sysctl 1 +.Xr sysctl 8 vfs.nfsd.default_flexfile is set non-zero. .It Fl t -Serve -.Tn TCP NFS -clients. +Serve TCP NFS clients. .It Fl u -Serve -.Tn UDP NFS -clients. +Serve UDP NFS clients. .It Fl e Ignored; included for backward compatibility. .El .Pp For example, .Dq Li "nfsd -u -t -n 6" -serves -.Tn UDP -and -.Tn TCP -transports using six daemons. +serves UDP and TCP transports using six daemons. .Pp A server should run enough daemons to handle the maximum level of concurrency from its clients, @@ -231,8 +216,7 @@ typically four to six. The .Nm utility listens for service requests at the port indicated in the -.Tn NFS -server specification; see +NFS server specification; see .%T "Network File System Protocol Specification" , RFC1094, .%T "NFS: Network File System Version 3 Protocol Specification" , @@ -245,15 +229,10 @@ RFC5661. If .Nm detects that -.Tn NFS -is not loaded in the running kernel, it will attempt -to load a loadable kernel module containing -.Tn NFS -support using +NFS is not loaded in the running kernel, it will attempt +to load a loadable kernel module containing NFS support using .Xr kldload 2 . -If this fails, or no -.Tn NFS -KLD is available, +If this fails, or no NFS KLD is available, .Nm will exit with an error. .Pp @@ -271,7 +250,7 @@ that the NFS sockets can only be accessed by the insid The .Nm ipfw utility -would then be used to block nfs-related packets that come in on the outside +would then be used to block NFS-related packets that come in on the outside interface. .Pp If the server has stopped servicing clients and has generated a console message @@ -337,8 +316,8 @@ If .Nm is started when .Xr gssd 8 -is not running, it will service AUTH_SYS requests only. To fix the problem -you must kill +is not running, it will service AUTH_SYS requests only. +To fix the problem you must kill .Nm and then restart it, after the .Xr gssd 8 @@ -351,6 +330,6 @@ need to be patched to support the .Dq tightly coupled variant of the Flexible File layout or the -.Xr sysctl 1 +.Xr sysctl 8 vfs.nfsd.flexlinuxhack must be set to one on the MDS as a workaround. From owner-svn-src-all@freebsd.org Thu May 9 19:13:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2288D158B7AF; Thu, 9 May 2019 19:13:55 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAEC1768A8; Thu, 9 May 2019 19:13:54 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 7030314B4B; Thu, 9 May 2019 19:13:54 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f44.google.com with SMTP id d8so2358681lfb.8; Thu, 09 May 2019 12:13:54 -0700 (PDT) X-Gm-Message-State: APjAAAVBzZ0UDEKJVkKWWbnjN5HB8fEyqR/smvzGL//dA5JW7BWPjK4J zVvfque7MT9QozneJtRZtlskM74RkpTkStjMEZo= X-Google-Smtp-Source: APXvYqzxIl89FcIPrSn+IdkptPNuUdenGSqDrU9pQbl4di8YiXK9tguM9KFlSTkQ44THwm4pfuLmln973ms5WTnAlcU= X-Received: by 2002:ac2:599b:: with SMTP id w27mr3300920lfn.112.1557429232937; Thu, 09 May 2019 12:13:52 -0700 (PDT) MIME-Version: 1.0 References: <201905091806.x49I6Bx9067179@repo.freebsd.org> <1362fc5c-c5dd-438b-9696-de3ec3a538ca@FreeBSD.org> In-Reply-To: <1362fc5c-c5dd-438b-9696-de3ec3a538ca@FreeBSD.org> From: Kyle Evans Date: Thu, 9 May 2019 14:13:09 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347402 - head/sys/modules/ipsec To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: BAEC1768A8 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 19:13:55 -0000 On Thu, May 9, 2019 at 1:43 PM Andrey V. Elsukov wrote: > > On 09.05.2019 21:36, Kyle Evans wrote: > > Any chance the mechanism I introduced for ifconfig mapping ifname <-> > > kld in r347241 would solve the same set of problems this would? > > (unsure if there are any non-ifconfig(8) problems in consideration) If > > we have more consumers of it than just vmnet (from a stable/ point of > > view) then I'd be more than happy to MFC that separately from the rest > > of the commit. > > > > Hi, > > there is two IPsec related interfaces that have problem with automatic > loading - if_enc and if_ipsec. So, if you add both to the mapping list, > this will be useful. CAM enc driver has conflicting name and prevents to > automatic loading of if_enc(4). It is probably always build in the > kernel, but renaming it into "ses" may break some third-party device > drivers. > I think you want something like [0] to add both of these to the map and stop ifconfig(8) from bailing on loading if_enc because 'enc' is loaded. This is safe at least for the set of modules currently mapped. Thanks, Kyle Evans [0] https://people.freebsd.org/~kevans/ipsec.diff From owner-svn-src-all@freebsd.org Thu May 9 20:30:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93E34158D40D; Thu, 9 May 2019 20:30:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 384828114B; Thu, 9 May 2019 20:30:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14C9122039; Thu, 9 May 2019 20:30:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49KUZxO047245; Thu, 9 May 2019 20:30:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49KUZgs047244; Thu, 9 May 2019 20:30:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905092030.x49KUZgs047244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 9 May 2019 20:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347406 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 347406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 384828114B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 20:30:36 -0000 Author: jhb Date: Thu May 9 20:30:35 2019 New Revision: 347406 URL: https://svnweb.freebsd.org/changeset/base/347406 Log: MFC 333235: Allow arbitrary numbers of columns for VNC server screen resolution. The prior code only allowed multiples of 32 for the numbers of columns. Remove this restriction to allow a forthcoming UEFI firmware update to allow arbitrary x,y resolutions. (the code for handling rows already supported non mult-32 values) Modified: stable/11/usr.sbin/bhyve/rfb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/rfb.c ============================================================================== --- stable/11/usr.sbin/bhyve/rfb.c Thu May 9 19:03:52 2019 (r347405) +++ stable/11/usr.sbin/bhyve/rfb.c Thu May 9 20:30:35 2019 (r347406) @@ -544,40 +544,23 @@ rfb_send_screen(struct rfb_softc *rc, int cfd, int all } for (x = 0; x < xcells; x++) { + if (x == (xcells - 1) && rem_x > 0) + cellwidth = rem_x; + else + cellwidth = PIX_PER_CELL; + if (rc->hw_crc) crc_p[x] = fast_crc32(p, - PIX_PER_CELL * sizeof(uint32_t), + cellwidth * sizeof(uint32_t), crc_p[x]); else crc_p[x] = (uint32_t)crc32(crc_p[x], (Bytef *)p, - PIX_PER_CELL * sizeof(uint32_t)); + cellwidth * sizeof(uint32_t)); - p += PIX_PER_CELL; + p += cellwidth; /* check for crc delta if last row in cell */ - if ((y & PIXCELL_MASK) == PIXCELL_MASK || y == (h-1)) { - if (orig_crc[x] != crc_p[x]) { - orig_crc[x] = crc_p[x]; - crc_p[x] = 1; - changes++; - } else { - crc_p[x] = 0; - } - } - } - - if (rem_x) { - if (rc->hw_crc) - crc_p[x] = fast_crc32(p, - rem_x * sizeof(uint32_t), - crc_p[x]); - else - crc_p[x] = (uint32_t)crc32(crc_p[x], - (Bytef *)p, - rem_x * sizeof(uint32_t)); - p += rem_x; - if ((y & PIXCELL_MASK) == PIXCELL_MASK || y == (h-1)) { if (orig_crc[x] != crc_p[x]) { orig_crc[x] = crc_p[x]; From owner-svn-src-all@freebsd.org Thu May 9 21:00:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63611158DD39; Thu, 9 May 2019 21:00:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08C0881F8E; Thu, 9 May 2019 21:00:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8FF522526; Thu, 9 May 2019 21:00:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49L0Fws062723; Thu, 9 May 2019 21:00:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49L0Fkv062722; Thu, 9 May 2019 21:00:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905092100.x49L0Fkv062722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 9 May 2019 21:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347407 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 347407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08C0881F8E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 21:00:16 -0000 Author: tuexen Date: Thu May 9 21:00:15 2019 New Revision: 347407 URL: https://svnweb.freebsd.org/changeset/base/347407 Log: Don't use C++ style comments. These where introduced in r347382. Reported by: ngie@ Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu May 9 20:30:35 2019 (r347406) +++ head/sys/netinet/tcp_input.c Thu May 9 21:00:15 2019 (r347407) @@ -3045,15 +3045,21 @@ dodata: /* XXX */ if (tp->t_flags & TF_SACK_PERMIT) { if (((tlen == 0) && (save_tlen > 0) && (SEQ_LT(save_start, save_rnxt)))) { - // DSACK actually handled in the fastpath above + /* + * DSACK actually handled in the fastpath + * above. + */ tcp_update_sack_list(tp, save_start, save_start + save_tlen); } else if ((tlen > 0) && SEQ_GT(tp->rcv_nxt, save_rnxt)) { - // cleaning sackblks by using zero length update + /* + * Cleaning sackblks by using zero length + * update. + */ tcp_update_sack_list(tp, save_start, save_start); } else if ((tlen > 0) && (tlen >= save_tlen)) { - // update of sackblks + /* Update of sackblks. */ tcp_update_sack_list(tp, save_start, save_start + save_tlen); } else if (tlen > 0) { From owner-svn-src-all@freebsd.org Thu May 9 22:25:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60A80158F81B; Thu, 9 May 2019 22:25:16 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFC9B84A9F; Thu, 9 May 2019 22:25:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB83923440; Thu, 9 May 2019 22:25:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49MPEkG009711; Thu, 9 May 2019 22:25:14 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49MPDSH009704; Thu, 9 May 2019 22:25:13 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201905092225.x49MPDSH009704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 9 May 2019 22:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347408 - in head/lib/libsecureboot: . openpgp tests X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head/lib/libsecureboot: . openpgp tests X-SVN-Commit-Revision: 347408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CFC9B84A9F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 22:25:16 -0000 Author: sjg Date: Thu May 9 22:25:12 2019 New Revision: 347408 URL: https://svnweb.freebsd.org/changeset/base/347408 Log: libsecureboot: make it easier to customize trust anchors Avoid making hash self-tests depend on X.509 certs. Include OpenPGP keys in trust store count. Reviewed by: stevek MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D20208 Modified: head/lib/libsecureboot/Makefile.inc head/lib/libsecureboot/libsecureboot-priv.h head/lib/libsecureboot/local.trust.mk head/lib/libsecureboot/openpgp/Makefile.inc head/lib/libsecureboot/openpgp/opgp_key.c head/lib/libsecureboot/tests/Makefile head/lib/libsecureboot/vets.c Modified: head/lib/libsecureboot/Makefile.inc ============================================================================== --- head/lib/libsecureboot/Makefile.inc Thu May 9 21:00:15 2019 (r347407) +++ head/lib/libsecureboot/Makefile.inc Thu May 9 22:25:12 2019 (r347408) @@ -98,10 +98,20 @@ CFLAGS+= ${VE_HASH_LIST:@H@-DVE_$H_SUPPORT@} \ .if ${VE_SELF_TESTS} != "no" # The input used for hash KATs +# we use a string by default so it is independent of any other test +VE_HASH_KAT_STRLEN?= strlen +.if ${VE_HASH_KAT_STRLEN} == "strlen" +VE_HASH_KAT_STR?= self-tests-are-good +VE_HASH_KAT_STR_INPUT= echo -n +XCFLAGS.vets+= -DVE_HASH_KAT_STR=\"${VE_HASH_KAT_STR}\" +.else VE_HASH_KAT_STR?= vc_PEM - +VE_HASH_KAT_STR_INPUT= cat +VE_HASH_KAT_STRLEN= sizeof XCFLAGS.vets+= -DVE_HASH_KAT_STR=${VE_HASH_KAT_STR} .endif +XCFLAGS.vets+= -DVE_HASH_KAT_STRLEN=${VE_HASH_KAT_STRLEN} +.endif # this should be updated occassionally this is 2019-01-01Z SOURCE_DATE_EPOCH?= 1546329600 @@ -121,17 +131,20 @@ BUILD_UTC?= ${${STAT:Ustat} -f %m ${BUILD_UTC_FILE}:L: # If we are doing self-tests, we define another arrary vc_PEM # containing certificates that we can verify for each trust anchor. # This is typically a subordinate CA cert. -# Finally we generate a hash of vc_PEM using each supported hash method +# Finally we generate a hash of VE_HASH_KAT_STR +# using each supported hash method # to use as a Known Answer Test (needed for FIPS 140-2) # +TA_PEM_LIST ?= ${.ALLSRC:N*crl*:Mt*.pem} +VC_PEM_LIST ?= ${.ALLSRC:N*crl*:Mv*.pem} vets.o vets.po vets.pico: ta.h -ta.h: ${.ALLTARGETS:M[tv]*pem:O:u} +ta.h: @( echo '/* Autogenerated - DO NOT EDIT!!! */'; echo; \ - cat ${.ALLSRC:N*crl*:Mt*.pem} /dev/null | \ + cat ${TA_PEM_LIST:O:u} /dev/null | \ file2c -sx 'static const char ta_PEM[] = {' '};'; \ - echo "${.newline}${VE_HASH_LIST:@H@static char vh_$H[] = \"`cat ${.ALLSRC:N*crl*:Mv*.pem} | ${$H:U${H:tl}}`\";${.newline}@}"; ) > ${.TARGET} + echo "${.newline}${VE_HASH_LIST:O:u:@H@static char vh_$H[] = \"`${VE_HASH_KAT_STR_INPUT} ${VE_HASH_KAT_STR} | ${$H:U${H:tl}}`\";${.newline}@}"; ) > ${.TARGET} .if ${VE_SELF_TESTS} != "no" - ( cat ${.ALLSRC:N*crl*:Mv*.pem} /dev/null | \ + ( cat ${VC_PEM_LIST:O:u} /dev/null | \ file2c -sx 'static const char vc_PEM[] = {' '};'; echo ) >> ${.TARGET} .endif echo '#define BUILD_UTC ${BUILD_UTC}' >> ${.TARGET} ${.OODATE:MNOMETA_CMP} @@ -141,7 +154,7 @@ vesigned.o vesigned.po vesigned.pico: vse.h vse.h: @( echo '/* Autogenerated - DO NOT EDIT!!! */'; echo; \ echo "static const char *signature_exts[] = {"; \ - echo '${VE_SIGNATURE_EXT_LIST:@e@"$e",${.newline}@}'; \ + echo '${VE_SIGNATURE_EXT_LIST:O:u:@e@"$e",${.newline}@}'; \ echo 'NULL };' ) > ${.TARGET} Modified: head/lib/libsecureboot/libsecureboot-priv.h ============================================================================== --- head/lib/libsecureboot/libsecureboot-priv.h Thu May 9 21:00:15 2019 (r347407) +++ head/lib/libsecureboot/libsecureboot-priv.h Thu May 9 22:25:12 2019 (r347408) @@ -55,6 +55,7 @@ int verify_rsa_digest(br_rsa_public_key *pkey, int is_verified(struct stat *stp); void add_verify_status(struct stat *stp, int status); +int openpgp_trust_init(void); int openpgp_self_tests(void); int efi_secure_boot_enabled(void); Modified: head/lib/libsecureboot/local.trust.mk ============================================================================== --- head/lib/libsecureboot/local.trust.mk Thu May 9 21:00:15 2019 (r347407) +++ head/lib/libsecureboot/local.trust.mk Thu May 9 22:25:12 2019 (r347408) @@ -51,7 +51,7 @@ SIGN_OPENPGP= ${PYTHON} ${SIGNER:H}/openpgp-sign.py -a ta_openpgp.asc: ${SIGN_OPENPGP} -C ${.TARGET} -ta.h: ta_openpgp.asc +ta_asc.h: ta_openpgp.asc .if ${VE_SELF_TESTS} != "no" # for self test @@ -59,7 +59,7 @@ vc_openpgp.asc: ta_openpgp.asc ${SIGN_OPENPGP} ${.ALLSRC:M*.asc} mv ta_openpgp.asc.asc ${.TARGET} -ta.h: vc_openpgp.asc +ta_asc.h: vc_openpgp.asc .endif .endif @@ -72,17 +72,20 @@ ecerts.pem: .if ${VE_SIGNATURE_LIST:tu:MECDSA} != "" # the last cert in the chain is the one we want ta_ec.pem: ecerts.pem _LAST_PEM_USE - +ta.h: ta_ec.pem .if ${VE_SELF_TESTS} != "no" # these are for verification self test vc_ec.pem: ecerts.pem _2ndLAST_PEM_USE +ta.h: vc_ec.pem .endif .endif .if ${VE_SIGNATURE_LIST:tu:MRSA} != "" ta_rsa.pem: rcerts.pem _LAST_PEM_USE +ta.h: ta_rsa.pem .if ${VE_SELF_TESTS} != "no" vc_rsa.pem: rcerts.pem _2ndLAST_PEM_USE +ta.h: vc_rsa.pem .endif .endif Modified: head/lib/libsecureboot/openpgp/Makefile.inc ============================================================================== --- head/lib/libsecureboot/openpgp/Makefile.inc Thu May 9 21:00:15 2019 (r347407) +++ head/lib/libsecureboot/openpgp/Makefile.inc Thu May 9 22:25:12 2019 (r347408) @@ -23,26 +23,29 @@ opgp_key.o opgp_key.po opgp_key.pico: ta_asc.h # It is assumed that these v*.asc files are named similarly to # the appropriate t*.asc so that the relative order of vc_ASC # entries matches ta_ASC. -# -ta_asc.h: ${.ALLTARGETS:M[tv]*.asc:O:u} +# +TA_ASC_LIST ?= ${.ALLSRC:Mt*.asc} +VC_ASC_LIST ?= ${.ALLSRC:Mv*.asc} + +ta_asc.h: .if ${VE_SIGNATURE_LIST:MOPENPGP} != "" @( echo '/* Autogenerated - DO NOT EDIT!!! */'; echo; \ echo "#define HAVE_TA_ASC 1"; \ - set -- ${.ALLSRC:Mt*.asc:@f@$f ${f:T:R}@}; \ + set -- ${TA_ASC_LIST:@f@$f ${f:T:R}@}; \ while test $$# -ge 2; do \ file2c -sx "static const char $$2[] = {" ', 0x00 };' < $$1; \ shift 2; \ done; \ - echo 'static const char *ta_ASC[] = { ${.ALLSRC:Mt*.asc:T:R:ts,}, NULL };'; \ + echo 'static const char *ta_ASC[] = { ${TA_ASC_LIST:T:R:ts,}, NULL };'; \ echo; ) > ${.TARGET} .if ${VE_SELF_TESTS} != "no" @( echo "#define HAVE_VC_ASC 1"; \ - set -- ${.ALLSRC:Mv*.asc:@f@$f ${f:T:R}@}; \ + set -- ${VC_ASC_LIST:@f@$f ${f:T:R}@}; \ while test $$# -ge 2; do \ file2c -sx "static const char $$2[] = {" ', 0x00 };' < $$1; \ shift 2; \ done; \ - echo 'static const char *vc_ASC[] = { ${.ALLSRC:Mv*.asc:T:R:ts,}, NULL };'; \ + echo 'static const char *vc_ASC[] = { ${VC_ASC_LIST:T:R:ts,}, NULL };'; \ echo; ) >> ${.TARGET} .endif .endif Modified: head/lib/libsecureboot/openpgp/opgp_key.c ============================================================================== --- head/lib/libsecureboot/openpgp/opgp_key.c Thu May 9 21:00:15 2019 (r347407) +++ head/lib/libsecureboot/openpgp/opgp_key.c Thu May 9 22:25:12 2019 (r347408) @@ -289,32 +289,47 @@ load_trusted_key_id(const char *keyID) OpenPGP_key * load_key_id(const char *keyID) { - static int once = 0; OpenPGP_key *key; - if (!once) { + key = openpgp_trust_get(keyID); +#ifndef _STANDALONE + if (!key) + key = load_trusted_key_id(keyID); +#endif + return (key); +} + +/** + * @brief initialize our internal trust store if any + */ +int +openpgp_trust_init(void) +{ + static int once = -1; #ifdef HAVE_TA_ASC - const char **tp; - char *cp; - size_t n; + OpenPGP_key *key; + const char **tp; + char *cp; + size_t n; +#endif + if (once < 0) { + once = 0; +#ifdef HAVE_TA_ASC for (tp = ta_ASC; *tp; tp++) { if ((cp = strdup(*tp))) { n = strlen(cp); key = load_key_buf((unsigned char *)cp, n); free(cp); - openpgp_trust_add(key); + if (key) { + openpgp_trust_add(key); + once++; + } } } -#endif - once = 1; } - key = openpgp_trust_get(keyID); -#ifndef _STANDALONE - if (!key) - key = load_trusted_key_id(keyID); #endif - return (key); + return (once); } /** @@ -333,19 +348,21 @@ openpgp_self_tests(void) char *fdata, *sdata = NULL; size_t fbytes, sbytes; - for (tp = ta_ASC, vp = vc_ASC; *tp && *vp && rc; tp++, vp++) { - if ((fdata = strdup(*tp)) && - (sdata = strdup(*vp))) { - fbytes = strlen(fdata); - sbytes = strlen(sdata); - rc = openpgp_verify("ta_ASC", - (unsigned char *)fdata, fbytes, - (unsigned char *)sdata, sbytes, 0); - printf("Testing verify OpenPGP signature:\t\t%s\n", - rc ? "Failed" : "Passed"); + if (openpgp_trust_init() > 0) { + for (tp = ta_ASC, vp = vc_ASC; *tp && *vp && rc; tp++, vp++) { + if ((fdata = strdup(*tp)) && + (sdata = strdup(*vp))) { + fbytes = strlen(fdata); + sbytes = strlen(sdata); + rc = openpgp_verify("ta_ASC", + (unsigned char *)fdata, fbytes, + (unsigned char *)sdata, sbytes, 0); + printf("Testing verify OpenPGP signature:\t\t%s\n", + rc ? "Failed" : "Passed"); + } + free(fdata); + free(sdata); } - free(fdata); - free(sdata); } #endif return (rc); Modified: head/lib/libsecureboot/tests/Makefile ============================================================================== --- head/lib/libsecureboot/tests/Makefile Thu May 9 21:00:15 2019 (r347407) +++ head/lib/libsecureboot/tests/Makefile Thu May 9 22:25:12 2019 (r347408) @@ -13,6 +13,7 @@ NO_SHARED= # we want to test verify_file api too # which requires a kludge or two +MK_LOADER_EFI_SECUREBOOT= no .include "../Makefile.libsa.inc" BRSSL_CFLAGS := ${BRSSL_CFLAGS:N-DNO_STDIO} XCFLAGS.verify_file += -DSOPEN_MAX=64 Modified: head/lib/libsecureboot/vets.c ============================================================================== --- head/lib/libsecureboot/vets.c Thu May 9 21:00:15 2019 (r347407) +++ head/lib/libsecureboot/vets.c Thu May 9 22:25:12 2019 (r347408) @@ -246,7 +246,9 @@ ve_trust_init(void) num = ve_trust_anchors_add(xcs, num); #endif once = (int) VEC_LEN(trust_anchors); - +#ifdef VE_OPENPGP_SUPPORT + once += openpgp_trust_init(); +#endif return (once); } @@ -814,7 +816,7 @@ test_hash(const br_hash_class *md, size_t hlen, #define ve_test_hash(n, N) \ printf("Testing hash: " #n "\t\t\t\t%s\n", \ test_hash(&br_ ## n ## _vtable, br_ ## n ## _SIZE, #n, \ - VE_HASH_KAT_STR, sizeof(VE_HASH_KAT_STR), \ + VE_HASH_KAT_STR, VE_HASH_KAT_STRLEN(VE_HASH_KAT_STR), \ vh_ ## N) ? "Failed" : "Passed") /** @@ -863,34 +865,32 @@ ve_self_tests(void) #ifdef VERIFY_CERTS_STR xcs = parse_certificates(__DECONST(unsigned char *, VERIFY_CERTS_STR), sizeof(VERIFY_CERTS_STR), &num); - if (xcs == NULL) - return (0); - /* - * We want the commonName field - * the OID we want is 2,5,4,3 - but DER encoded - */ - cn_oid[0] = 3; - cn_oid[1] = 0x55; - cn_oid[2] = 4; - cn_oid[3] = 3; - cn.oid = cn_oid; - cn.buf = cn_buf; + if (xcs != NULL) { + /* + * We want the commonName field + * the OID we want is 2,5,4,3 - but DER encoded + */ + cn_oid[0] = 3; + cn_oid[1] = 0x55; + cn_oid[2] = 4; + cn_oid[3] = 3; + cn.oid = cn_oid; + cn.buf = cn_buf; - for (u = 0; u < num; u ++) { - cn.len = sizeof(cn_buf); - if ((pk = verify_signer_xcs(&xcs[u], 1, &cn, 1, &trust_anchors)) != NULL) { - free_cert_contents(&xcs[u]); - once++; - printf("Testing verify certificate: %s\tPassed\n", - cn.status ? cn_buf : ""); - xfreepkey(pk); + for (u = 0; u < num; u ++) { + cn.len = sizeof(cn_buf); + if ((pk = verify_signer_xcs(&xcs[u], 1, &cn, 1, &trust_anchors)) != NULL) { + free_cert_contents(&xcs[u]); + once++; + printf("Testing verify certificate: %s\tPassed\n", + cn.status ? cn_buf : ""); + xfreepkey(pk); + } } + if (!once) + printf("Testing verify certificate:\t\t\tFailed\n"); + xfree(xcs); } - if (!once) - printf("Testing verify certificate:\t\t\tFailed\n"); - xfree(xcs); -#else - printf("No X.509 self tests\n"); #endif /* VERIFY_CERTS_STR */ #ifdef VE_OPENPGP_SUPPORT if (!openpgp_self_tests()) From owner-svn-src-all@freebsd.org Thu May 9 22:31:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD2E5158FB7A; Thu, 9 May 2019 22:31:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74EB884FA8; Thu, 9 May 2019 22:31:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5174D234B6; Thu, 9 May 2019 22:31:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49MVm8N012531; Thu, 9 May 2019 22:31:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49MVlQp012302; Thu, 9 May 2019 22:31:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905092231.x49MVlQp012302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 9 May 2019 22:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347409 - in stable/11/sys/amd64: include vmm X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11/sys/amd64: include vmm X-SVN-Commit-Revision: 347409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74EB884FA8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 22:31:49 -0000 Author: jhb Date: Thu May 9 22:31:47 2019 New Revision: 347409 URL: https://svnweb.freebsd.org/changeset/base/347409 Log: MFC 333639: vmmdev: return EFAULT when trying to read beyond VM system memory max address Currently, when using dd(1) to take a VM memory image, the capture never ends, reading zeroes when it's beyond VM system memory max address. Return EFAULT when trying to read beyond VM system memory max address. Modified: stable/11/sys/amd64/include/vmm.h stable/11/sys/amd64/vmm/vmm.c stable/11/sys/amd64/vmm/vmm_dev.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/include/vmm.h ============================================================================== --- stable/11/sys/amd64/include/vmm.h Thu May 9 22:25:12 2019 (r347408) +++ stable/11/sys/amd64/include/vmm.h Thu May 9 22:31:47 2019 (r347409) @@ -201,6 +201,7 @@ int vm_mmap_getnext(struct vm *vm, vm_paddr_t *gpa, in vm_ooffset_t *segoff, size_t *len, int *prot, int *flags); int vm_get_memseg(struct vm *vm, int ident, size_t *len, bool *sysmem, struct vm_object **objptr); +vm_paddr_t vmm_sysmem_maxaddr(struct vm *vm); void *vm_gpa_hold(struct vm *, int vcpuid, vm_paddr_t gpa, size_t len, int prot, void **cookie); void vm_gpa_release(void *cookie); Modified: stable/11/sys/amd64/vmm/vmm.c ============================================================================== --- stable/11/sys/amd64/vmm/vmm.c Thu May 9 22:25:12 2019 (r347408) +++ stable/11/sys/amd64/vmm/vmm.c Thu May 9 22:31:47 2019 (r347409) @@ -773,8 +773,8 @@ sysmem_mapping(struct vm *vm, struct mem_map *mm) return (false); } -static vm_paddr_t -sysmem_maxaddr(struct vm *vm) +vm_paddr_t +vmm_sysmem_maxaddr(struct vm *vm) { struct mem_map *mm; vm_paddr_t maxaddr; @@ -883,7 +883,7 @@ vm_assign_pptdev(struct vm *vm, int bus, int slot, int if (ppt_assigned_devices(vm) == 0) { KASSERT(vm->iommu == NULL, ("vm_assign_pptdev: iommu must be NULL")); - maxaddr = sysmem_maxaddr(vm); + maxaddr = vmm_sysmem_maxaddr(vm); vm->iommu = iommu_create_domain(maxaddr); if (vm->iommu == NULL) return (ENXIO); Modified: stable/11/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/11/sys/amd64/vmm/vmm_dev.c Thu May 9 22:25:12 2019 (r347408) +++ stable/11/sys/amd64/vmm/vmm_dev.c Thu May 9 22:31:47 2019 (r347409) @@ -171,7 +171,7 @@ static int vmmdev_rw(struct cdev *cdev, struct uio *uio, int flags) { int error, off, c, prot; - vm_paddr_t gpa; + vm_paddr_t gpa, maxaddr; void *hpa, *cookie; struct vmmdev_softc *sc; @@ -187,6 +187,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag return (error); prot = (uio->uio_rw == UIO_WRITE ? VM_PROT_WRITE : VM_PROT_READ); + maxaddr = vmm_sysmem_maxaddr(sc->vm); while (uio->uio_resid > 0 && error == 0) { gpa = uio->uio_offset; off = gpa & PAGE_MASK; @@ -202,7 +203,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag */ hpa = vm_gpa_hold(sc->vm, VM_MAXCPU - 1, gpa, c, prot, &cookie); if (hpa == NULL) { - if (uio->uio_rw == UIO_READ) + if (uio->uio_rw == UIO_READ && gpa < maxaddr) error = uiomove(__DECONST(void *, zero_region), c, uio); else From owner-svn-src-all@freebsd.org Thu May 9 22:38:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79E50158FCC8; Thu, 9 May 2019 22:38:18 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F84B8549D; Thu, 9 May 2019 22:38:18 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECC02235F9; Thu, 9 May 2019 22:38:17 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49McHNS015675; Thu, 9 May 2019 22:38:17 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49McFCO015665; Thu, 9 May 2019 22:38:15 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201905092238.x49McFCO015665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Thu, 9 May 2019 22:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf X-SVN-Commit-Revision: 347410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F84B8549D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 22:38:18 -0000 Author: gallatin Date: Thu May 9 22:38:15 2019 New Revision: 347410 URL: https://svnweb.freebsd.org/changeset/base/347410 Log: Remove IPSEC from GENERIC due to performance issues Having IPSEC compiled into the kernel imposes a non-trivial performance penalty on multi-threaded workloads due to IPSEC refcounting. In my benchmarks of multi-threaded UDP transmit (connected sockets), I've seen a roughly 20% performance penalty when the IPSEC option is included in the kernel (16.8Mpps vs 13.8Mpps with 32 senders on a 14 core / 28 HTT Xeon 2697v3)). This is largely due to key_addref() incrementing and decrementing an atomic reference count on the default policy. This cause all CPUs to stall on the same cacheline, as it bounces between different CPUs. Given that relatively few users use ipsec, and that it can be loaded as a module, it seems reasonable to ask those users to load the ipsec module so as to avoid imposing this penalty on the GENERIC kernel. Its my hope that this will make FreeBSD look better in "out of the box" benchmark comparisons with other operating systems. Many thanks to ae for fixing auto-loading of ipsec.ko when ifconfig tries to configure ipsec, and to cy for volunteering to ensure the the racoon ports will load the ipsec.ko module Reviewed by: cem, cy, delphij, gnn, jhb, jpaetzel Differential Revision: https://reviews.freebsd.org/D20163 Modified: head/UPDATING head/sys/amd64/conf/GENERIC head/sys/arm/conf/std.armv6 head/sys/arm/conf/std.armv7 head/sys/arm64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/riscv/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu May 9 22:31:47 2019 (r347409) +++ head/UPDATING Thu May 9 22:38:15 2019 (r347410) @@ -32,6 +32,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20190507: + The IPSEC option has been removed from GENERIC. Users requiring + ipsec(4) must now load the ipsec(4) kernel module. + +20190507: The tap(4) driver has been folded into tun(4), and the module has been renamed to tuntap. You should update any kld_load="if_tap" or kld_load="if_tun" entries in /etc/rc.conf, if_tap_load="YES" or Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu May 9 22:31:47 2019 (r347409) +++ head/sys/amd64/conf/GENERIC Thu May 9 22:38:15 2019 (r347410) @@ -30,7 +30,6 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols -options IPSEC # IP (v4/v6) security options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_OFFLOAD # TCP offload options TCP_BLACKBOX # Enhanced TCP event logging Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Thu May 9 22:31:47 2019 (r347409) +++ head/sys/arm/conf/std.armv6 Thu May 9 22:38:15 2019 (r347410) @@ -11,7 +11,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP device crypto # core crypto support -options IPSEC # IP (v4/v6) security +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/arm/conf/std.armv7 ============================================================================== --- head/sys/arm/conf/std.armv7 Thu May 9 22:31:47 2019 (r347409) +++ head/sys/arm/conf/std.armv7 Thu May 9 22:38:15 2019 (r347410) @@ -11,7 +11,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP device crypto # core crypto support -options IPSEC # IP (v4/v6) security +options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu May 9 22:31:47 2019 (r347409) +++ head/sys/arm64/conf/GENERIC Thu May 9 22:38:15 2019 (r347410) @@ -29,7 +29,6 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols -options IPSEC # IP (v4/v6) security options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_HHOOK # hhook(9) framework for TCP options TCP_OFFLOAD # TCP offload Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu May 9 22:31:47 2019 (r347409) +++ head/sys/i386/conf/GENERIC Thu May 9 22:38:15 2019 (r347410) @@ -31,7 +31,6 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols -options IPSEC # IP (v4/v6) security options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_HHOOK # hhook(9) framework for TCP options TCP_OFFLOAD # TCP offload Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Thu May 9 22:31:47 2019 (r347409) +++ head/sys/powerpc/conf/GENERIC Thu May 9 22:38:15 2019 (r347410) @@ -38,7 +38,6 @@ options PREEMPTION #Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET #InterNETworking options INET6 #IPv6 communications protocols -options IPSEC # IP (v4/v6) security options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_HHOOK # hhook(9) framework for TCP options TCP_RFC7413 # TCP Fast Open Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Thu May 9 22:31:47 2019 (r347409) +++ head/sys/powerpc/conf/GENERIC64 Thu May 9 22:38:15 2019 (r347410) @@ -40,7 +40,6 @@ options PREEMPTION #Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET #InterNETworking options INET6 #IPv6 communications protocols -options IPSEC # IP (v4/v6) security options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_OFFLOAD # TCP offload options TCP_BLACKBOX # Enhanced TCP event logging Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Thu May 9 22:31:47 2019 (r347409) +++ head/sys/riscv/conf/GENERIC Thu May 9 22:38:15 2019 (r347410) @@ -34,7 +34,6 @@ options VIMAGE # Subsystem virtualization, e.g. VNE options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP -options IPSEC # IP (v4/v6) security options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Thu May 9 22:31:47 2019 (r347409) +++ head/sys/sparc64/conf/GENERIC Thu May 9 22:38:15 2019 (r347410) @@ -31,7 +31,6 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols -options IPSEC # IP (v4/v6) security options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_HHOOK # hhook(9) framework for TCP options SCTP # Stream Control Transmission Protocol From owner-svn-src-all@freebsd.org Thu May 9 22:39:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5EB2158FD53; Thu, 9 May 2019 22:39:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6A18560C; Thu, 9 May 2019 22:39:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 468F12360B; Thu, 9 May 2019 22:39:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49MdPAj015768; Thu, 9 May 2019 22:39:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49MdPpZ015767; Thu, 9 May 2019 22:39:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905092239.x49MdPpZ015767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 9 May 2019 22:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347411 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 347411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A6A18560C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 22:39:26 -0000 Author: jhb Date: Thu May 9 22:39:24 2019 New Revision: 347411 URL: https://svnweb.freebsd.org/changeset/base/347411 Log: MFC 334271: bhyve: fix small memory leak in virtio console Modified: stable/11/usr.sbin/bhyve/pci_virtio_console.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_virtio_console.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_virtio_console.c Thu May 9 22:38:15 2019 (r347410) +++ stable/11/usr.sbin/bhyve/pci_virtio_console.c Thu May 9 22:39:24 2019 (r347411) @@ -630,7 +630,7 @@ pci_vtcon_init(struct vmctx *ctx, struct pci_devinst * while ((opt = strsep(&opts, ",")) != NULL) { portname = strsep(&opt, "="); - portpath = strdup(opt); + portpath = opt; /* create port */ if (pci_vtcon_sock_add(sc, portname, portpath) < 0) { From owner-svn-src-all@freebsd.org Thu May 9 22:42:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C080158FF85; Thu, 9 May 2019 22:42:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8A378589C; Thu, 9 May 2019 22:42:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3733237B7; Thu, 9 May 2019 22:42:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49MgNSN020488; Thu, 9 May 2019 22:42:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49MgNCk020487; Thu, 9 May 2019 22:42:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905092242.x49MgNCk020487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 9 May 2019 22:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347412 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 347412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8A378589C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 22:42:24 -0000 Author: jhb Date: Thu May 9 22:42:23 2019 New Revision: 347412 URL: https://svnweb.freebsd.org/changeset/base/347412 Log: MFC 334272: bhyve: guarantee NUL termination Use strlcpy to guarantee NUL termination of the path to a virtio console socket. Modified: stable/11/usr.sbin/bhyve/pci_virtio_console.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_virtio_console.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_virtio_console.c Thu May 9 22:39:24 2019 (r347411) +++ stable/11/usr.sbin/bhyve/pci_virtio_console.c Thu May 9 22:42:23 2019 (r347412) @@ -291,7 +291,7 @@ pci_vtcon_sock_add(struct pci_vtcon_softc *sc, const c sun.sun_family = AF_UNIX; sun.sun_len = sizeof(struct sockaddr_un); - strncpy(sun.sun_path, basename((char *)path), sizeof(sun.sun_path)); + strlcpy(sun.sun_path, basename((char *)path), sizeof(sun.sun_path)); if (bindat(fd, s, (struct sockaddr *)&sun, sun.sun_len) < 0) { error = -1; From owner-svn-src-all@freebsd.org Thu May 9 22:49:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03BA715900AE; Thu, 9 May 2019 22:49:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0B5A85BD5; Thu, 9 May 2019 22:49:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 791E8237C4; Thu, 9 May 2019 22:49:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49MnEVq020920; Thu, 9 May 2019 22:49:14 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49MnA5u020899; Thu, 9 May 2019 22:49:10 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201905092249.x49MnA5u020899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 9 May 2019 22:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347413 - in vendor-sys/acpica/dist: . source/compiler source/components/events source/include source/include/platform X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-sys/acpica/dist: . source/compiler source/components/events source/include source/include/platform X-SVN-Commit-Revision: 347413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0B5A85BD5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 22:49:15 -0000 Author: jkim Date: Thu May 9 22:49:10 2019 New Revision: 347413 URL: https://svnweb.freebsd.org/changeset/base/347413 Log: Import ACPICA 20190509. Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/source/compiler/aslcodegen.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmessages.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/asloperands.c vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/aslwalks.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/components/events/evgpe.c vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/platform/aclinux.h Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/changes.txt Thu May 9 22:49:10 2019 (r347413) @@ -1,4 +1,91 @@ ---------------------------------------- +09 May 2019. Summary of changes for version 20190509: + + +1) ACPICA kernel-resident subsystem: + +Revert commit 6c43e1a ("ACPICA: Clear status of GPEs before enabling +them") that causes problems with Thunderbolt controllers to occur if a +dock device is connected at init time (the xhci_hcd and thunderbolt +modules crash which prevents peripherals connected through them from +working). Commit 6c43e1a effectively causes commit ecc1165b8b74 ("ACPICA: +Dispatch active GPEs at init time") to get undone, so the problem +addressed by commit ecc1165b8b74 appears again as a result of it. + + +2) iASL Compiler/Disassembler and ACPICA tools: + +Reverted iASL: Additional forward reference detection. This change +reverts forward reference detection for field declarations. The feature +unintentionally emitted AML bytecode with incorrect package lengths for +some ASL code related to Fields and OperationRegions. This malformed AML +can cause systems to crash +during boot. The malformed AML bytecode is emitted in iASL version +20190329 and 20190405. + +iASL: improve forward reference detection. This change improves forward +reference detection for named objects inside of scopes. If a parse object +has the OP_NOT_FOUND_DURING_LOAD set, it means that Op is a reference to +a named object that is declared later in the AML bytecode. This is +allowed if the reference is inside of a method and the declaration is +outside of a method like so: + +DefinitionBlock(...) +{ + Method (TEST) + { + Return (NUM0) + } + Name (NUM0,0) +} + +However, if the declaration and reference are both in the same method or +outside any methods, this is a forward reference and should be marked as +an error because it would result in runtime errors. + +DefinitionBlock(...) +{ + Name (BUFF, Buffer (NUM0) {}) // Forward reference + Name (NUM0, 0x0) + + Method (TEST) + { + Local0 = NUM1 + Name (NUM1, 0x1) // Forward reference + return (Local0) + } +} + +iASL: Implemented additional buffer overflow analysis for BufferField +declarations. Check if a buffer index argument to a create buffer field +operation is beyond the end of the target buffer. + +This affects these AML operators: + + AML_CREATE_FIELD_OP + AML_CREATE_BIT_FIELD_OP + AML_CREATE_BYTE_FIELD_OP + AML_CREATE_WORD_FIELD_OP + AML_CREATE_DWORD_FIELD_OP + AML_CREATE_QWORD_FIELD_OP + + There are three conditions that must be satisfied in order to allow this +validation at compile time: + + 1) The length of the target buffer must be an integer constant + 2) The index specified in the create* must be an integer constant + 3) For CreateField, the bit length argument must be non-zero. + +Example: + Name (BUF1, Buffer() {1,2}) + CreateField (BUF1, 7, 9, CF03) // 3: ERR + +dsdt.asl 14: CreateField (BUF1, 7, 9, CF03) // 3: ERR +Error 6165 - ^ Buffer index beyond end of +target buffer + + +---------------------------------------- 05 April 2019. Summary of changes for version 20190405: Modified: vendor-sys/acpica/dist/source/compiler/aslcodegen.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcodegen.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslcodegen.c Thu May 9 22:49:10 2019 (r347413) @@ -690,7 +690,8 @@ CgUpdateHeader ( { if (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1) != AE_OK) { - printf ("EOF while reading checksum bytes\n"); + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL, + "Table length is greater than size of the input file"); return; } Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Thu May 9 22:49:10 2019 (r347413) @@ -224,7 +224,6 @@ CmDoCompile ( if (AslGbl_PreprocessOnly) { UtEndEvent (Event); - CmCleanupAndExit (); return (AE_OK); } } @@ -919,7 +918,7 @@ CmCleanupAndExit ( * We will delete the AML file if there are errors and the * force AML output option has not been used. */ - if (AslGbl_ParserErrorDetected || ((AslGbl_ExceptionCount[ASL_ERROR] > 0) && + if (AslGbl_ParserErrorDetected || AslGbl_PreprocessOnly || ((AslGbl_ExceptionCount[ASL_ERROR] > 0) && (!AslGbl_IgnoreErrors) && AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle)) { Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Thu May 9 22:49:10 2019 (r347413) @@ -1105,10 +1105,6 @@ ASL_GLOBAL_FILE_NODE * FlGetCurrentFileNode ( void); -BOOLEAN -FlInputFileExists ( - char *InputFilename); - /* * aslhwmap - hardware map summary Modified: vendor-sys/acpica/dist/source/compiler/aslerror.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslerror.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslerror.c Thu May 9 22:49:10 2019 (r347413) @@ -869,16 +869,8 @@ static void AslInitEnode ( return; } - if (!FlInputFileExists (Filename)) - { - /* - * This means that this file is an include file. Record the .src - * file as the error message source because this file is not in - * the global file list. - */ - Enode->SourceFilename = - FileNode->Files[ASL_FILE_SOURCE_OUTPUT].Filename; - } + Enode->SourceFilename = + FileNode->Files[ASL_FILE_SOURCE_OUTPUT].Filename; } } Modified: vendor-sys/acpica/dist/source/compiler/aslfiles.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfiles.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslfiles.c Thu May 9 22:49:10 2019 (r347413) @@ -163,6 +163,10 @@ FlOpenIncludeWithPrefix ( ACPI_PARSE_OBJECT *Op, char *Filename); +static BOOLEAN +FlInputFileExists ( + char *InputFilename); + #ifdef ACPI_OBSOLETE_FUNCTIONS ACPI_STATUS FlParseInputPathname ( @@ -250,7 +254,7 @@ FlInitOneFile ( * ******************************************************************************/ -BOOLEAN +static BOOLEAN FlInputFileExists ( char *Filename) { Modified: vendor-sys/acpica/dist/source/compiler/aslload.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslload.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslload.c Thu May 9 22:49:10 2019 (r347413) @@ -263,10 +263,29 @@ LdLoadFieldElements ( ACPI_WALK_STATE *WalkState) { ACPI_PARSE_OBJECT *Child = NULL; + ACPI_PARSE_OBJECT *SourceRegion; ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; + + SourceRegion = UtGetArg (Op, 0); + if (SourceRegion) + { + Status = AcpiNsLookup (WalkState->ScopeInfo, + SourceRegion->Asl.Value.String, + ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, + ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); + if (Status == AE_NOT_FOUND) + { + /* + * If the named object is not found, it means that it is either a + * forward reference or the named object does not exist. + */ + SourceRegion->Asl.CompileFlags |= OP_NOT_FOUND_DURING_LOAD; + } + } + /* Get the first named field element */ switch (Op->Asl.AmlOpcode) @@ -493,7 +512,7 @@ LdNamespace1Begin ( case AML_FIELD_OP: Status = LdLoadFieldElements (Op, WalkState); - break; + return (Status); case AML_INT_CONNECTION_OP: @@ -557,8 +576,7 @@ LdNamespace1Begin ( * We only want references to named objects: * Store (2, WXYZ) -> Attempt to resolve the name */ - if ((OpInfo->Class == AML_CLASS_NAMED_OBJECT) && - (OpInfo->Type != AML_TYPE_NAMED_FIELD)) + if (OpInfo->Class == AML_CLASS_NAMED_OBJECT) { return (AE_OK); } Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmain.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslmain.c Thu May 9 22:49:10 2019 (r347413) @@ -291,7 +291,8 @@ main ( /* * At this point, compilation of a data table or disassembly is complete. */ - if (AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA || AcpiGbl_DisasmFlag) + if (AslGbl_PreprocessOnly || AcpiGbl_DisasmFlag || + AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) { goto CleanupAndExit; } Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.c Thu May 9 22:49:10 2019 (r347413) @@ -283,7 +283,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_NO_RETVAL */ "Called method returns no value", /* ASL_MSG_NO_WHILE */ "No enclosing While statement", /* ASL_MSG_NON_ASCII */ "Invalid characters found in file", -/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", +/* ASL_MSG_BUFFER_FIELD_LENGTH */ "Field length must be non-zero", /* ASL_MSG_NOT_EXIST */ "Object does not exist", /* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from current scope", /* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke", @@ -342,7 +342,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_RANGE */ "Constant out of range", /* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer", /* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency", -/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Forward references are not supported by the ASL language", +/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference", /* ASL_MSG_ILLEGAL_METHOD_REF */ "Object is declared in a different method", /* ASL_MSG_LOCAL_NOT_USED */ "Method Local is set but never used", /* ASL_MSG_ARG_AS_LOCAL_NOT_USED */ "Method Argument (as a local) is set but never used", @@ -364,7 +364,8 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist", /* ASL_MSG_REGION_LENGTH */ "Operation Region declared with zero length", /* ASL_MSG_TEMPORARY_OBJECT */ "Object is created temporarily in another method and cannot be accessed", -/* ASL_MSG_UNDEFINED_EXTERNAL */ "Named object was declared external but the actual definition does not exist" +/* ASL_MSG_UNDEFINED_EXTERNAL */ "Named object was declared external but the actual definition does not exist", +/* ASL_MSG_BUFFER_FIELD_OVERFLOW */ "Buffer field extends beyond end of target buffer" }; /* Table compiler */ Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.h Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.h Thu May 9 22:49:10 2019 (r347413) @@ -285,7 +285,7 @@ typedef enum ASL_MSG_NO_RETVAL, ASL_MSG_NO_WHILE, ASL_MSG_NON_ASCII, - ASL_MSG_NON_ZERO, + ASL_MSG_BUFFER_FIELD_LENGTH, ASL_MSG_NOT_EXIST, ASL_MSG_NOT_FOUND, ASL_MSG_NOT_METHOD, @@ -367,6 +367,7 @@ typedef enum ASL_MSG_REGION_LENGTH, ASL_MSG_TEMPORARY_OBJECT, ASL_MSG_UNDEFINED_EXTERNAL, + ASL_MSG_BUFFER_FIELD_OVERFLOW, /* These messages are used by the Data Table compiler only */ Modified: vendor-sys/acpica/dist/source/compiler/asloperands.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloperands.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/asloperands.c Thu May 9 22:49:10 2019 (r347413) @@ -819,6 +819,7 @@ OpnDoBuffer ( BufferLengthOp->Asl.Value.Integer = BufferLength; (void) OpcSetOptimalIntegerSize (BufferLengthOp); + UtSetParseOpName (BufferLengthOp); /* Remaining nodes are handled via the tree walk */ } @@ -905,6 +906,7 @@ OpnDoPackage ( */ Op->Asl.Child->Asl.ParseOpcode = PARSEOP_INTEGER; Op->Asl.Child->Asl.Value.Integer = PackageLength; + UtSetParseOpName (Op); /* Set the AML opcode */ Modified: vendor-sys/acpica/dist/source/compiler/aslstartup.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslstartup.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslstartup.c Thu May 9 22:49:10 2019 (r347413) @@ -550,13 +550,9 @@ AslDoOneFile ( Status = CmDoCompile (); if (ACPI_FAILURE (Status)) { + PrTerminatePreprocessor (); return (Status); } - - /* Cleanup (for next source file) and exit */ - - AeClearErrorLog (); - PrTerminatePreprocessor (); /* * At this point, we know how many lines are in the input file. Save it Modified: vendor-sys/acpica/dist/source/compiler/aslutils.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslutils.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslutils.c Thu May 9 22:49:10 2019 (r347413) @@ -541,8 +541,14 @@ UtDisplayOneSummary ( { UINT32 i; ASL_GLOBAL_FILE_NODE *FileNode; + BOOLEAN DisplayAMLSummary; + DisplayAMLSummary = + !AslGbl_PreprocessOnly && !AslGbl_ParserErrorDetected && + ((AslGbl_ExceptionCount[ASL_ERROR] == 0) || AslGbl_IgnoreErrors) && + AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle; + if (FileId != ASL_FILE_STDOUT) { /* Compiler name and version number */ @@ -595,9 +601,7 @@ UtDisplayOneSummary ( /* AML summary */ - if (!AslGbl_ParserErrorDetected && - ((AslGbl_ExceptionCount[ASL_ERROR] == 0) || AslGbl_IgnoreErrors) && - AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle) + if (DisplayAMLSummary) { FlPrintFile (FileId, "%-14s %s - %7u bytes %6u opcodes %6u named objects\n", @@ -633,7 +637,7 @@ UtDisplayOneSummary ( continue; } - FlPrintFile (FileId, "%14s %s - %u bytes\n", + FlPrintFile (FileId, "%-14s %s - %7u bytes\n", AslGbl_FileDescs[i].ShortDescription, AslGbl_Files[i].Filename, FlGetFileSize (i)); } Modified: vendor-sys/acpica/dist/source/compiler/aslwalks.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslwalks.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslwalks.c Thu May 9 22:49:10 2019 (r347413) @@ -165,7 +165,15 @@ static void AnAnalyzeStoreOperator ( ACPI_PARSE_OBJECT *Op); +static BOOLEAN +AnIsValidBufferConstant ( + ACPI_PARSE_OBJECT *Op); +static void +AnValidateCreateBufferField ( + ACPI_PARSE_OBJECT *CreateBufferFieldOp); + + /******************************************************************************* * * FUNCTION: AnMethodTypingWalkEnd @@ -669,6 +677,14 @@ AnOtherSemanticAnalysisWalkBegin ( OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); + if (OpInfo->Flags & AML_CREATE) + { + /* This group contains all of the Create Buffer Field operators */ + + AnValidateCreateBufferField (Op); + return (AE_OK); + } + /* * Determine if an execution class operator actually does something by * checking if it has a target and/or the function return value is used. @@ -734,10 +750,10 @@ AnOtherSemanticAnalysisWalkBegin ( } } - /* * Semantic checks for individual ASL operators */ + switch (Op->Asl.ParseOpcode) { case PARSEOP_STORE: @@ -785,22 +801,6 @@ AnOtherSemanticAnalysisWalkBegin ( } break; - case PARSEOP_CREATEFIELD: - /* - * Check for a zero Length (NumBits) operand. NumBits is the 3rd operand - */ - ArgOp = Op->Asl.Child; - ArgOp = ArgOp->Asl.Next; - ArgOp = ArgOp->Asl.Next; - - if ((ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) || - ((ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) && - (ArgOp->Asl.Value.Integer == 0))) - { - AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgOp, NULL); - } - break; - case PARSEOP_CONNECTION: /* * Ensure that the referenced operation region has the correct SPACE_ID. @@ -883,6 +883,194 @@ AnOtherSemanticAnalysisWalkBegin ( } return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AnValidateCreateBufferField + * + * PARAMETERS: Op - A create buffer field operator + * + * RETURN: None + * + * DESCRIPTION: Check if a buffer index argument to a create buffer field + * operation is beyond the end of the target buffer. + * + * Validates these AML operators: + * + * AML_CREATE_FIELD_OP + * AML_CREATE_BIT_FIELD_OP + * AML_CREATE_BYTE_FIELD_OP + * AML_CREATE_WORD_FIELD_OP + * AML_CREATE_DWORD_FIELD_OP + * AML_CREATE_QWORD_FIELD_OP + * + * There are two conditions that must be satisfied in order to enable + * validation at compile time: + * + * 1) The length of the target buffer must be an integer constant + * 2) The index specified in the create* must be an integer constant + * 3) For CreateField, the bit length argument must be non-zero. + * + ******************************************************************************/ + +static void +AnValidateCreateBufferField ( + ACPI_PARSE_OBJECT *CreateBufferFieldOp) +{ + ACPI_PARSE_OBJECT *TargetBufferOp; + ACPI_PARSE_OBJECT *ArgOp; + UINT32 TargetBufferLength; + UINT32 LastFieldByteIndex; + + + /* + * 1) Get the length of the target buffer + */ + ArgOp = CreateBufferFieldOp->Asl.Child; /* Reference to target buffer */ + + /* + * If no attached Node, the target buffer may be something like an + * ArgX or LocalX and cannot be evaluated at compile time. + */ + if (!ArgOp->Asl.Node) + { + return; + } + + TargetBufferOp = ArgOp->Asl.Node->Op; + TargetBufferOp = TargetBufferOp->Asl.Child; /* Target buffer */ + TargetBufferOp = TargetBufferOp->Asl.Next; /* "Buffer" keyword */ + if (!TargetBufferOp) + { + /* Not a statement of the form NAME(XXXX, Buffer.... */ + + return; + } + + /* Get the buffer length argument. It must be an integer constant */ + + ArgOp = TargetBufferOp->Asl.Child; + if (!AnIsValidBufferConstant (ArgOp)) + { + return; + } + + TargetBufferLength = (UINT32) ArgOp->Asl.Value.Integer; + + /* + * 2) Get the value of the buffer index argument. It must be + * an integer constant. + */ + ArgOp = CreateBufferFieldOp->Asl.Child; /* Reference to target buffer */ + ArgOp = ArgOp->Asl.Next; /* Buffer Index argument*/ + if (!AnIsValidBufferConstant (ArgOp)) + { + return; + } + + LastFieldByteIndex = + (UINT32) ArgOp->Asl.Value.Integer; /* Index can be in either bytes or bits */ + + /* + * 3) Get the length of the new buffer field, in bytes. Also, + * create the final target buffer index for the last byte of the field + */ + switch (CreateBufferFieldOp->Asl.ParseOpcode) + { + case PARSEOP_CREATEBITFIELD: /* A one bit field */ + + LastFieldByteIndex = ACPI_ROUND_BITS_DOWN_TO_BYTES (LastFieldByteIndex); + break; + + case PARSEOP_CREATEBYTEFIELD: + break; + + case PARSEOP_CREATEWORDFIELD: + + LastFieldByteIndex += (sizeof (UINT16) - 1); + break; + + case PARSEOP_CREATEDWORDFIELD: + + LastFieldByteIndex += (sizeof (UINT32) - 1); + break; + + case PARSEOP_CREATEQWORDFIELD: + + LastFieldByteIndex += (sizeof (UINT64) - 1); + break; + + case PARSEOP_CREATEFIELD: /* Multi-bit field */ + + ArgOp = ArgOp->Asl.Next; /* Length argument, in bits */ + if (!AnIsValidBufferConstant (ArgOp)) + { + return; + } + + /* The buffer field length is not allowed to be zero */ + + if (ArgOp->Asl.Value.Integer == 0) + { + AslError (ASL_WARNING, ASL_MSG_BUFFER_FIELD_LENGTH, ArgOp, NULL); + return; + } + + LastFieldByteIndex += + ((UINT32) ArgOp->Asl.Value.Integer - 1); /* Create final bit index */ + + /* Convert bit index to a byte index */ + + LastFieldByteIndex = ACPI_ROUND_BITS_DOWN_TO_BYTES (LastFieldByteIndex); + break; + + default: + return; + } + + /* + * 4) Check for an access (index) beyond the end of the target buffer, + * or a zero length target buffer. + */ + if (!TargetBufferLength || (LastFieldByteIndex >= TargetBufferLength)) + { + AslError (ASL_WARNING, ASL_MSG_BUFFER_FIELD_OVERFLOW, ArgOp, NULL); + } +} + + +/******************************************************************************* + * + * FUNCTION: AnIsValidBufferConstant + * + * PARAMETERS: Op - A buffer-related operand + * + * RETURN: TRUE if operand is valid constant, FALSE otherwise + * + * DESCRIPTION: Check if the input Op is valid constant that can be used + * in compile-time analysis. + * + ******************************************************************************/ + +static BOOLEAN +AnIsValidBufferConstant ( + ACPI_PARSE_OBJECT *Op) +{ + if (!Op) + { + return (FALSE); + } + + if ((Op->Asl.ParseOpcode == PARSEOP_INTEGER) || + (Op->Asl.ParseOpcode == PARSEOP_ZERO) || + (Op->Asl.ParseOpcode == PARSEOP_ONE)) + { + return (TRUE); + } + + return (FALSE); } Modified: vendor-sys/acpica/dist/source/compiler/aslxref.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslxref.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/compiler/aslxref.c Thu May 9 22:49:10 2019 (r347413) @@ -460,6 +460,8 @@ XfNamespaceLocateBegin ( ASL_METHOD_LOCAL *MethodArgs = NULL; int RegisterNumber; UINT32 i; + ACPI_NAMESPACE_NODE *DeclarationParentMethod; + ACPI_PARSE_OBJECT *ReferenceParentMethod; ACPI_FUNCTION_TRACE_PTR (XfNamespaceLocateBegin, Op); @@ -613,8 +615,7 @@ XfNamespaceLocateBegin ( (Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) && (Op->Asl.ParseOpcode != PARSEOP_NAMESEG) && (Op->Asl.ParseOpcode != PARSEOP_METHODCALL) && - (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL) && - (OpInfo->Type != AML_TYPE_NAMED_FIELD)) + (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL)) { return_ACPI_STATUS (AE_OK); } @@ -638,8 +639,7 @@ XfNamespaceLocateBegin ( if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) || (Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || (Op->Asl.ParseOpcode == PARSEOP_METHODCALL) || - (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) || - (OpInfo->Type == AML_TYPE_NAMED_FIELD)) + (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)) { /* * These are name references, do not push the scope stack @@ -676,10 +676,6 @@ XfNamespaceLocateBegin ( Path = NextOp->Asl.Value.String; } - else if (OpInfo->Type == AML_TYPE_NAMED_FIELD) - { - Path = Op->Asl.Child->Asl.Value.String; - } else { Path = Op->Asl.Value.String; @@ -798,22 +794,43 @@ XfNamespaceLocateBegin ( return_ACPI_STATUS (Status); } - /* Object was found above, check for an illegal forward reference */ + /* Object was found above, check for an illegal forward reference */ if (Op->Asl.CompileFlags & OP_NOT_FOUND_DURING_LOAD) { /* * During the load phase, this Op was flagged as a possible - * illegal forward reference + * illegal forward reference. In other words, Op is a name path or + * name segment that refers to a named object declared after the + * reference. In this scinario, Node refers to the actual declaration + * and Op is a parse node that references the named object. * - * Note: Allow "forward references" from within a method to an - * object that is not within any method (module-level code) + * Note: + * + * Object references inside of control methods are allowed to + * refer to objects declared outside of control methods. + * + * If the declaration and reference are both contained inside of the + * same method or outside of any method, this is a forward reference + * and should be reported as a compiler error. */ - if (!WalkState->ScopeInfo || (UtGetParentMethod (Node) && - !UtNodeIsDescendantOf (WalkState->ScopeInfo->Scope.Node, - UtGetParentMethod (Node)))) + DeclarationParentMethod = UtGetParentMethod (Node); + ReferenceParentMethod = XfGetParentMethod (Op); + + /* case 1: declaration and refrence are both outside of method */ + + if (!ReferenceParentMethod && !DeclarationParentMethod) { AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op, + Op->Asl.ExternalName); + } + + /* case 2: declaration and reference are both inside of the same method */ + + else if (ReferenceParentMethod && DeclarationParentMethod && + ReferenceParentMethod == DeclarationParentMethod->Op) + { + AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op, Op->Asl.ExternalName); } } Modified: vendor-sys/acpica/dist/source/components/events/evgpe.c ============================================================================== --- vendor-sys/acpica/dist/source/components/events/evgpe.c Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/components/events/evgpe.c Thu May 9 22:49:10 2019 (r347413) @@ -240,14 +240,6 @@ AcpiEvEnableGpe ( ACPI_FUNCTION_TRACE (EvEnableGpe); - /* Clear the GPE (of stale events) */ - - Status = AcpiHwClearGpe(GpeEventInfo); - if (ACPI_FAILURE(Status)) - { - return_ACPI_STATUS(Status); - } - /* Enable the requested GPE */ Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE); Modified: vendor-sys/acpica/dist/source/include/acpixf.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acpixf.h Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/include/acpixf.h Thu May 9 22:49:10 2019 (r347413) @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20190405 +#define ACPI_CA_VERSION 0x20190509 #include "acconfig.h" #include "actypes.h" Modified: vendor-sys/acpica/dist/source/include/platform/aclinux.h ============================================================================== --- vendor-sys/acpica/dist/source/include/platform/aclinux.h Thu May 9 22:42:23 2019 (r347412) +++ vendor-sys/acpica/dist/source/include/platform/aclinux.h Thu May 9 22:49:10 2019 (r347413) @@ -205,6 +205,11 @@ #define ACPI_INIT_FUNCTION __init +/* Use a specific bugging default separate from ACPICA */ + +#undef ACPI_DEBUG_DEFAULT +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INFO | ACPI_LV_REPAIR) + #ifndef CONFIG_ACPI /* External globals for __KERNEL__, stubs is needed */ @@ -220,11 +225,6 @@ #define ACPI_NO_ERROR_MESSAGES #undef ACPI_DEBUG_OUTPUT - -/* Use a specific bugging default separate from ACPICA */ - -#undef ACPI_DEBUG_DEFAULT -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INFO | ACPI_LV_REPAIR) /* External interface for __KERNEL__, stub is needed */ From owner-svn-src-all@freebsd.org Thu May 9 22:49:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EBD815900FA; Thu, 9 May 2019 22:49:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 237D885CF1; Thu, 9 May 2019 22:49:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3A17237C5; Thu, 9 May 2019 22:49:58 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49MnwCV021006; Thu, 9 May 2019 22:49:58 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49Mnwfd021005; Thu, 9 May 2019 22:49:58 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201905092249.x49Mnwfd021005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 9 May 2019 22:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347414 - vendor-sys/acpica/20190509 X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-sys/acpica/20190509 X-SVN-Commit-Revision: 347414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 237D885CF1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 22:49:59 -0000 Author: jkim Date: Thu May 9 22:49:58 2019 New Revision: 347414 URL: https://svnweb.freebsd.org/changeset/base/347414 Log: Tag ACPICA 20190509. Added: vendor-sys/acpica/20190509/ - copied from r347413, vendor-sys/acpica/dist/ From owner-svn-src-all@freebsd.org Thu May 9 23:03:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 247B21590585; Thu, 9 May 2019 23:03:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB372863CA; Thu, 9 May 2019 23:03:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A544823B01; Thu, 9 May 2019 23:03:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49N3EBt031571; Thu, 9 May 2019 23:03:14 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49N3At6031551; Thu, 9 May 2019 23:03:10 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201905092303.x49N3At6031551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 9 May 2019 23:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347415 - in head/sys/contrib/dev/acpica: . compiler components/events include X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys/contrib/dev/acpica: . compiler components/events include X-SVN-Commit-Revision: 347415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CB372863CA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 23:03:15 -0000 Author: jkim Date: Thu May 9 23:03:10 2019 New Revision: 347415 URL: https://svnweb.freebsd.org/changeset/base/347415 Log: MFV: r347413 Import ACPICA 20190509. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/aslwalks.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/include/acpixf.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/changes.txt Thu May 9 23:03:10 2019 (r347415) @@ -1,4 +1,91 @@ ---------------------------------------- +09 May 2019. Summary of changes for version 20190509: + + +1) ACPICA kernel-resident subsystem: + +Revert commit 6c43e1a ("ACPICA: Clear status of GPEs before enabling +them") that causes problems with Thunderbolt controllers to occur if a +dock device is connected at init time (the xhci_hcd and thunderbolt +modules crash which prevents peripherals connected through them from +working). Commit 6c43e1a effectively causes commit ecc1165b8b74 ("ACPICA: +Dispatch active GPEs at init time") to get undone, so the problem +addressed by commit ecc1165b8b74 appears again as a result of it. + + +2) iASL Compiler/Disassembler and ACPICA tools: + +Reverted iASL: Additional forward reference detection. This change +reverts forward reference detection for field declarations. The feature +unintentionally emitted AML bytecode with incorrect package lengths for +some ASL code related to Fields and OperationRegions. This malformed AML +can cause systems to crash +during boot. The malformed AML bytecode is emitted in iASL version +20190329 and 20190405. + +iASL: improve forward reference detection. This change improves forward +reference detection for named objects inside of scopes. If a parse object +has the OP_NOT_FOUND_DURING_LOAD set, it means that Op is a reference to +a named object that is declared later in the AML bytecode. This is +allowed if the reference is inside of a method and the declaration is +outside of a method like so: + +DefinitionBlock(...) +{ + Method (TEST) + { + Return (NUM0) + } + Name (NUM0,0) +} + +However, if the declaration and reference are both in the same method or +outside any methods, this is a forward reference and should be marked as +an error because it would result in runtime errors. + +DefinitionBlock(...) +{ + Name (BUFF, Buffer (NUM0) {}) // Forward reference + Name (NUM0, 0x0) + + Method (TEST) + { + Local0 = NUM1 + Name (NUM1, 0x1) // Forward reference + return (Local0) + } +} + +iASL: Implemented additional buffer overflow analysis for BufferField +declarations. Check if a buffer index argument to a create buffer field +operation is beyond the end of the target buffer. + +This affects these AML operators: + + AML_CREATE_FIELD_OP + AML_CREATE_BIT_FIELD_OP + AML_CREATE_BYTE_FIELD_OP + AML_CREATE_WORD_FIELD_OP + AML_CREATE_DWORD_FIELD_OP + AML_CREATE_QWORD_FIELD_OP + + There are three conditions that must be satisfied in order to allow this +validation at compile time: + + 1) The length of the target buffer must be an integer constant + 2) The index specified in the create* must be an integer constant + 3) For CreateField, the bit length argument must be non-zero. + +Example: + Name (BUF1, Buffer() {1,2}) + CreateField (BUF1, 7, 9, CF03) // 3: ERR + +dsdt.asl 14: CreateField (BUF1, 7, 9, CF03) // 3: ERR +Error 6165 - ^ Buffer index beyond end of +target buffer + + +---------------------------------------- 05 April 2019. Summary of changes for version 20190405: Modified: head/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcodegen.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslcodegen.c Thu May 9 23:03:10 2019 (r347415) @@ -690,7 +690,8 @@ CgUpdateHeader ( { if (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1) != AE_OK) { - printf ("EOF while reading checksum bytes\n"); + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL, + "Table length is greater than size of the input file"); return; } Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu May 9 23:03:10 2019 (r347415) @@ -224,7 +224,6 @@ CmDoCompile ( if (AslGbl_PreprocessOnly) { UtEndEvent (Event); - CmCleanupAndExit (); return (AE_OK); } } @@ -919,7 +918,7 @@ CmCleanupAndExit ( * We will delete the AML file if there are errors and the * force AML output option has not been used. */ - if (AslGbl_ParserErrorDetected || ((AslGbl_ExceptionCount[ASL_ERROR] > 0) && + if (AslGbl_ParserErrorDetected || AslGbl_PreprocessOnly || ((AslGbl_ExceptionCount[ASL_ERROR] > 0) && (!AslGbl_IgnoreErrors) && AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle)) { Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu May 9 23:03:10 2019 (r347415) @@ -1105,10 +1105,6 @@ ASL_GLOBAL_FILE_NODE * FlGetCurrentFileNode ( void); -BOOLEAN -FlInputFileExists ( - char *InputFilename); - /* * aslhwmap - hardware map summary Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Thu May 9 23:03:10 2019 (r347415) @@ -869,16 +869,8 @@ static void AslInitEnode ( return; } - if (!FlInputFileExists (Filename)) - { - /* - * This means that this file is an include file. Record the .src - * file as the error message source because this file is not in - * the global file list. - */ - Enode->SourceFilename = - FileNode->Files[ASL_FILE_SOURCE_OUTPUT].Filename; - } + Enode->SourceFilename = + FileNode->Files[ASL_FILE_SOURCE_OUTPUT].Filename; } } Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu May 9 23:03:10 2019 (r347415) @@ -163,6 +163,10 @@ FlOpenIncludeWithPrefix ( ACPI_PARSE_OBJECT *Op, char *Filename); +static BOOLEAN +FlInputFileExists ( + char *InputFilename); + #ifdef ACPI_OBSOLETE_FUNCTIONS ACPI_STATUS FlParseInputPathname ( @@ -250,7 +254,7 @@ FlInitOneFile ( * ******************************************************************************/ -BOOLEAN +static BOOLEAN FlInputFileExists ( char *Filename) { Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Thu May 9 23:03:10 2019 (r347415) @@ -263,10 +263,29 @@ LdLoadFieldElements ( ACPI_WALK_STATE *WalkState) { ACPI_PARSE_OBJECT *Child = NULL; + ACPI_PARSE_OBJECT *SourceRegion; ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; + + SourceRegion = UtGetArg (Op, 0); + if (SourceRegion) + { + Status = AcpiNsLookup (WalkState->ScopeInfo, + SourceRegion->Asl.Value.String, + ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, + ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); + if (Status == AE_NOT_FOUND) + { + /* + * If the named object is not found, it means that it is either a + * forward reference or the named object does not exist. + */ + SourceRegion->Asl.CompileFlags |= OP_NOT_FOUND_DURING_LOAD; + } + } + /* Get the first named field element */ switch (Op->Asl.AmlOpcode) @@ -493,7 +512,7 @@ LdNamespace1Begin ( case AML_FIELD_OP: Status = LdLoadFieldElements (Op, WalkState); - break; + return (Status); case AML_INT_CONNECTION_OP: @@ -557,8 +576,7 @@ LdNamespace1Begin ( * We only want references to named objects: * Store (2, WXYZ) -> Attempt to resolve the name */ - if ((OpInfo->Class == AML_CLASS_NAMED_OBJECT) && - (OpInfo->Type != AML_TYPE_NAMED_FIELD)) + if (OpInfo->Class == AML_CLASS_NAMED_OBJECT) { return (AE_OK); } Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Thu May 9 23:03:10 2019 (r347415) @@ -291,7 +291,8 @@ main ( /* * At this point, compilation of a data table or disassembly is complete. */ - if (AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA || AcpiGbl_DisasmFlag) + if (AslGbl_PreprocessOnly || AcpiGbl_DisasmFlag || + AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) { goto CleanupAndExit; } Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.c Thu May 9 23:03:10 2019 (r347415) @@ -283,7 +283,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_NO_RETVAL */ "Called method returns no value", /* ASL_MSG_NO_WHILE */ "No enclosing While statement", /* ASL_MSG_NON_ASCII */ "Invalid characters found in file", -/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", +/* ASL_MSG_BUFFER_FIELD_LENGTH */ "Field length must be non-zero", /* ASL_MSG_NOT_EXIST */ "Object does not exist", /* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from current scope", /* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke", @@ -342,7 +342,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_RANGE */ "Constant out of range", /* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer", /* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency", -/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Forward references are not supported by the ASL language", +/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference", /* ASL_MSG_ILLEGAL_METHOD_REF */ "Object is declared in a different method", /* ASL_MSG_LOCAL_NOT_USED */ "Method Local is set but never used", /* ASL_MSG_ARG_AS_LOCAL_NOT_USED */ "Method Argument (as a local) is set but never used", @@ -364,7 +364,8 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist", /* ASL_MSG_REGION_LENGTH */ "Operation Region declared with zero length", /* ASL_MSG_TEMPORARY_OBJECT */ "Object is created temporarily in another method and cannot be accessed", -/* ASL_MSG_UNDEFINED_EXTERNAL */ "Named object was declared external but the actual definition does not exist" +/* ASL_MSG_UNDEFINED_EXTERNAL */ "Named object was declared external but the actual definition does not exist", +/* ASL_MSG_BUFFER_FIELD_OVERFLOW */ "Buffer field extends beyond end of target buffer" }; /* Table compiler */ Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Thu May 9 23:03:10 2019 (r347415) @@ -285,7 +285,7 @@ typedef enum ASL_MSG_NO_RETVAL, ASL_MSG_NO_WHILE, ASL_MSG_NON_ASCII, - ASL_MSG_NON_ZERO, + ASL_MSG_BUFFER_FIELD_LENGTH, ASL_MSG_NOT_EXIST, ASL_MSG_NOT_FOUND, ASL_MSG_NOT_METHOD, @@ -367,6 +367,7 @@ typedef enum ASL_MSG_REGION_LENGTH, ASL_MSG_TEMPORARY_OBJECT, ASL_MSG_UNDEFINED_EXTERNAL, + ASL_MSG_BUFFER_FIELD_OVERFLOW, /* These messages are used by the Data Table compiler only */ Modified: head/sys/contrib/dev/acpica/compiler/asloperands.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloperands.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/asloperands.c Thu May 9 23:03:10 2019 (r347415) @@ -819,6 +819,7 @@ OpnDoBuffer ( BufferLengthOp->Asl.Value.Integer = BufferLength; (void) OpcSetOptimalIntegerSize (BufferLengthOp); + UtSetParseOpName (BufferLengthOp); /* Remaining nodes are handled via the tree walk */ } @@ -905,6 +906,7 @@ OpnDoPackage ( */ Op->Asl.Child->Asl.ParseOpcode = PARSEOP_INTEGER; Op->Asl.Child->Asl.Value.Integer = PackageLength; + UtSetParseOpName (Op); /* Set the AML opcode */ Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Thu May 9 23:03:10 2019 (r347415) @@ -550,13 +550,9 @@ AslDoOneFile ( Status = CmDoCompile (); if (ACPI_FAILURE (Status)) { + PrTerminatePreprocessor (); return (Status); } - - /* Cleanup (for next source file) and exit */ - - AeClearErrorLog (); - PrTerminatePreprocessor (); /* * At this point, we know how many lines are in the input file. Save it Modified: head/sys/contrib/dev/acpica/compiler/aslutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslutils.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslutils.c Thu May 9 23:03:10 2019 (r347415) @@ -541,8 +541,14 @@ UtDisplayOneSummary ( { UINT32 i; ASL_GLOBAL_FILE_NODE *FileNode; + BOOLEAN DisplayAMLSummary; + DisplayAMLSummary = + !AslGbl_PreprocessOnly && !AslGbl_ParserErrorDetected && + ((AslGbl_ExceptionCount[ASL_ERROR] == 0) || AslGbl_IgnoreErrors) && + AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle; + if (FileId != ASL_FILE_STDOUT) { /* Compiler name and version number */ @@ -595,9 +601,7 @@ UtDisplayOneSummary ( /* AML summary */ - if (!AslGbl_ParserErrorDetected && - ((AslGbl_ExceptionCount[ASL_ERROR] == 0) || AslGbl_IgnoreErrors) && - AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle) + if (DisplayAMLSummary) { FlPrintFile (FileId, "%-14s %s - %7u bytes %6u opcodes %6u named objects\n", @@ -633,7 +637,7 @@ UtDisplayOneSummary ( continue; } - FlPrintFile (FileId, "%14s %s - %u bytes\n", + FlPrintFile (FileId, "%-14s %s - %7u bytes\n", AslGbl_FileDescs[i].ShortDescription, AslGbl_Files[i].Filename, FlGetFileSize (i)); } Modified: head/sys/contrib/dev/acpica/compiler/aslwalks.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslwalks.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslwalks.c Thu May 9 23:03:10 2019 (r347415) @@ -165,7 +165,15 @@ static void AnAnalyzeStoreOperator ( ACPI_PARSE_OBJECT *Op); +static BOOLEAN +AnIsValidBufferConstant ( + ACPI_PARSE_OBJECT *Op); +static void +AnValidateCreateBufferField ( + ACPI_PARSE_OBJECT *CreateBufferFieldOp); + + /******************************************************************************* * * FUNCTION: AnMethodTypingWalkEnd @@ -669,6 +677,14 @@ AnOtherSemanticAnalysisWalkBegin ( OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); + if (OpInfo->Flags & AML_CREATE) + { + /* This group contains all of the Create Buffer Field operators */ + + AnValidateCreateBufferField (Op); + return (AE_OK); + } + /* * Determine if an execution class operator actually does something by * checking if it has a target and/or the function return value is used. @@ -734,10 +750,10 @@ AnOtherSemanticAnalysisWalkBegin ( } } - /* * Semantic checks for individual ASL operators */ + switch (Op->Asl.ParseOpcode) { case PARSEOP_STORE: @@ -785,22 +801,6 @@ AnOtherSemanticAnalysisWalkBegin ( } break; - case PARSEOP_CREATEFIELD: - /* - * Check for a zero Length (NumBits) operand. NumBits is the 3rd operand - */ - ArgOp = Op->Asl.Child; - ArgOp = ArgOp->Asl.Next; - ArgOp = ArgOp->Asl.Next; - - if ((ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) || - ((ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) && - (ArgOp->Asl.Value.Integer == 0))) - { - AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgOp, NULL); - } - break; - case PARSEOP_CONNECTION: /* * Ensure that the referenced operation region has the correct SPACE_ID. @@ -883,6 +883,194 @@ AnOtherSemanticAnalysisWalkBegin ( } return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AnValidateCreateBufferField + * + * PARAMETERS: Op - A create buffer field operator + * + * RETURN: None + * + * DESCRIPTION: Check if a buffer index argument to a create buffer field + * operation is beyond the end of the target buffer. + * + * Validates these AML operators: + * + * AML_CREATE_FIELD_OP + * AML_CREATE_BIT_FIELD_OP + * AML_CREATE_BYTE_FIELD_OP + * AML_CREATE_WORD_FIELD_OP + * AML_CREATE_DWORD_FIELD_OP + * AML_CREATE_QWORD_FIELD_OP + * + * There are two conditions that must be satisfied in order to enable + * validation at compile time: + * + * 1) The length of the target buffer must be an integer constant + * 2) The index specified in the create* must be an integer constant + * 3) For CreateField, the bit length argument must be non-zero. + * + ******************************************************************************/ + +static void +AnValidateCreateBufferField ( + ACPI_PARSE_OBJECT *CreateBufferFieldOp) +{ + ACPI_PARSE_OBJECT *TargetBufferOp; + ACPI_PARSE_OBJECT *ArgOp; + UINT32 TargetBufferLength; + UINT32 LastFieldByteIndex; + + + /* + * 1) Get the length of the target buffer + */ + ArgOp = CreateBufferFieldOp->Asl.Child; /* Reference to target buffer */ + + /* + * If no attached Node, the target buffer may be something like an + * ArgX or LocalX and cannot be evaluated at compile time. + */ + if (!ArgOp->Asl.Node) + { + return; + } + + TargetBufferOp = ArgOp->Asl.Node->Op; + TargetBufferOp = TargetBufferOp->Asl.Child; /* Target buffer */ + TargetBufferOp = TargetBufferOp->Asl.Next; /* "Buffer" keyword */ + if (!TargetBufferOp) + { + /* Not a statement of the form NAME(XXXX, Buffer.... */ + + return; + } + + /* Get the buffer length argument. It must be an integer constant */ + + ArgOp = TargetBufferOp->Asl.Child; + if (!AnIsValidBufferConstant (ArgOp)) + { + return; + } + + TargetBufferLength = (UINT32) ArgOp->Asl.Value.Integer; + + /* + * 2) Get the value of the buffer index argument. It must be + * an integer constant. + */ + ArgOp = CreateBufferFieldOp->Asl.Child; /* Reference to target buffer */ + ArgOp = ArgOp->Asl.Next; /* Buffer Index argument*/ + if (!AnIsValidBufferConstant (ArgOp)) + { + return; + } + + LastFieldByteIndex = + (UINT32) ArgOp->Asl.Value.Integer; /* Index can be in either bytes or bits */ + + /* + * 3) Get the length of the new buffer field, in bytes. Also, + * create the final target buffer index for the last byte of the field + */ + switch (CreateBufferFieldOp->Asl.ParseOpcode) + { + case PARSEOP_CREATEBITFIELD: /* A one bit field */ + + LastFieldByteIndex = ACPI_ROUND_BITS_DOWN_TO_BYTES (LastFieldByteIndex); + break; + + case PARSEOP_CREATEBYTEFIELD: + break; + + case PARSEOP_CREATEWORDFIELD: + + LastFieldByteIndex += (sizeof (UINT16) - 1); + break; + + case PARSEOP_CREATEDWORDFIELD: + + LastFieldByteIndex += (sizeof (UINT32) - 1); + break; + + case PARSEOP_CREATEQWORDFIELD: + + LastFieldByteIndex += (sizeof (UINT64) - 1); + break; + + case PARSEOP_CREATEFIELD: /* Multi-bit field */ + + ArgOp = ArgOp->Asl.Next; /* Length argument, in bits */ + if (!AnIsValidBufferConstant (ArgOp)) + { + return; + } + + /* The buffer field length is not allowed to be zero */ + + if (ArgOp->Asl.Value.Integer == 0) + { + AslError (ASL_WARNING, ASL_MSG_BUFFER_FIELD_LENGTH, ArgOp, NULL); + return; + } + + LastFieldByteIndex += + ((UINT32) ArgOp->Asl.Value.Integer - 1); /* Create final bit index */ + + /* Convert bit index to a byte index */ + + LastFieldByteIndex = ACPI_ROUND_BITS_DOWN_TO_BYTES (LastFieldByteIndex); + break; + + default: + return; + } + + /* + * 4) Check for an access (index) beyond the end of the target buffer, + * or a zero length target buffer. + */ + if (!TargetBufferLength || (LastFieldByteIndex >= TargetBufferLength)) + { + AslError (ASL_WARNING, ASL_MSG_BUFFER_FIELD_OVERFLOW, ArgOp, NULL); + } +} + + +/******************************************************************************* + * + * FUNCTION: AnIsValidBufferConstant + * + * PARAMETERS: Op - A buffer-related operand + * + * RETURN: TRUE if operand is valid constant, FALSE otherwise + * + * DESCRIPTION: Check if the input Op is valid constant that can be used + * in compile-time analysis. + * + ******************************************************************************/ + +static BOOLEAN +AnIsValidBufferConstant ( + ACPI_PARSE_OBJECT *Op) +{ + if (!Op) + { + return (FALSE); + } + + if ((Op->Asl.ParseOpcode == PARSEOP_INTEGER) || + (Op->Asl.ParseOpcode == PARSEOP_ZERO) || + (Op->Asl.ParseOpcode == PARSEOP_ONE)) + { + return (TRUE); + } + + return (FALSE); } Modified: head/sys/contrib/dev/acpica/compiler/aslxref.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslxref.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/compiler/aslxref.c Thu May 9 23:03:10 2019 (r347415) @@ -460,6 +460,8 @@ XfNamespaceLocateBegin ( ASL_METHOD_LOCAL *MethodArgs = NULL; int RegisterNumber; UINT32 i; + ACPI_NAMESPACE_NODE *DeclarationParentMethod; + ACPI_PARSE_OBJECT *ReferenceParentMethod; ACPI_FUNCTION_TRACE_PTR (XfNamespaceLocateBegin, Op); @@ -613,8 +615,7 @@ XfNamespaceLocateBegin ( (Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) && (Op->Asl.ParseOpcode != PARSEOP_NAMESEG) && (Op->Asl.ParseOpcode != PARSEOP_METHODCALL) && - (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL) && - (OpInfo->Type != AML_TYPE_NAMED_FIELD)) + (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL)) { return_ACPI_STATUS (AE_OK); } @@ -638,8 +639,7 @@ XfNamespaceLocateBegin ( if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) || (Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || (Op->Asl.ParseOpcode == PARSEOP_METHODCALL) || - (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) || - (OpInfo->Type == AML_TYPE_NAMED_FIELD)) + (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)) { /* * These are name references, do not push the scope stack @@ -676,10 +676,6 @@ XfNamespaceLocateBegin ( Path = NextOp->Asl.Value.String; } - else if (OpInfo->Type == AML_TYPE_NAMED_FIELD) - { - Path = Op->Asl.Child->Asl.Value.String; - } else { Path = Op->Asl.Value.String; @@ -798,22 +794,43 @@ XfNamespaceLocateBegin ( return_ACPI_STATUS (Status); } - /* Object was found above, check for an illegal forward reference */ + /* Object was found above, check for an illegal forward reference */ if (Op->Asl.CompileFlags & OP_NOT_FOUND_DURING_LOAD) { /* * During the load phase, this Op was flagged as a possible - * illegal forward reference + * illegal forward reference. In other words, Op is a name path or + * name segment that refers to a named object declared after the + * reference. In this scinario, Node refers to the actual declaration + * and Op is a parse node that references the named object. * - * Note: Allow "forward references" from within a method to an - * object that is not within any method (module-level code) + * Note: + * + * Object references inside of control methods are allowed to + * refer to objects declared outside of control methods. + * + * If the declaration and reference are both contained inside of the + * same method or outside of any method, this is a forward reference + * and should be reported as a compiler error. */ - if (!WalkState->ScopeInfo || (UtGetParentMethod (Node) && - !UtNodeIsDescendantOf (WalkState->ScopeInfo->Scope.Node, - UtGetParentMethod (Node)))) + DeclarationParentMethod = UtGetParentMethod (Node); + ReferenceParentMethod = XfGetParentMethod (Op); + + /* case 1: declaration and refrence are both outside of method */ + + if (!ReferenceParentMethod && !DeclarationParentMethod) { AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op, + Op->Asl.ExternalName); + } + + /* case 2: declaration and reference are both inside of the same method */ + + else if (ReferenceParentMethod && DeclarationParentMethod && + ReferenceParentMethod == DeclarationParentMethod->Op) + { + AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op, Op->Asl.ExternalName); } } Modified: head/sys/contrib/dev/acpica/components/events/evgpe.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evgpe.c Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/components/events/evgpe.c Thu May 9 23:03:10 2019 (r347415) @@ -240,14 +240,6 @@ AcpiEvEnableGpe ( ACPI_FUNCTION_TRACE (EvEnableGpe); - /* Clear the GPE (of stale events) */ - - Status = AcpiHwClearGpe(GpeEventInfo); - if (ACPI_FAILURE(Status)) - { - return_ACPI_STATUS(Status); - } - /* Enable the requested GPE */ Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE); Modified: head/sys/contrib/dev/acpica/include/acpixf.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acpixf.h Thu May 9 22:49:58 2019 (r347414) +++ head/sys/contrib/dev/acpica/include/acpixf.h Thu May 9 23:03:10 2019 (r347415) @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20190405 +#define ACPI_CA_VERSION 0x20190509 #include #include From owner-svn-src-all@freebsd.org Thu May 9 23:57:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF17215914F8; Thu, 9 May 2019 23:57:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5302F878B2; Thu, 9 May 2019 23:57:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A05B24362; Thu, 9 May 2019 23:57:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x49Nv32s057327; Thu, 9 May 2019 23:57:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x49Nv2pw057324; Thu, 9 May 2019 23:57:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905092357.x49Nv2pw057324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 9 May 2019 23:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347416 - in stable/11/sys/amd64: include vmm vmm/intel X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11/sys/amd64: include vmm vmm/intel X-SVN-Commit-Revision: 347416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5302F878B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2019 23:57:03 -0000 Author: jhb Date: Thu May 9 23:57:02 2019 New Revision: 347416 URL: https://svnweb.freebsd.org/changeset/base/347416 Log: MFC 332479: Add SDT probes to vmexit on Intel. Modified: stable/11/sys/amd64/include/vmm.h stable/11/sys/amd64/vmm/intel/vmx.c stable/11/sys/amd64/vmm/vmm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/include/vmm.h ============================================================================== --- stable/11/sys/amd64/include/vmm.h Thu May 9 23:03:10 2019 (r347415) +++ stable/11/sys/amd64/include/vmm.h Thu May 9 23:57:02 2019 (r347416) @@ -29,7 +29,12 @@ #ifndef _VMM_H_ #define _VMM_H_ +#include #include + +#ifdef _KERNEL +SDT_PROVIDER_DECLARE(vmm); +#endif enum vm_suspend_how { VM_SUSPEND_NONE, Modified: stable/11/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx.c Thu May 9 23:03:10 2019 (r347415) +++ stable/11/sys/amd64/vmm/intel/vmx.c Thu May 9 23:57:02 2019 (r347416) @@ -197,6 +197,82 @@ SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, l1d_flush_sw, CTLFLA static struct msr_entry msr_load_list[1] __aligned(16); /* + * The definitions of SDT probes for VMX. + */ + +SDT_PROBE_DEFINE3(vmm, vmx, exit, entry, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, taskswitch, + "struct vmx *", "int", "struct vm_exit *", "struct vm_task_switch *"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, craccess, + "struct vmx *", "int", "struct vm_exit *", "uint64_t"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, rdmsr, + "struct vmx *", "int", "struct vm_exit *", "uint32_t"); + +SDT_PROBE_DEFINE5(vmm, vmx, exit, wrmsr, + "struct vmx *", "int", "struct vm_exit *", "uint32_t", "uint64_t"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, halt, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, mtrap, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, pause, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, intrwindow, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, interrupt, + "struct vmx *", "int", "struct vm_exit *", "uint32_t"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, nmiwindow, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, inout, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, cpuid, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE5(vmm, vmx, exit, exception, + "struct vmx *", "int", "struct vm_exit *", "uint32_t", "int"); + +SDT_PROBE_DEFINE5(vmm, vmx, exit, nestedfault, + "struct vmx *", "int", "struct vm_exit *", "uint64_t", "uint64_t"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, mmiofault, + "struct vmx *", "int", "struct vm_exit *", "uint64_t"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, eoi, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, apicaccess, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, apicwrite, + "struct vmx *", "int", "struct vm_exit *", "struct vlapic *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, xsetbv, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, monitor, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE3(vmm, vmx, exit, mwait, + "struct vmx *", "int", "struct vm_exit *"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, unknown, + "struct vmx *", "int", "struct vm_exit *", "uint32_t"); + +SDT_PROBE_DEFINE4(vmm, vmx, exit, return, + "struct vmx *", "int", "struct vm_exit *", "int"); + +/* * Use the last page below 4GB as the APIC access address. This address is * occupied by the boot firmware so it is guaranteed that it will not conflict * with a page in system memory. @@ -2165,6 +2241,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ vmexit->exitcode = VM_EXITCODE_BOGUS; vmm_stat_incr(vmx->vm, vcpu, VMEXIT_COUNT, 1); + SDT_PROBE3(vmm, vmx, exit, entry, vmx, vcpu, vmexit); /* * VM-entry failures during or after loading guest state. @@ -2267,6 +2344,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ } } vmexit->exitcode = VM_EXITCODE_TASK_SWITCH; + SDT_PROBE4(vmm, vmx, exit, taskswitch, vmx, vcpu, vmexit, ts); VCPU_CTR4(vmx->vm, vcpu, "task switch reason %d, tss 0x%04x, " "%s errcode 0x%016lx", ts->reason, ts->tsssel, ts->ext ? "external" : "internal", @@ -2274,6 +2352,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ break; case EXIT_REASON_CR_ACCESS: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_CR_ACCESS, 1); + SDT_PROBE4(vmm, vmx, exit, craccess, vmx, vcpu, vmexit, qual); switch (qual & 0xf) { case 0: handled = vmx_emulate_cr0_access(vmx, vcpu, qual); @@ -2291,6 +2370,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ retu = false; ecx = vmxctx->guest_rcx; VCPU_CTR1(vmx->vm, vcpu, "rdmsr 0x%08x", ecx); + SDT_PROBE4(vmm, vmx, exit, rdmsr, vmx, vcpu, vmexit, ecx); error = emulate_rdmsr(vmx, vcpu, ecx, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_RDMSR; @@ -2311,6 +2391,8 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ edx = vmxctx->guest_rdx; VCPU_CTR2(vmx->vm, vcpu, "wrmsr 0x%08x value 0x%016lx", ecx, (uint64_t)edx << 32 | eax); + SDT_PROBE5(vmm, vmx, exit, wrmsr, vmx, vmexit, vcpu, ecx, + (uint64_t)edx << 32 | eax); error = emulate_wrmsr(vmx, vcpu, ecx, (uint64_t)edx << 32 | eax, &retu); if (error) { @@ -2327,6 +2409,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ break; case EXIT_REASON_HLT: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_HLT, 1); + SDT_PROBE3(vmm, vmx, exit, halt, vmx, vcpu, vmexit); vmexit->exitcode = VM_EXITCODE_HLT; vmexit->u.hlt.rflags = vmcs_read(VMCS_GUEST_RFLAGS); if (virtual_interrupt_delivery) @@ -2337,15 +2420,18 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ break; case EXIT_REASON_MTF: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_MTRAP, 1); + SDT_PROBE3(vmm, vmx, exit, mtrap, vmx, vcpu, vmexit); vmexit->exitcode = VM_EXITCODE_MTRAP; vmexit->inst_length = 0; break; case EXIT_REASON_PAUSE: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_PAUSE, 1); + SDT_PROBE3(vmm, vmx, exit, pause, vmx, vcpu, vmexit); vmexit->exitcode = VM_EXITCODE_PAUSE; break; case EXIT_REASON_INTR_WINDOW: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INTR_WINDOW, 1); + SDT_PROBE3(vmm, vmx, exit, intrwindow, vmx, vcpu, vmexit); vmx_clear_int_window_exiting(vmx, vcpu); return (1); case EXIT_REASON_EXT_INTR: @@ -2359,6 +2445,8 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ * this virtual interrupt during the subsequent VM enter. */ intr_info = vmcs_read(VMCS_EXIT_INTR_INFO); + SDT_PROBE4(vmm, vmx, exit, interrupt, + vmx, vcpu, vmexit, intr_info); /* * XXX: Ignore this exit if VMCS_INTR_VALID is not set. @@ -2378,6 +2466,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ vmm_stat_incr(vmx->vm, vcpu, VMEXIT_EXTINT, 1); return (1); case EXIT_REASON_NMI_WINDOW: + SDT_PROBE3(vmm, vmx, exit, nmiwindow, vmx, vcpu, vmexit); /* Exit to allow the pending virtual NMI to be injected */ if (vm_nmi_pending(vmx->vm, vcpu)) vmx_inject_nmi(vmx, vcpu); @@ -2405,9 +2494,11 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ vis->addrsize = inout_str_addrsize(inst_info); inout_str_seginfo(vmx, vcpu, inst_info, in, vis); } + SDT_PROBE3(vmm, vmx, exit, inout, vmx, vcpu, vmexit); break; case EXIT_REASON_CPUID: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_CPUID, 1); + SDT_PROBE3(vmm, vmx, exit, cpuid, vmx, vcpu, vmexit); handled = vmx_handle_cpuid(vmx->vm, vcpu, vmxctx); break; case EXIT_REASON_EXCEPTION: @@ -2472,6 +2563,8 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ } VCPU_CTR2(vmx->vm, vcpu, "Reflecting exception %d/%#x into " "the guest", intr_vec, errcode); + SDT_PROBE5(vmm, vmx, exit, exception, + vmx, vcpu, vmexit, intr_vec, errcode); error = vm_inject_exception(vmx->vm, vcpu, intr_vec, errcode_valid, errcode, 0); KASSERT(error == 0, ("%s: vm_inject_exception error %d", @@ -2492,9 +2585,13 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ vmexit->u.paging.gpa = gpa; vmexit->u.paging.fault_type = ept_fault_type(qual); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_NESTED_FAULT, 1); + SDT_PROBE5(vmm, vmx, exit, nestedfault, + vmx, vcpu, vmexit, gpa, qual); } else if (ept_emulation_fault(qual)) { vmexit_inst_emul(vmexit, gpa, vmcs_gla()); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INST_EMUL, 1); + SDT_PROBE4(vmm, vmx, exit, mmiofault, + vmx, vcpu, vmexit, gpa); } /* * If Virtual NMIs control is 1 and the VM-exit is due to an @@ -2511,9 +2608,11 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ case EXIT_REASON_VIRTUALIZED_EOI: vmexit->exitcode = VM_EXITCODE_IOAPIC_EOI; vmexit->u.ioapic_eoi.vector = qual & 0xFF; + SDT_PROBE3(vmm, vmx, exit, eoi, vmx, vcpu, vmexit); vmexit->inst_length = 0; /* trap-like */ break; case EXIT_REASON_APIC_ACCESS: + SDT_PROBE3(vmm, vmx, exit, apicaccess, vmx, vcpu, vmexit); handled = vmx_handle_apic_access(vmx, vcpu, vmexit); break; case EXIT_REASON_APIC_WRITE: @@ -2523,18 +2622,25 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ */ vmexit->inst_length = 0; vlapic = vm_lapic(vmx->vm, vcpu); + SDT_PROBE4(vmm, vmx, exit, apicwrite, + vmx, vcpu, vmexit, vlapic); handled = vmx_handle_apic_write(vmx, vcpu, vlapic, qual); break; case EXIT_REASON_XSETBV: + SDT_PROBE3(vmm, vmx, exit, xsetbv, vmx, vcpu, vmexit); handled = vmx_emulate_xsetbv(vmx, vcpu, vmexit); break; case EXIT_REASON_MONITOR: + SDT_PROBE3(vmm, vmx, exit, monitor, vmx, vcpu, vmexit); vmexit->exitcode = VM_EXITCODE_MONITOR; break; case EXIT_REASON_MWAIT: + SDT_PROBE3(vmm, vmx, exit, mwait, vmx, vcpu, vmexit); vmexit->exitcode = VM_EXITCODE_MWAIT; break; default: + SDT_PROBE4(vmm, vmx, exit, unknown, + vmx, vcpu, vmexit, reason); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_UNKNOWN, 1); break; } @@ -2570,6 +2676,9 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ */ } } + + SDT_PROBE4(vmm, vmx, exit, return, + vmx, vcpu, vmexit, handled); return (handled); } Modified: stable/11/sys/amd64/vmm/vmm.c ============================================================================== --- stable/11/sys/amd64/vmm/vmm.c Thu May 9 23:03:10 2019 (r347415) +++ stable/11/sys/amd64/vmm/vmm.c Thu May 9 23:57:02 2019 (r347416) @@ -200,6 +200,8 @@ static struct vmm_ops *ops; #define fpu_start_emulating() load_cr0(rcr0() | CR0_TS) #define fpu_stop_emulating() clts() +SDT_PROVIDER_DEFINE(vmm); + static MALLOC_DEFINE(M_VM, "vm", "vm"); /* statistics */ From owner-svn-src-all@freebsd.org Fri May 10 00:03:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4323F1591718; Fri, 10 May 2019 00:03:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFDEB87DBA; Fri, 10 May 2019 00:03:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E95A24531; Fri, 10 May 2019 00:03:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4A03Xt7062315; Fri, 10 May 2019 00:03:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4A03WCc062312; Fri, 10 May 2019 00:03:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905100003.x4A03WCc062312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Fri, 10 May 2019 00:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347417 - in head: . tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: . tests/sys/opencrypto X-SVN-Commit-Revision: 347417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CFDEB87DBA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 00:03:34 -0000 Author: ngie Date: Fri May 10 00:03:32 2019 New Revision: 347417 URL: https://svnweb.freebsd.org/changeset/base/347417 Log: Refactor tests/sys/opencrypto/runtests * Convert from plain to TAP for slightly improved introspection when skipping the tests due to requirements not being met. * Test for the net/py-dpkt (origin) package being required when running the tests, instead of relying on a copy of the dpkt.py module from 2014. This enables the tests to work with py3. Subsequently, remove `tests/sys/opencrypto/dpkt.py(c)?` via `make delete-old`. * Parameterize out `python2` as `$PYTHON`. PR: 237403 MFC after: 1 week Deleted: head/tests/sys/opencrypto/dpkt.py Modified: head/ObsoleteFiles.inc head/tests/sys/opencrypto/Makefile head/tests/sys/opencrypto/runtests.sh Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu May 9 23:57:02 2019 (r347416) +++ head/ObsoleteFiles.inc Fri May 10 00:03:32 2019 (r347417) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20190509: tests/sys/opencrypto requires the net/py-dpkt package. +OLD_FILES+=usr/tests/sys/opencrypto/dpkt.py +OLD_FILES+=usr/tests/sys/opencrypto/dpkt.pyc # 20190304: new libc++ import which bumps version from 7.0.1 to 8.0.0. OLD_FILES+=usr/include/c++/v1/experimental/dynarray # 20190304: new clang import which bumps version from 7.0.1 to 8.0.0. Modified: head/tests/sys/opencrypto/Makefile ============================================================================== --- head/tests/sys/opencrypto/Makefile Thu May 9 23:57:02 2019 (r347416) +++ head/tests/sys/opencrypto/Makefile Fri May 10 00:03:32 2019 (r347417) @@ -12,12 +12,12 @@ CFLAGS.poly1305_test.c += -I${SRCTOP}/sys/opencrypto ATF_TESTS_C+= blake2_test poly1305_test -PLAIN_TESTS_SH= runtests +TAP_TESTS_SH+= runtests TEST_METADATA.runtests+= required_programs="python2" TEST_METADATA.runtests+= required_user="root" -PYMODULES= cryptodev.py cryptodevh.py cryptotest.py dpkt.py +PYMODULES= cryptodev.py cryptodevh.py cryptotest.py ${PACKAGE}FILES+= ${PYMODULES} Modified: head/tests/sys/opencrypto/runtests.sh ============================================================================== --- head/tests/sys/opencrypto/runtests.sh Thu May 9 23:57:02 2019 (r347416) +++ head/tests/sys/opencrypto/runtests.sh Fri May 10 00:03:32 2019 (r347417) @@ -29,13 +29,18 @@ # $FreeBSD$ # -set -ex +: ${PYTHON=python2} if [ ! -d /usr/local/share/nist-kat ]; then - echo 'Skipping, nist-kat package not installed for test vectors.' + echo "1..0 # SKIP: nist-kat package not installed for test vectors" exit 0 fi +if ! $PYTHON -c "from dpkt import dpkt"; then + echo "1..0 # SKIP: py-dpkt package not installed" + exit 0 +fi + loaded_modules= cleanup_tests() { @@ -43,6 +48,10 @@ cleanup_tests() set +e + if [ -n "$oldcdas" ]; then + sysctl "$oldcdas" 2>/dev/null + fi + # Unload modules in reverse order for loaded_module in $(echo $loaded_modules | tr ' ' '\n' | sort -r); do kldunload $loaded_module @@ -52,15 +61,28 @@ trap cleanup_tests EXIT INT TERM for required_module in nexus/aesni cryptodev; do if ! kldstat -q -m $required_module; then - kldload ${required_module#nexus/} + module_to_load=${required_module#nexus/} + if ! kldload ${module_to_load}; then + echo "1..0 # SKIP: could not load ${module_to_load}" + exit 0 + fi loaded_modules="$loaded_modules $required_module" fi done -# Run software crypto test -oldcdas=$(sysctl -e kern.cryptodevallowsoft) -sysctl kern.cryptodevallowsoft=1 +cdas_sysctl=kern.cryptodevallowsoft +if ! oldcdas=$(sysctl -e $cdas_sysctl); then + echo "1..0 # SKIP: could not resolve sysctl: $cdas_sysctl" + exit 0 +fi +if ! sysctl $cdas_sysctl=1; then + echo "1..0 # SKIP: could not enable /dev/crypto access via $cdas_sysctl sysctl." + exit 0 +fi -python2 $(dirname $0)/cryptotest.py - -sysctl "$oldcdas" +echo "1..1" +if "$PYTHON" $(dirname $0)/cryptotest.py; then + echo "ok 1" +else + echo "not ok 1" +fi From owner-svn-src-all@freebsd.org Fri May 10 00:41:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E09181592528; Fri, 10 May 2019 00:41:43 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84DEB88E50; Fri, 10 May 2019 00:41:43 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6250124AB7; Fri, 10 May 2019 00:41:43 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4A0fhcm083123; Fri, 10 May 2019 00:41:43 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4A0fhNT083122; Fri, 10 May 2019 00:41:43 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201905100041.x4A0fhNT083122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 10 May 2019 00:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347418 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84DEB88E50 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 00:41:44 -0000 Author: erj Date: Fri May 10 00:41:42 2019 New Revision: 347418 URL: https://svnweb.freebsd.org/changeset/base/347418 Log: iflib: use default ntxd and nrxd when user value is not power of 2 From Jake: A user may set a sysctl to override the default number of Tx or Rx descriptors. However, certain calculations in the iflib core expect the number of descriptors to be a power of 2. Update _iflib_assert to verify that all of the shared context parameters for the number of descriptors are powers of 2. Modify iflib_reset_qvalues to check that the provided isc_nrxd value is a power of 2. If it's not, print a warning message and then use the default value. An alternative might be to try rounding the number down instead. However, this creates problems in case the rounded down value is below the minimum value that the driver would support. Submitted by: Jacob Keller Reviewed by: marius@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D19880 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Fri May 10 00:03:32 2019 (r347417) +++ head/sys/net/iflib.c Fri May 10 00:41:42 2019 (r347418) @@ -4387,9 +4387,6 @@ iflib_reset_qvalues(if_ctx_t ctx) scctx->isc_txrx_budget_bytes_max = IFLIB_MAX_TX_BYTES; scctx->isc_tx_qdepth = IFLIB_DEFAULT_TX_QDEPTH; - /* - * XXX sanity check that ntxd & nrxd are a power of 2 - */ if (ctx->ifc_sysctl_ntxqs != 0) scctx->isc_ntxqsets = ctx->ifc_sysctl_ntxqs; if (ctx->ifc_sysctl_nrxqs != 0) @@ -4420,6 +4417,11 @@ iflib_reset_qvalues(if_ctx_t ctx) i, scctx->isc_nrxd[i], sctx->isc_nrxd_max[i]); scctx->isc_nrxd[i] = sctx->isc_nrxd_max[i]; } + if (!powerof2(scctx->isc_nrxd[i])) { + device_printf(dev, "nrxd%d: %d is not a power of 2 - using default value of %d\n", + i, scctx->isc_nrxd[i], sctx->isc_nrxd_default[i]); + scctx->isc_nrxd[i] = sctx->isc_nrxd_default[i]; + } } for (i = 0; i < sctx->isc_ntxqs; i++) { @@ -4433,6 +4435,11 @@ iflib_reset_qvalues(if_ctx_t ctx) i, scctx->isc_ntxd[i], sctx->isc_ntxd_max[i]); scctx->isc_ntxd[i] = sctx->isc_ntxd_max[i]; } + if (!powerof2(scctx->isc_ntxd[i])) { + device_printf(dev, "ntxd%d: %d is not a power of 2 - using default value of %d\n", + i, scctx->isc_ntxd[i], sctx->isc_ntxd_default[i]); + scctx->isc_ntxd[i] = sctx->isc_ntxd_default[i]; + } } } @@ -4543,7 +4550,7 @@ iflib_device_register(device_t dev, void *sc, if_share if_softc_ctx_t scctx; kobjop_desc_t kobj_desc; kobj_method_t *kobj_method; - int err, i, msix, rid; + int err, msix, rid; uint16_t main_rxq, main_txq; ctx = malloc(sizeof(* ctx), M_IFLIB, M_WAITOK|M_ZERO); @@ -4598,23 +4605,6 @@ iflib_device_register(device_t dev, void *sc, if_share /* XXX change for per-queue sizes */ device_printf(dev, "Using %d TX descriptors and %d RX descriptors\n", scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); - for (i = 0; i < sctx->isc_nrxqs; i++) { - if (!powerof2(scctx->isc_nrxd[i])) { - /* round down instead? */ - device_printf(dev, - "# RX descriptors must be a power of 2\n"); - err = EINVAL; - goto fail_iflib_detach; - } - } - for (i = 0; i < sctx->isc_ntxqs; i++) { - if (!powerof2(scctx->isc_ntxd[i])) { - device_printf(dev, - "# TX descriptors must be a power of 2"); - err = EINVAL; - goto fail_iflib_detach; - } - } if (scctx->isc_tx_nsegments > scctx->isc_ntxd[main_txq] / MAX_SINGLE_PACKET_FRACTION) @@ -4790,7 +4780,6 @@ fail_intr_free: fail_queues: iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); -fail_iflib_detach: IFDI_DETACH(ctx); fail_unlock: CTX_UNLOCK(ctx); @@ -4833,9 +4822,6 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc scctx = &ctx->ifc_softc_ctx; ifp = ctx->ifc_ifp; - /* - * XXX sanity check that ntxd & nrxd are a power of 2 - */ iflib_reset_qvalues(ctx); CTX_LOCK(ctx); if ((err = IFDI_ATTACH_PRE(ctx)) != 0) { @@ -4899,23 +4885,6 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc /* XXX change for per-queue sizes */ device_printf(dev, "Using %d TX descriptors and %d RX descriptors\n", scctx->isc_ntxd[main_txq], scctx->isc_nrxd[main_rxq]); - for (i = 0; i < sctx->isc_nrxqs; i++) { - if (!powerof2(scctx->isc_nrxd[i])) { - /* round down instead? */ - device_printf(dev, - "# RX descriptors must be a power of 2\n"); - err = EINVAL; - goto fail_iflib_detach; - } - } - for (i = 0; i < sctx->isc_ntxqs; i++) { - if (!powerof2(scctx->isc_ntxd[i])) { - device_printf(dev, - "# TX descriptors must be a power of 2"); - err = EINVAL; - goto fail_iflib_detach; - } - } if (scctx->isc_tx_nsegments > scctx->isc_ntxd[main_txq] / MAX_SINGLE_PACKET_FRACTION) @@ -5305,6 +5274,8 @@ iflib_module_event_handler(module_t mod, int what, voi static void _iflib_assert(if_shared_ctx_t sctx) { + int i; + MPASS(sctx->isc_tx_maxsize); MPASS(sctx->isc_tx_maxsegsize); @@ -5312,12 +5283,25 @@ _iflib_assert(if_shared_ctx_t sctx) MPASS(sctx->isc_rx_nsegments); MPASS(sctx->isc_rx_maxsegsize); - MPASS(sctx->isc_nrxd_min[0]); - MPASS(sctx->isc_nrxd_max[0]); - MPASS(sctx->isc_nrxd_default[0]); - MPASS(sctx->isc_ntxd_min[0]); - MPASS(sctx->isc_ntxd_max[0]); - MPASS(sctx->isc_ntxd_default[0]); + MPASS(sctx->isc_nrxqs >= 1 && sctx->isc_nrxqs <= 8); + for (i = 0; i < sctx->isc_nrxqs; i++) { + MPASS(sctx->isc_nrxd_min[i]); + MPASS(powerof2(sctx->isc_nrxd_min[i])); + MPASS(sctx->isc_nrxd_max[i]); + MPASS(powerof2(sctx->isc_nrxd_max[i])); + MPASS(sctx->isc_nrxd_default[i]); + MPASS(powerof2(sctx->isc_nrxd_default[i])); + } + + MPASS(sctx->isc_ntxqs >= 1 && sctx->isc_ntxqs <= 8); + for (i = 0; i < sctx->isc_ntxqs; i++) { + MPASS(sctx->isc_ntxd_min[i]); + MPASS(powerof2(sctx->isc_ntxd_min[i])); + MPASS(sctx->isc_ntxd_max[i]); + MPASS(powerof2(sctx->isc_ntxd_max[i])); + MPASS(sctx->isc_ntxd_default[i]); + MPASS(powerof2(sctx->isc_ntxd_default[i])); + } } static void From owner-svn-src-all@freebsd.org Fri May 10 00:46:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E6F3159262C; Fri, 10 May 2019 00:46:46 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C651089079; Fri, 10 May 2019 00:46:45 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AC0224C23; Fri, 10 May 2019 00:46:45 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4A0kjAQ083409; Fri, 10 May 2019 00:46:45 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4A0kiXE083400; Fri, 10 May 2019 00:46:44 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201905100046.x4A0kiXE083400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 10 May 2019 00:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347419 - stable/11/sys/dev/ixgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/dev/ixgbe X-SVN-Commit-Revision: 347419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C651089079 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 00:46:46 -0000 Author: erj Date: Fri May 10 00:46:43 2019 New Revision: 347419 URL: https://svnweb.freebsd.org/changeset/base/347419 Log: ix(4): Move {mod,msf,mbx,fdir,phy,link}_task to lock protected handler This patch introduces adapter->task_requests register responsible for recording requests for mod_task, msf_task, mbx_task, fdir_task, phy_task and link_task calls. Instead of enqueueing each of these tasks with GROUPTASK_ENQUEUE, new task is created and all handlers are called from one task while holding adapter->core_mtx lock. SIOCGIFXMEDIA ioctl() call reads adapter->media list. The list is deleted and rewritten in ixgbe_handle_msf() task without holding adapter->core_mtx lock. This change is needed to maintain data coherency when sharing adapter info via ioctl() calls. Since handlers for abovementioned tasks will no longer act as task handlers, but as regular functions, 'pending' parameter is removed from them. This patch also removes ixgbe_update_link_status() call from ixgbe_handle_link() handler. From now on, link status will be updated by calling ixgbe_update_link_status() periodically from ixgbe_local_timer(). This fixes problem with link flapping during changing interface state to UP. Parameter keep_traffic is added to ixgbe_disable_intr(). This enables ixgbe_handle_admin_task() to not disable and queue interrupts. Accordingly, skip_traffic parameter is added to ixgbe_enable_intr() to let ixgbe_handle_admin_task() skip enabling queues while enabling interrupts. This patch is a port of r343621. r343621 can't be merged from current since stable/11 contains ixgbe driver without iflib support. Patch co-authored by Krzysztof Galazka . Submitted by: Piotr Pietruszewski Reviewed by: #IntelNetworking Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D19711 Modified: stable/11/sys/dev/ixgbe/if_fdir.c stable/11/sys/dev/ixgbe/if_ix.c stable/11/sys/dev/ixgbe/if_sriov.c stable/11/sys/dev/ixgbe/ixgbe.h stable/11/sys/dev/ixgbe/ixgbe_fdir.h stable/11/sys/dev/ixgbe/ixgbe_sriov.h stable/11/sys/dev/ixgbe/ixgbe_type.h Modified: stable/11/sys/dev/ixgbe/if_fdir.c ============================================================================== --- stable/11/sys/dev/ixgbe/if_fdir.c Fri May 10 00:41:42 2019 (r347418) +++ stable/11/sys/dev/ixgbe/if_fdir.c Fri May 10 00:46:43 2019 (r347419) @@ -50,7 +50,7 @@ ixgbe_init_fdir(struct adapter *adapter) } /* ixgbe_init_fdir */ void -ixgbe_reinit_fdir(void *context, int pending) +ixgbe_reinit_fdir(void *context) { struct adapter *adapter = context; struct ifnet *ifp = adapter->ifp; @@ -146,9 +146,9 @@ ixgbe_atr(struct tx_ring *txr, struct mbuf *mp) /* TASK_INIT needs this function defined regardless if it's enabled */ void -ixgbe_reinit_fdir(void *context, int pending) +ixgbe_reinit_fdir(void *context) { - UNREFERENCED_2PARAMETER(context, pending); + UNREFERENCED_1PARAMETER(context); } /* ixgbe_reinit_fdir */ void Modified: stable/11/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/11/sys/dev/ixgbe/if_ix.c Fri May 10 00:41:42 2019 (r347418) +++ stable/11/sys/dev/ixgbe/if_ix.c Fri May 10 00:46:43 2019 (r347419) @@ -156,8 +156,8 @@ static void ixgbe_enable_rx_drop(struct adapter *) static void ixgbe_disable_rx_drop(struct adapter *); static void ixgbe_initialize_rss_mapping(struct adapter *); -static void ixgbe_enable_intr(struct adapter *); -static void ixgbe_disable_intr(struct adapter *); +static void ixgbe_enable_intr(struct adapter *, bool); +static void ixgbe_disable_intr(struct adapter *, bool); static void ixgbe_update_stats_counters(struct adapter *); static void ixgbe_set_promisc(struct adapter *); static void ixgbe_set_multi(struct adapter *); @@ -209,10 +209,11 @@ static void ixgbe_msix_link(void *); /* Deferred interrupt tasklets */ static void ixgbe_handle_que(void *, int); -static void ixgbe_handle_link(void *, int); -static void ixgbe_handle_msf(void *, int); -static void ixgbe_handle_mod(void *, int); -static void ixgbe_handle_phy(void *, int); +static void ixgbe_handle_link(void *); +static void ixgbe_handle_msf(void *); +static void ixgbe_handle_mod(void *); +static void ixgbe_handle_phy(void *); +static void ixgbe_handle_admin_task(void *, int); /************************************************************************ @@ -929,6 +930,15 @@ ixgbe_attach(device_t dev) if (adapter->feat_en & IXGBE_FEATURE_NETMAP) ixgbe_netmap_attach(adapter); + /* Initialize Admin Task */ + TASK_INIT(&adapter->admin_task, 0, ixgbe_handle_admin_task, adapter); + + /* Initialize task queue */ + adapter->tq = taskqueue_create_fast("ixgbe_admin", M_NOWAIT, + taskqueue_thread_enqueue, &adapter->tq); + taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s admintaskq", + device_get_nameunit(adapter->dev)); + INIT_DEBUGOUT("ixgbe_attach: end"); return (0); @@ -1250,9 +1260,12 @@ ixgbe_config_link(struct adapter *adapter) if (hw->phy.multispeed_fiber) { hw->mac.ops.setup_sfp(hw); ixgbe_enable_tx_laser(hw); - taskqueue_enqueue(adapter->tq, &adapter->msf_task); - } else - taskqueue_enqueue(adapter->tq, &adapter->mod_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MSF; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); + } else { + adapter->task_requests |= IXGBE_REQUEST_TASK_MOD; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); + } } else { if (hw->mac.ops.check_link) err = ixgbe_check_link(hw, &adapter->link_speed, @@ -2351,7 +2364,8 @@ ixgbe_msix_link(void *arg) /* Link status change */ if (eicr & IXGBE_EICR_LSC) { IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_LSC); - taskqueue_enqueue(adapter->tq, &adapter->link_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_LINK; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); } if (adapter->hw.mac.type != ixgbe_mac_82598EB) { @@ -2362,7 +2376,8 @@ ixgbe_msix_link(void *arg) return; /* Disable the interrupt */ IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_FLOW_DIR); - taskqueue_enqueue(adapter->tq, &adapter->fdir_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_FDIR; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); } if (eicr & IXGBE_EICR_ECC) { @@ -2402,8 +2417,10 @@ ixgbe_msix_link(void *arg) /* Check for VF message */ if ((adapter->feat_en & IXGBE_FEATURE_SRIOV) && - (eicr & IXGBE_EICR_MAILBOX)) - taskqueue_enqueue(adapter->tq, &adapter->mbx_task); + (eicr & IXGBE_EICR_MAILBOX)) { + adapter->task_requests |= IXGBE_REQUEST_TASK_MBX; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); + } } if (ixgbe_is_sfp(hw)) { @@ -2415,14 +2432,16 @@ ixgbe_msix_link(void *arg) if (eicr & eicr_mask) { IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr_mask); - taskqueue_enqueue(adapter->tq, &adapter->mod_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MOD; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); } if ((hw->mac.type == ixgbe_mac_82599EB) && (eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) { IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); - taskqueue_enqueue(adapter->tq, &adapter->msf_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MSF; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); } } @@ -2436,11 +2455,9 @@ ixgbe_msix_link(void *arg) if ((hw->phy.type == ixgbe_phy_x550em_ext_t) && (eicr & IXGBE_EICR_GPI_SDP0_X540)) { IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0_X540); - taskqueue_enqueue(adapter->tq, &adapter->phy_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_PHY; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); } - - /* Re-enable other interrupts */ - IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); } /* ixgbe_msix_link */ /************************************************************************ @@ -2627,19 +2644,6 @@ ixgbe_detach(device_t dev) } } - /* Drain the Link queue */ - if (adapter->tq) { - taskqueue_drain(adapter->tq, &adapter->link_task); - taskqueue_drain(adapter->tq, &adapter->mod_task); - taskqueue_drain(adapter->tq, &adapter->msf_task); - if (adapter->feat_cap & IXGBE_FEATURE_SRIOV) - taskqueue_drain(adapter->tq, &adapter->mbx_task); - taskqueue_drain(adapter->tq, &adapter->phy_task); - if (adapter->feat_en & IXGBE_FEATURE_FDIR) - taskqueue_drain(adapter->tq, &adapter->fdir_task); - taskqueue_free(adapter->tq); - } - /* let hardware know driver is unloading */ ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT); ctrl_ext &= ~IXGBE_CTRL_EXT_DRV_LOAD; @@ -2656,6 +2660,12 @@ ixgbe_detach(device_t dev) if (adapter->feat_en & IXGBE_FEATURE_NETMAP) netmap_detach(adapter->ifp); + /* Drain the Admin Task queue */ + if (adapter->tq) { + taskqueue_drain(adapter->tq, &adapter->admin_task); + taskqueue_free(adapter->tq); + } + ixgbe_free_pci_resources(adapter); bus_generic_detach(dev); if_free(adapter->ifp); @@ -2913,6 +2923,10 @@ ixgbe_init_locked(struct adapter *adapter) /* Configure RX settings */ ixgbe_initialize_receive_units(adapter); + /* Initialize variable holding task enqueue requests + * generated by interrupt handlers */ + adapter->task_requests = 0; + /* Enable SDP & MSI-X interrupts based on adapter */ ixgbe_config_gpie(adapter); @@ -3055,7 +3069,7 @@ ixgbe_init_locked(struct adapter *adapter) ixgbe_config_dmac(adapter); /* And now turn on interrupts */ - ixgbe_enable_intr(adapter); + ixgbe_enable_intr(adapter, false); /* Enable the use of the MBX by the VF's */ if (adapter->feat_en & IXGBE_FEATURE_SRIOV) { @@ -3463,7 +3477,7 @@ out: * ixgbe_handle_mod - Tasklet for SFP module interrupts ************************************************************************/ static void -ixgbe_handle_mod(void *context, int pending) +ixgbe_handle_mod(void *context) { struct adapter *adapter = context; struct ixgbe_hw *hw = &adapter->hw; @@ -3493,16 +3507,21 @@ ixgbe_handle_mod(void *context, int pending) if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module type was detected.\n"); - return; + goto handle_mod_out; } err = hw->mac.ops.setup_sfp(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Setup failure - unsupported SFP+ module type.\n"); - return; + goto handle_mod_out; } - taskqueue_enqueue(adapter->tq, &adapter->msf_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MSF; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); + return; + +handle_mod_out: + adapter->task_requests &= ~(IXGBE_REQUEST_TASK_MSF); } /* ixgbe_handle_mod */ @@ -3510,7 +3529,7 @@ ixgbe_handle_mod(void *context, int pending) * ixgbe_handle_msf - Tasklet for MSF (multispeed fiber) interrupts ************************************************************************/ static void -ixgbe_handle_msf(void *context, int pending) +ixgbe_handle_msf(void *context) { struct adapter *adapter = context; struct ixgbe_hw *hw = &adapter->hw; @@ -3536,7 +3555,7 @@ ixgbe_handle_msf(void *context, int pending) * ixgbe_handle_phy - Tasklet for external PHY interrupts ************************************************************************/ static void -ixgbe_handle_phy(void *context, int pending) +ixgbe_handle_phy(void *context) { struct adapter *adapter = context; struct ixgbe_hw *hw = &adapter->hw; @@ -3551,6 +3570,36 @@ ixgbe_handle_phy(void *context, int pending) } /* ixgbe_handle_phy */ /************************************************************************ + * ixgbe_handle_admin_task - Handler for interrupt tasklets meant to be + * called in separate task. + ************************************************************************/ +static void +ixgbe_handle_admin_task(void *context, int pending) +{ + struct adapter *adapter = context; + + IXGBE_CORE_LOCK(adapter); + ixgbe_disable_intr(adapter, true); + + if (adapter->task_requests & IXGBE_REQUEST_TASK_MOD) + ixgbe_handle_mod(adapter); + if (adapter->task_requests & IXGBE_REQUEST_TASK_MSF) + ixgbe_handle_msf(adapter); + if (adapter->task_requests & IXGBE_REQUEST_TASK_MBX) + ixgbe_handle_mbx(adapter); + if (adapter->task_requests & IXGBE_REQUEST_TASK_FDIR) + ixgbe_reinit_fdir(adapter); + if (adapter->task_requests & IXGBE_REQUEST_TASK_PHY) + ixgbe_handle_phy(adapter); + if (adapter->task_requests & IXGBE_REQUEST_TASK_LINK) + ixgbe_handle_link(adapter); + adapter->task_requests = 0; + + ixgbe_enable_intr(adapter, true); + IXGBE_CORE_UNLOCK(adapter); +} /* ixgbe_handle_admin_task */ + +/************************************************************************ * ixgbe_stop - Stop the hardware * * Disables all traffic on the adapter by issuing a @@ -3568,7 +3617,7 @@ ixgbe_stop(void *arg) mtx_assert(&adapter->core_mtx, MA_OWNED); INIT_DEBUGOUT("ixgbe_stop: begin\n"); - ixgbe_disable_intr(adapter); + ixgbe_disable_intr(adapter, false); callout_stop(&adapter->timer); /* Let the stack know...*/ @@ -3662,9 +3711,13 @@ ixgbe_config_dmac(struct adapter *adapter) /************************************************************************ * ixgbe_enable_intr + * If skip_traffic parameter is set, queues' irqs are not enabled. + * This is useful while reenabling interrupts after disabling them + * with ixgbe_disable_intr() 'keep_traffic' parameter set to true + * as queues' interrupts are already enabled. ************************************************************************/ static void -ixgbe_enable_intr(struct adapter *adapter) +ixgbe_enable_intr(struct adapter *adapter, bool skip_traffic) { struct ixgbe_hw *hw = &adapter->hw; struct ix_queue *que = adapter->queues; @@ -3732,13 +3785,15 @@ ixgbe_enable_intr(struct adapter *adapter) IXGBE_WRITE_REG(hw, IXGBE_EIAC, mask); } - /* - * Now enable all queues, this is done separately to - * allow for handling the extended (beyond 32) MSI-X - * vectors that can be used by 82599 - */ - for (int i = 0; i < adapter->num_queues; i++, que++) - ixgbe_enable_queue(adapter, que->msix); + if (!skip_traffic) { + /* + * Now enable all queues, this is done separately to + * allow for handling the extended (beyond 32) MSI-X + * vectors that can be used by 82599 + */ + for (int i = 0; i < adapter->num_queues; i++, que++) + ixgbe_enable_queue(adapter, que->msix); + } IXGBE_WRITE_FLUSH(hw); @@ -3747,21 +3802,39 @@ ixgbe_enable_intr(struct adapter *adapter) /************************************************************************ * ixgbe_disable_intr + * If keep_traffic parameter is set, queue interrupts are not disabled. + * This is needed by ixgbe_handle_admin_task() to handle link specific + * interrupt procedures without stopping the traffic. ************************************************************************/ static void -ixgbe_disable_intr(struct adapter *adapter) +ixgbe_disable_intr(struct adapter *adapter, bool keep_traffic) { - if (adapter->msix_mem) - IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIAC, 0); - if (adapter->hw.mac.type == ixgbe_mac_82598EB) { - IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0); + struct ixgbe_hw *hw = &adapter->hw; + u32 eiac_mask, eimc_mask, eimc_ext_mask; + + if (keep_traffic) { + /* Autoclear only queue irqs */ + eiac_mask = IXGBE_EICR_RTX_QUEUE; + + /* Disable everything but queue irqs */ + eimc_mask = ~0; + eimc_mask &= ~IXGBE_EIMC_RTX_QUEUE; + eimc_ext_mask = 0; } else { - IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFF0000); - IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(0), ~0); - IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(1), ~0); + eiac_mask = 0; + eimc_mask = (hw->mac.type == ixgbe_mac_82598EB) ? ~0 : 0xFFFF0000; + eimc_ext_mask = ~0; } - IXGBE_WRITE_FLUSH(&adapter->hw); + if (adapter->msix_mem) + IXGBE_WRITE_REG(hw, IXGBE_EIAC, eiac_mask); + + IXGBE_WRITE_REG(hw, IXGBE_EIMC, eimc_mask); + IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(0), eimc_ext_mask); + IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(1), eimc_ext_mask); + + IXGBE_WRITE_FLUSH(hw); + return; } /* ixgbe_disable_intr */ @@ -3786,7 +3859,7 @@ ixgbe_legacy_irq(void *arg) ++que->irqs; if (eicr == 0) { - ixgbe_enable_intr(adapter); + ixgbe_enable_intr(adapter, false); return; } @@ -3807,8 +3880,10 @@ ixgbe_legacy_irq(void *arg) } /* Link status change */ - if (eicr & IXGBE_EICR_LSC) - taskqueue_enqueue(adapter->tq, &adapter->link_task); + if (eicr & IXGBE_EICR_LSC){ + adapter->task_requests |= IXGBE_REQUEST_TASK_LINK; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); + } if (ixgbe_is_sfp(hw)) { /* Pluggable optics-related interrupt */ @@ -3819,26 +3894,30 @@ ixgbe_legacy_irq(void *arg) if (eicr & eicr_mask) { IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr_mask); - taskqueue_enqueue(adapter->tq, &adapter->mod_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MOD; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); } if ((hw->mac.type == ixgbe_mac_82599EB) && (eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) { IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); - taskqueue_enqueue(adapter->tq, &adapter->msf_task); + adapter->task_requests |= IXGBE_REQUEST_TASK_MSF; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); } } /* External PHY interrupt */ if ((hw->phy.type == ixgbe_phy_x550em_ext_t) && - (eicr & IXGBE_EICR_GPI_SDP0_X540)) - taskqueue_enqueue(adapter->tq, &adapter->phy_task); + (eicr & IXGBE_EICR_GPI_SDP0_X540)) { + adapter->task_requests |= IXGBE_REQUEST_TASK_PHY; + taskqueue_enqueue(adapter->tq, &adapter->admin_task); + } if (more) taskqueue_enqueue(que->tq, &que->que_task); else - ixgbe_enable_intr(adapter); + ixgbe_enable_intr(adapter, false); return; } /* ixgbe_legacy_irq */ @@ -4768,9 +4847,9 @@ ixgbe_ioctl(struct ifnet *ifp, u_long command, caddr_t IOCTL_DEBUGOUT("ioctl: SIOC(ADD|DEL)MULTI"); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { IXGBE_CORE_LOCK(adapter); - ixgbe_disable_intr(adapter); + ixgbe_disable_intr(adapter, false); ixgbe_set_multi(adapter); - ixgbe_enable_intr(adapter); + ixgbe_enable_intr(adapter, false); IXGBE_CORE_UNLOCK(adapter); } break; @@ -4893,7 +4972,7 @@ ixgbe_handle_que(void *context, int pending) if (que->res != NULL) ixgbe_enable_queue(adapter, que->msix); else - ixgbe_enable_intr(adapter); + ixgbe_enable_intr(adapter, false); return; } /* ixgbe_handle_que */ @@ -4932,27 +5011,13 @@ ixgbe_allocate_legacy(struct adapter *adapter) taskqueue_start_threads(&que->tq, 1, PI_NET, "%s ixq", device_get_nameunit(adapter->dev)); - /* Tasklets for Link, SFP and Multispeed Fiber */ - TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); - TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter); - TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter); - TASK_INIT(&adapter->phy_task, 0, ixgbe_handle_phy, adapter); - if (adapter->feat_en & IXGBE_FEATURE_FDIR) - TASK_INIT(&adapter->fdir_task, 0, ixgbe_reinit_fdir, adapter); - adapter->tq = taskqueue_create_fast("ixgbe_link", M_NOWAIT, - taskqueue_thread_enqueue, &adapter->tq); - taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s linkq", - device_get_nameunit(adapter->dev)); - if ((error = bus_setup_intr(dev, adapter->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, ixgbe_legacy_irq, que, &adapter->tag)) != 0) { device_printf(dev, "Failed to register fast interrupt handler: %d\n", error); taskqueue_free(que->tq); - taskqueue_free(adapter->tq); que->tq = NULL; - adapter->tq = NULL; return (error); } @@ -5093,20 +5158,6 @@ ixgbe_allocate_msix(struct adapter *adapter) bus_describe_intr(dev, adapter->res, adapter->tag, "link"); #endif adapter->vector = vector; - /* Tasklets for Link, SFP and Multispeed Fiber */ - TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); - TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter); - TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter); - if (adapter->feat_cap & IXGBE_FEATURE_SRIOV) - TASK_INIT(&adapter->mbx_task, 0, ixgbe_handle_mbx, adapter); - TASK_INIT(&adapter->phy_task, 0, ixgbe_handle_phy, adapter); - if (adapter->feat_en & IXGBE_FEATURE_FDIR) - TASK_INIT(&adapter->fdir_task, 0, ixgbe_reinit_fdir, adapter); - adapter->tq = taskqueue_create_fast("ixgbe_link", M_NOWAIT, - taskqueue_thread_enqueue, &adapter->tq); - taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s linkq", - device_get_nameunit(adapter->dev)); - return (0); } /* ixgbe_allocate_msix */ @@ -5232,13 +5283,12 @@ msi: * Done outside of interrupt context since the driver might sleep ************************************************************************/ static void -ixgbe_handle_link(void *context, int pending) +ixgbe_handle_link(void *context) { struct adapter *adapter = context; struct ixgbe_hw *hw = &adapter->hw; ixgbe_check_link(hw, &adapter->link_speed, &adapter->link_up, 0); - ixgbe_update_link_status(adapter); /* Re-enable link interrupts */ IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_LSC); Modified: stable/11/sys/dev/ixgbe/if_sriov.c ============================================================================== --- stable/11/sys/dev/ixgbe/if_sriov.c Fri May 10 00:41:42 2019 (r347418) +++ stable/11/sys/dev/ixgbe/if_sriov.c Fri May 10 00:46:43 2019 (r347419) @@ -620,7 +620,7 @@ ixgbe_process_vf_msg(struct adapter *adapter, struct i /* Tasklet for handling VF -> PF mailbox messages */ void -ixgbe_handle_mbx(void *context, int pending) +ixgbe_handle_mbx(void *context) { struct adapter *adapter; struct ixgbe_hw *hw; @@ -898,9 +898,9 @@ ixgbe_add_vf(device_t dev, u16 vfnum, const nvlist_t * #else void -ixgbe_handle_mbx(void *context, int pending) +ixgbe_handle_mbx(void *context) { - UNREFERENCED_2PARAMETER(context, pending); + UNREFERENCED_1PARAMETER(context); } /* ixgbe_handle_mbx */ inline int Modified: stable/11/sys/dev/ixgbe/ixgbe.h ============================================================================== --- stable/11/sys/dev/ixgbe/ixgbe.h Fri May 10 00:41:42 2019 (r347418) +++ stable/11/sys/dev/ixgbe/ixgbe.h Fri May 10 00:46:43 2019 (r347419) @@ -464,17 +464,15 @@ struct adapter { /* Support for pluggable optics */ bool sfp_probe; - struct task link_task; /* Link tasklet */ - struct task mod_task; /* SFP tasklet */ - struct task msf_task; /* Multispeed Fiber */ - struct task mbx_task; /* VF -> PF mailbox interrupt */ + struct task link_task; /* Link tasklet */ /* Flow Director */ int fdir_reinit; - struct task fdir_task; - struct task phy_task; /* PHY intr tasklet */ - struct taskqueue *tq; + /* Admin task */ + struct taskqueue *tq; + struct task admin_task; + u32 task_requests; /* * Queues: Modified: stable/11/sys/dev/ixgbe/ixgbe_fdir.h ============================================================================== --- stable/11/sys/dev/ixgbe/ixgbe_fdir.h Fri May 10 00:41:42 2019 (r347418) +++ stable/11/sys/dev/ixgbe/ixgbe_fdir.h Fri May 10 00:46:43 2019 (r347419) @@ -52,7 +52,7 @@ void ixgbe_init_fdir(struct adapter *); #endif -void ixgbe_reinit_fdir(void *, int); +void ixgbe_reinit_fdir(void *); void ixgbe_atr(struct tx_ring *, struct mbuf *); #endif /* _IXGBE_FDIR_H_ */ Modified: stable/11/sys/dev/ixgbe/ixgbe_sriov.h ============================================================================== --- stable/11/sys/dev/ixgbe/ixgbe_sriov.h Fri May 10 00:41:42 2019 (r347418) +++ stable/11/sys/dev/ixgbe/ixgbe_sriov.h Fri May 10 00:46:43 2019 (r347419) @@ -96,7 +96,7 @@ u32 ixgbe_get_mrqc(int); #endif /* PCI_IOV */ -void ixgbe_handle_mbx(void *, int); +void ixgbe_handle_mbx(void *); int ixgbe_vf_que_index(int, int, int); #endif Modified: stable/11/sys/dev/ixgbe/ixgbe_type.h ============================================================================== --- stable/11/sys/dev/ixgbe/ixgbe_type.h Fri May 10 00:41:42 2019 (r347418) +++ stable/11/sys/dev/ixgbe/ixgbe_type.h Fri May 10 00:46:43 2019 (r347419) @@ -4392,4 +4392,11 @@ struct ixgbe_bypass_eeprom { #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD \ (0x1F << IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT) +#define IXGBE_REQUEST_TASK_MOD 0x01 +#define IXGBE_REQUEST_TASK_MSF 0x02 +#define IXGBE_REQUEST_TASK_MBX 0x04 +#define IXGBE_REQUEST_TASK_FDIR 0x08 +#define IXGBE_REQUEST_TASK_PHY 0x10 +#define IXGBE_REQUEST_TASK_LINK 0x20 + #endif /* _IXGBE_TYPE_H_ */ From owner-svn-src-all@freebsd.org Fri May 10 01:02:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAB3C1592D9B; Fri, 10 May 2019 01:02:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82FCE899A5; Fri, 10 May 2019 01:02:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C60724F54; Fri, 10 May 2019 01:02:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4A128Z0093678; Fri, 10 May 2019 01:02:08 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4A128V1093677; Fri, 10 May 2019 01:02:08 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905100102.x4A128V1093677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 May 2019 01:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347420 - in stable: 10/lib/libpam/modules/pam_login_access 11/lib/libpam/modules/pam_login_access 12/lib/libpam/modules/pam_login_access X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/lib/libpam/modules/pam_login_access 11/lib/libpam/modules/pam_login_access 12/lib/libpam/modules/pam_login_access X-SVN-Commit-Revision: 347420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 82FCE899A5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 01:02:08 -0000 Author: cy Date: Fri May 10 01:02:07 2019 New Revision: 347420 URL: https://svnweb.freebsd.org/changeset/base/347420 Log: MFC r347234: Improve the legibility of the login.access.5 man page by separating each argument into its own paragraph. Modified: stable/12/lib/libpam/modules/pam_login_access/login.access.5 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libpam/modules/pam_login_access/login.access.5 stable/11/lib/libpam/modules/pam_login_access/login.access.5 Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/lib/libpam/modules/pam_login_access/login.access.5 ============================================================================== --- stable/12/lib/libpam/modules/pam_login_access/login.access.5 Fri May 10 00:46:43 2019 (r347419) +++ stable/12/lib/libpam/modules/pam_login_access/login.access.5 Fri May 10 01:02:07 2019 (r347420) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2006 +.Dd May 7, 2019 .Dt LOGIN.ACCESS 5 .Os .Sh NAME @@ -29,8 +29,10 @@ character: .Pp The first field should be a "+" (access granted) or "-" (access denied) character. +.Pp The second field should be a list of one or more login names, group names, or ALL (always matches). +.Pp The third field should be a list of one or more tty names (for non-networked logins), host names, domain names (begin with "."), host addresses, internet network numbers (end From owner-svn-src-all@freebsd.org Fri May 10 01:02:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A92861592D98; Fri, 10 May 2019 01:02:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46782899A3; Fri, 10 May 2019 01:02:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2362F24F52; Fri, 10 May 2019 01:02:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4A127YT093672; Fri, 10 May 2019 01:02:07 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4A1271e093671; Fri, 10 May 2019 01:02:07 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905100102.x4A1271e093671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 May 2019 01:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347420 - in stable: 10/lib/libpam/modules/pam_login_access 11/lib/libpam/modules/pam_login_access 12/lib/libpam/modules/pam_login_access X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/lib/libpam/modules/pam_login_access 11/lib/libpam/modules/pam_login_access 12/lib/libpam/modules/pam_login_access X-SVN-Commit-Revision: 347420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46782899A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 01:02:08 -0000 Author: cy Date: Fri May 10 01:02:07 2019 New Revision: 347420 URL: https://svnweb.freebsd.org/changeset/base/347420 Log: MFC r347234: Improve the legibility of the login.access.5 man page by separating each argument into its own paragraph. Modified: stable/11/lib/libpam/modules/pam_login_access/login.access.5 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libpam/modules/pam_login_access/login.access.5 stable/12/lib/libpam/modules/pam_login_access/login.access.5 Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/lib/libpam/modules/pam_login_access/login.access.5 ============================================================================== --- stable/11/lib/libpam/modules/pam_login_access/login.access.5 Fri May 10 00:46:43 2019 (r347419) +++ stable/11/lib/libpam/modules/pam_login_access/login.access.5 Fri May 10 01:02:07 2019 (r347420) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2006 +.Dd May 7, 2019 .Dt LOGIN.ACCESS 5 .Os .Sh NAME @@ -29,8 +29,10 @@ character: .Pp The first field should be a "+" (access granted) or "-" (access denied) character. +.Pp The second field should be a list of one or more login names, group names, or ALL (always matches). +.Pp The third field should be a list of one or more tty names (for non-networked logins), host names, domain names (begin with "."), host addresses, internet network numbers (end From owner-svn-src-all@freebsd.org Fri May 10 01:02:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AE1B1592DA5; Fri, 10 May 2019 01:02:09 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4A6D899A9; Fri, 10 May 2019 01:02:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE9F624F56; Fri, 10 May 2019 01:02:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4A128Ut093685; Fri, 10 May 2019 01:02:08 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4A128K9093684; Fri, 10 May 2019 01:02:08 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905100102.x4A128K9093684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 May 2019 01:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r347420 - in stable: 10/lib/libpam/modules/pam_login_access 11/lib/libpam/modules/pam_login_access 12/lib/libpam/modules/pam_login_access X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/lib/libpam/modules/pam_login_access 11/lib/libpam/modules/pam_login_access 12/lib/libpam/modules/pam_login_access X-SVN-Commit-Revision: 347420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D4A6D899A9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 01:02:09 -0000 Author: cy Date: Fri May 10 01:02:07 2019 New Revision: 347420 URL: https://svnweb.freebsd.org/changeset/base/347420 Log: MFC r347234: Improve the legibility of the login.access.5 man page by separating each argument into its own paragraph. Modified: stable/10/lib/libpam/modules/pam_login_access/login.access.5 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libpam/modules/pam_login_access/login.access.5 stable/12/lib/libpam/modules/pam_login_access/login.access.5 Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/lib/libpam/modules/pam_login_access/login.access.5 ============================================================================== --- stable/10/lib/libpam/modules/pam_login_access/login.access.5 Fri May 10 00:46:43 2019 (r347419) +++ stable/10/lib/libpam/modules/pam_login_access/login.access.5 Fri May 10 01:02:07 2019 (r347420) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 13, 2006 +.Dd May 7, 2019 .Dt LOGIN.ACCESS 5 .Os .Sh NAME @@ -29,8 +29,10 @@ character: .Pp The first field should be a "+" (access granted) or "-" (access denied) character. +.Pp The second field should be a list of one or more login names, group names, or ALL (always matches). +.Pp The third field should be a list of one or more tty names (for non-networked logins), host names, domain names (begin with "."), host addresses, internet network numbers (end From owner-svn-src-all@freebsd.org Fri May 10 02:30:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E47D11594C45; Fri, 10 May 2019 02:30:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE6F8BDAC; Fri, 10 May 2019 02:30:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5675125C96; Fri, 10 May 2019 02:30:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4A2UHcx035584; Fri, 10 May 2019 02:30:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4A2UHTe035583; Fri, 10 May 2019 02:30:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201905100230.x4A2UHTe035583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 10 May 2019 02:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347422 - head/sys/dev/dcons X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/dcons X-SVN-Commit-Revision: 347422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7EE6F8BDAC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 02:30:18 -0000 Author: ian Date: Fri May 10 02:30:16 2019 New Revision: 347422 URL: https://svnweb.freebsd.org/changeset/base/347422 Log: Allow dcons(4) to be unloaded when loaded as a module. When the module is unloaded, the tty devices are destroyed. That requires implementing the tsw_free callback to avoid a panic. This driver requires no particular cleanup to be done from the callback, but the module itself must remain in memory until the deferred tsw_free callbacks are invoked. These changes implement that by incrementing a reference count variable in the detach routine, and decrementing it in the tsw_free callback. The MOD_UNLOAD event handler doesn't return until the count drops to zero. PR: 237758 Modified: head/sys/dev/dcons/dcons_os.c Modified: head/sys/dev/dcons/dcons_os.c ============================================================================== --- head/sys/dev/dcons/dcons_os.c Fri May 10 01:22:11 2019 (r347421) +++ head/sys/dev/dcons/dcons_os.c Fri May 10 02:30:16 2019 (r347422) @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -135,12 +136,16 @@ extern struct gdb_dbgport *gdb_cur; #endif static tsw_outwakeup_t dcons_outwakeup; +static tsw_free_t dcons_free; static struct ttydevsw dcons_ttydevsw = { .tsw_flags = TF_NOPREFIX, .tsw_outwakeup = dcons_outwakeup, + .tsw_free = dcons_free, }; +static int dcons_close_refs; + #if (defined(GDB) || defined(DDB)) static int dcons_check_break(struct dcons_softc *dc, int c) @@ -198,6 +203,14 @@ dcons_os_putc(struct dcons_softc *dc, int c) } static void +dcons_free(void *xsc __unused) +{ + + /* Our deferred free has arrived, now we're waiting for one fewer. */ + atomic_subtract_rel_int(&dcons_close_refs, 1); +} + +static void dcons_outwakeup(struct tty *tp) { struct dcons_softc *dc; @@ -396,6 +409,8 @@ dcons_detach(int port) dc = &sc[port]; tp = dc->tty; + /* tty_rel_gone() schedules a deferred free callback, count it. */ + atomic_add_int(&dcons_close_refs, 1); tty_lock(tp); tty_rel_gone(tp); @@ -430,6 +445,9 @@ dcons_modevent(module_t mode, int type, void *data) contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF); } + /* Wait for tty deferred free callbacks to complete. */ + while (atomic_load_acq_int(&dcons_close_refs) > 0) + pause_sbt("dcunld", mstosbt(50), mstosbt(10), 0); break; case MOD_SHUTDOWN: #if 0 /* Keep connection after halt */ From owner-svn-src-all@freebsd.org Fri May 10 04:28:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 959D01596D66; Fri, 10 May 2019 04:28:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D5848EEBA; Fri, 10 May 2019 04:28:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 265E22710D; Fri, 10 May 2019 04:28:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4A4SIQU099038; Fri, 10 May 2019 04:28:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4A4SImq099037; Fri, 10 May 2019 04:28:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905100428.x4A4SImq099037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 10 May 2019 04:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347423 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 347423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D5848EEBA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 04:28:18 -0000 Author: markj Date: Fri May 10 04:28:17 2019 New Revision: 347423 URL: https://svnweb.freebsd.org/changeset/base/347423 Log: Avoid returning a NULL pointer from the Intel hw PRNG ifunc resolver. DTrace expects kernel function symbols of a non-zero size to have an implementation, which is a reasonable invariant to preserve. Reported and tested by: ler Reviewed by: cem, kib Approved by: so (delphij) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20218 Modified: head/sys/dev/random/ivy.c Modified: head/sys/dev/random/ivy.c ============================================================================== --- head/sys/dev/random/ivy.c Fri May 10 02:30:16 2019 (r347422) +++ head/sys/dev/random/ivy.c Fri May 10 04:28:17 2019 (r347423) @@ -97,6 +97,13 @@ x86_rdseed_store(u_long *buf) return (retry); } +static int +x86_unimpl_store(u_long *buf __unused) +{ + + panic("%s called", __func__); +} + DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static) { has_rdrand = (cpu_feature2 & CPUID2_RDRAND); @@ -107,7 +114,7 @@ DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf) else if (has_rdrand) return (x86_rdrand_store); else - return (NULL); + return (x86_unimpl_store); } /* It is required that buf length is a multiple of sizeof(u_long). */ From owner-svn-src-all@freebsd.org Fri May 10 07:28:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1697159A687; Fri, 10 May 2019 07:28:59 +0000 (UTC) (envelope-from girgen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 454DD93BA5; Fri, 10 May 2019 07:28:59 +0000 (UTC) (envelope-from girgen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12E49F8C; Fri, 10 May 2019 07:28:59 +0000 (UTC) (envelope-from girgen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4A7SwJ5093448; Fri, 10 May 2019 07:28:58 GMT (envelope-from girgen@FreeBSD.org) Received: (from girgen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4A7SwEv093447; Fri, 10 May 2019 07:28:58 GMT (envelope-from girgen@FreeBSD.org) Message-Id: <201905100728.x4A7SwEv093447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: girgen set sender to girgen@FreeBSD.org using -f From: Palle Girgensohn Date: Fri, 10 May 2019 07:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r347424 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: girgen X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 347424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 454DD93BA5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 07:28:59 -0000 Author: girgen (ports committer) Date: Fri May 10 07:28:58 2019 New Revision: 347424 URL: https://svnweb.freebsd.org/changeset/base/347424 Log: About to commit vuxml for postgresql Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Fri May 10 04:28:17 2019 (r347423) +++ svnadmin/conf/sizelimit.conf Fri May 10 07:28:58 2019 (r347424) @@ -27,3 +27,4 @@ np obrien peter rwatson +girgen From owner-svn-src-all@freebsd.org Fri May 10 07:46:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5E2C159ADA9; Fri, 10 May 2019 07:46:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DC9894556; Fri, 10 May 2019 07:46:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2425F12F8; Fri, 10 May 2019 07:46:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4A7kEVR003908; Fri, 10 May 2019 07:46:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4A7kEqb003905; Fri, 10 May 2019 07:46:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905100746.x4A7kEqb003905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 10 May 2019 07:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347425 - head/tests/sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tests/sys/sys X-SVN-Commit-Revision: 347425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DC9894556 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 07:46:15 -0000 Author: trasz Date: Fri May 10 07:46:14 2019 New Revision: 347425 URL: https://svnweb.freebsd.org/changeset/base/347425 Log: Add simple regression tests for tree(3). Those are ATF-ified versions of OpenBSD's regress/sys/sys/tree/. Reviewed by: ngie MFC after: 2 weeks Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D20186 Added: head/tests/sys/sys/rb_test.c (contents, props changed) head/tests/sys/sys/splay_test.c (contents, props changed) Modified: head/tests/sys/sys/Makefile Modified: head/tests/sys/sys/Makefile ============================================================================== --- head/tests/sys/sys/Makefile Fri May 10 07:28:58 2019 (r347424) +++ head/tests/sys/sys/Makefile Fri May 10 07:46:14 2019 (r347425) @@ -2,7 +2,7 @@ TESTSDIR= ${TESTSBASE}/sys/sys -ATF_TESTS_C= bitstring_test +ATF_TESTS_C= bitstring_test rb_test splay_test WARNS?= 5 Added: head/tests/sys/sys/rb_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/sys/rb_test.c Fri May 10 07:46:14 2019 (r347425) @@ -0,0 +1,108 @@ +/* $OpenBSD: rb-test.c,v 1.4 2008/04/13 00:22:17 djm Exp $ */ +/* + * Copyright 2002 Niels Provos + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#include + +#include +#include + +#include + +struct node { + RB_ENTRY(node) node; + int key; +}; + +RB_HEAD(tree, node) root; + +static int +compare(struct node *a, struct node *b) +{ + if (a->key < b->key) return (-1); + else if (a->key > b->key) return (1); + return (0); +} + +RB_PROTOTYPE(tree, node, node, compare); + +RB_GENERATE(tree, node, node, compare); + +#define ITER 150 +#define MIN 5 +#define MAX 5000 + +ATF_TC_WITHOUT_HEAD(rb_test); +ATF_TC_BODY(rb_test, tc) +{ + struct node *tmp, *ins; + int i, max, min; + + RB_INIT(&root); + + for (i = 0; i < ITER; i++) { + tmp = malloc(sizeof(struct node)); + ATF_CHECK_MSG(tmp != NULL, "malloc failed"); + do { + tmp->key = arc4random_uniform(MAX-MIN); + tmp->key += MIN; + } while (RB_FIND(tree, &root, tmp) != NULL); + if (i == 0) + max = min = tmp->key; + else { + if (tmp->key > max) + max = tmp->key; + if (tmp->key < min) + min = tmp->key; + } + ATF_CHECK_EQ(NULL, RB_INSERT(tree, &root, tmp)); + } + + ins = RB_MIN(tree, &root); + ATF_CHECK_EQ(min, ins->key); + tmp = ins; + ins = RB_MAX(tree, &root); + ATF_CHECK_EQ(max, ins->key); + + ATF_CHECK_EQ(tmp, RB_REMOVE(tree, &root, tmp)); + + for (i = 0; i < ITER - 1; i++) { + tmp = RB_ROOT(&root); + ATF_CHECK_MSG(tmp != NULL, "RB_ROOT error"); + ATF_CHECK_EQ(tmp, RB_REMOVE(tree, &root, tmp)); + free(tmp); + } +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, rb_test); + + return (atf_no_error()); +} Added: head/tests/sys/sys/splay_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/sys/splay_test.c Fri May 10 07:46:14 2019 (r347425) @@ -0,0 +1,108 @@ +/* $OpenBSD: splay-test.c,v 1.4 2008/04/13 00:22:17 djm Exp $ */ +/* + * Copyright 2002 Niels Provos + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#include + +#include +#include + +#include + +struct node { + SPLAY_ENTRY(node) node; + int key; +}; + +SPLAY_HEAD(tree, node) root; + +static int +compare(struct node *a, struct node *b) +{ + if (a->key < b->key) return (-1); + else if (a->key > b->key) return (1); + return (0); +} + +SPLAY_PROTOTYPE(tree, node, node, compare); + +SPLAY_GENERATE(tree, node, node, compare); + +#define ITER 150 +#define MIN 5 +#define MAX 5000 + +ATF_TC_WITHOUT_HEAD(splay_test); +ATF_TC_BODY(splay_test, tc) +{ + struct node *tmp, *ins; + int i, max, min; + + SPLAY_INIT(&root); + + for (i = 0; i < ITER; i++) { + tmp = malloc(sizeof(struct node)); + ATF_CHECK_MSG(tmp != NULL, "malloc failed"); + do { + tmp->key = arc4random_uniform(MAX-MIN); + tmp->key += MIN; + } while (SPLAY_FIND(tree, &root, tmp) != NULL); + if (i == 0) + max = min = tmp->key; + else { + if (tmp->key > max) + max = tmp->key; + if (tmp->key < min) + min = tmp->key; + } + ATF_CHECK_EQ(NULL, SPLAY_INSERT(tree, &root, tmp)); + } + + ins = SPLAY_MIN(tree, &root); + ATF_CHECK_EQ(min, ins->key); + tmp = ins; + ins = SPLAY_MAX(tree, &root); + ATF_CHECK_EQ(max, ins->key); + + ATF_CHECK_EQ(tmp, SPLAY_REMOVE(tree, &root, tmp)); + + for (i = 0; i < ITER - 1; i++) { + tmp = SPLAY_ROOT(&root); + ATF_CHECK_MSG(tmp != NULL, "SPLAY_ROOT error"); + ATF_CHECK_EQ(tmp, SPLAY_REMOVE(tree, &root, tmp)); + free(tmp); + } +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, splay_test); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Fri May 10 07:46:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7B52159ADD5; Fri, 10 May 2019 07:46:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (unknown [IPv6:2a02:6b8:b010:d005::1:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "butcher-nb.yandex.net", Issuer "butcher-nb.yandex.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6164C945CC; Fri, 10 May 2019 07:46:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (localhost [127.0.0.1]) by butcher-nb.yandex.net (8.15.2/8.15.2) with ESMTP id x4A7imtM010132; Fri, 10 May 2019 10:44:48 +0300 (MSK) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r347402 - head/sys/modules/ipsec To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head@freebsd.org References: <201905091806.x49I6Bx9067179@repo.freebsd.org> <1362fc5c-c5dd-438b-9696-de3ec3a538ca@FreeBSD.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=ae@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0IkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz6JATsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxC5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: Date: Fri, 10 May 2019 10:44:44 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="a5l9GtMuvgM4rxxrJfAPQMPehAJEKyjqK" X-Rspamd-Queue-Id: 6164C945CC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.90 / 15.00]; NEURAL_HAM_MEDIUM(-0.98)[-0.983,0]; NEURAL_HAM_SHORT(-0.92)[-0.918,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 07:46:27 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --a5l9GtMuvgM4rxxrJfAPQMPehAJEKyjqK Content-Type: multipart/mixed; boundary="T8qfKUmSRtFURyQB7LOMyrTjdwZoEeNes"; protected-headers="v1" From: "Andrey V. Elsukov" To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r347402 - head/sys/modules/ipsec References: <201905091806.x49I6Bx9067179@repo.freebsd.org> <1362fc5c-c5dd-438b-9696-de3ec3a538ca@FreeBSD.org> In-Reply-To: --T8qfKUmSRtFURyQB7LOMyrTjdwZoEeNes Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.05.2019 22:13, Kyle Evans wrote: >> there is two IPsec related interfaces that have problem with automatic= >> loading - if_enc and if_ipsec. So, if you add both to the mapping list= , >> this will be useful. CAM enc driver has conflicting name and prevents = to >> automatic loading of if_enc(4). It is probably always build in the >> kernel, but renaming it into "ses" may break some third-party device >> drivers. >> >=20 > I think you want something like [0] to add both of these to the map > and stop ifconfig(8) from bailing on loading if_enc because 'enc' is > loaded. This is safe at least for the set of modules currently mapped. >=20 > Thanks, >=20 > Kyle Evans >=20 > [0] https://people.freebsd.org/~kevans/ipsec.diff It looks good to me. --=20 WBR, Andrey V. Elsukov --T8qfKUmSRtFURyQB7LOMyrTjdwZoEeNes-- --a5l9GtMuvgM4rxxrJfAPQMPehAJEKyjqK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlzVK+wACgkQAcXqBBDI oXrtOAf+Ntq96zUjmMbuxn4p2NOmBjJ6//nhP3vDcnEdmB4oI9msU+4dfkO7BcRT TIpINRlJLp3mxxxdFWsuB6uDrORJN7wwxMIJBK0Yk9YrI0DAlIstWhDIrYSePiU9 u4XxyE95Eu6Sv+uoPiv4g5rH7zdgXf/5l2EPTx4wammS5uthtauKqTPx6uPEfgtg GRjcRFU4H3uX/XQvuy0VecldWf2qo/Cwn3AKyWAW0cUzbY5DAW+rqeKgCYnYv6lN DvrskT1o96PYhcvVfgPElYHQsqPOkkTKYcyS1OCzA+V5ii/0riFLKboAAej0YfhQ BP22cVdCwH04F/Twq/REzm24j6l1ew== =f8Ap -----END PGP SIGNATURE----- --a5l9GtMuvgM4rxxrJfAPQMPehAJEKyjqK-- From owner-svn-src-all@freebsd.org Fri May 10 08:16:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97C70159BB9B; Fri, 10 May 2019 08:16:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F5AF95478; Fri, 10 May 2019 08:16:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17F9C17FD; Fri, 10 May 2019 08:16:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4A8GThH019604; Fri, 10 May 2019 08:16:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4A8GTgZ019602; Fri, 10 May 2019 08:16:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905100816.x4A8GTgZ019602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 10 May 2019 08:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347426 - head/tests/sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tests/sys/sys X-SVN-Commit-Revision: 347426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F5AF95478 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 08:16:30 -0000 Author: trasz Date: Fri May 10 08:16:29 2019 New Revision: 347426 URL: https://svnweb.freebsd.org/changeset/base/347426 Log: Try to unbreak the build after r347425. MFC after: 2 weeks Modified: head/tests/sys/sys/rb_test.c head/tests/sys/sys/splay_test.c Modified: head/tests/sys/sys/rb_test.c ============================================================================== --- head/tests/sys/sys/rb_test.c Fri May 10 07:46:14 2019 (r347425) +++ head/tests/sys/sys/rb_test.c Fri May 10 08:16:29 2019 (r347426) @@ -63,6 +63,8 @@ ATF_TC_BODY(rb_test, tc) struct node *tmp, *ins; int i, max, min; + max = min = 42; /* pacify gcc */ + RB_INIT(&root); for (i = 0; i < ITER; i++) { Modified: head/tests/sys/sys/splay_test.c ============================================================================== --- head/tests/sys/sys/splay_test.c Fri May 10 07:46:14 2019 (r347425) +++ head/tests/sys/sys/splay_test.c Fri May 10 08:16:29 2019 (r347426) @@ -65,6 +65,8 @@ ATF_TC_BODY(splay_test, tc) SPLAY_INIT(&root); + max = min = 42; /* pacify gcc */ + for (i = 0; i < ITER; i++) { tmp = malloc(sizeof(struct node)); ATF_CHECK_MSG(tmp != NULL, "malloc failed"); From owner-svn-src-all@freebsd.org Fri May 10 08:46:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D08159C262; Fri, 10 May 2019 08:46:21 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 008E696122; Fri, 10 May 2019 08:46:21 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id CCC7D637; Fri, 10 May 2019 08:46:20 +0000 (UTC) Date: Fri, 10 May 2019 08:46:20 +0000 From: Alexey Dokuchaev To: Andrew Gallatin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf Message-ID: <20190510084620.GA47901@FreeBSD.org> References: <201905092238.x49McFCO015665@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905092238.x49McFCO015665@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 008E696122 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.89 / 15.00]; NEURAL_HAM_MEDIUM(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.91)[-0.909,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 08:46:21 -0000 On Thu, May 09, 2019 at 10:38:15PM +0000, Andrew Gallatin wrote: > Author: gallatin > Date: Thu May 9 22:38:15 2019 > New Revision: 347410 > URL: https://svnweb.freebsd.org/changeset/base/347410 > > Log: > Remove IPSEC from GENERIC due to performance issues > > @@ -30,7 +30,6 @@ options PREEMPTION # Enable ... > options VIMAGE # Subsystem virtualization, e.g. VNET > options INET # InterNETworking > options INET6 # IPv6 communications protocols > -options IPSEC # IP (v4/v6) security > options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 I've asked this question some two years ago, but no one could answer it back then, so I'll try again. What is the reason behind having IPSEC_SUPPORT option instead of no special option at all? If I grep for SUPPORT in conf/GENERIC, I see things like INVARIANT_SUPPORT or IEEE80211_SUPPORT_MESH (with meaningful explanations) but IPSEC_SUPPORT which, per the comment, "allows to kldload of ipsec and tcpmd5", is totally beyond me. Lots of kernel features are/can be loaded as modules, but we don't have things like SOUND_SUPPORT or USB_SUPPORT. ./danfe From owner-svn-src-all@freebsd.org Fri May 10 09:13:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9664159D492; Fri, 10 May 2019 09:13:30 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 458C897439; Fri, 10 May 2019 09:13:30 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback8g.mail.yandex.net (mxback8g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:169]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 379CA5F80F78; Fri, 10 May 2019 12:13:22 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback8g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Cc7ZR7jEn6-DMmC7egI; Fri, 10 May 2019 12:13:22 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1557479602; bh=o2pNahw+SPlCp3cLrNBSllqKaUrJ/Z+Sty28arA6ooM=; h=In-Reply-To:From:To:Subject:Cc:Date:References:Message-ID; b=gBlYTJ2iiRicUzHOvetFKAuCT4sXoJlPEKvN71FX/5uwQ32kVVrwey6ErFnedMZjb YE5j5s/0bApo2vHUJAwHWMEzcaZVRFMEhJFEVcQgbxDT9NTTwzur9Ow1xewQ0BqKfC VwmeLTQV2lgdSTW+0DWIs6Sgjaa/Vc14OTOY5pUA= Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Wd9WvgJ8mr-DLJugO7H; Fri, 10 May 2019 12:13:21 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf To: Alexey Dokuchaev , Andrew Gallatin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510084620.GA47901@FreeBSD.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <1a15a141-89b7-9169-e4cc-df585e92ada1@yandex.ru> Date: Fri, 10 May 2019 12:11:47 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190510084620.GA47901@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6Eex5IEh3dSPj9RBDzoWbFqwXIwbrlWkz" X-Rspamd-Queue-Id: 458C897439 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 09:13:31 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6Eex5IEh3dSPj9RBDzoWbFqwXIwbrlWkz Content-Type: multipart/mixed; boundary="DGFuGz2PU0bGOc9mMeEHokl0PiCNhvJsi"; protected-headers="v1" From: "Andrey V. Elsukov" To: Alexey Dokuchaev , Andrew Gallatin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1a15a141-89b7-9169-e4cc-df585e92ada1@yandex.ru> Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510084620.GA47901@FreeBSD.org> In-Reply-To: <20190510084620.GA47901@FreeBSD.org> --DGFuGz2PU0bGOc9mMeEHokl0PiCNhvJsi Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 10.05.2019 11:46, Alexey Dokuchaev wrote: > On Thu, May 09, 2019 at 10:38:15PM +0000, Andrew Gallatin wrote: >> Author: gallatin >> Date: Thu May 9 22:38:15 2019 >> New Revision: 347410 >> URL: https://svnweb.freebsd.org/changeset/base/347410 >> >> Log: >> Remove IPSEC from GENERIC due to performance issues >> =20 >> @@ -30,7 +30,6 @@ options PREEMPTION # Enable ... >> options VIMAGE # Subsystem virtualization, e.g. VNET >> options INET # InterNETworking >> options INET6 # IPv6 communications protocols >> -options IPSEC # IP (v4/v6) security >> options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 >=20 > I've asked this question some two years ago, but no one could answer it= > back then, so I'll try again. >=20 > What is the reason behind having IPSEC_SUPPORT option instead of no spe= cial > option at all? If I grep for SUPPORT in conf/GENERIC, I see things lik= e > INVARIANT_SUPPORT or IEEE80211_SUPPORT_MESH (with meaningful explanatio= ns) > but IPSEC_SUPPORT which, per the comment, "allows to kldload of ipsec a= nd > tcpmd5", is totally beyond me. Lots of kernel features are/can be load= ed > as modules, but we don't have things like SOUND_SUPPORT or USB_SUPPORT.= IPSEC_SUPPORT builds into the kernel PF_KEY domain protocol, that is required by IPsec implementation to interact with userlevel. Currently the kernel does not support unregistering of protocol domains. This is mostly why option IPSEC_SUPPORT was introduced. The second cause - reduce overhead that IPSEC produces even when it is not used. --=20 WBR, Andrey V. Elsukov --DGFuGz2PU0bGOc9mMeEHokl0PiCNhvJsi-- --6Eex5IEh3dSPj9RBDzoWbFqwXIwbrlWkz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlzVQFMACgkQAcXqBBDI oXqSZQgAi2IYPbimzehJeAXBlrNEbkWvoYTVkz/rGV7mVFRJWmKm9nT/Jk5X5joA 6Noi4uDPY6IVMU8XL5fDHRVhQHfpGHpN2ehOXfxQlC4AjOje0R/02uZbt3MLI2Pg 1hbdd+601vA7qBsh3m6IweUp3LxwtjGk6O6mQ9qTgY3NwgFw8HOt6eIxR/xHJ6a1 jQAFYhH+vPrAuN6kntSbzeEpexoarVGyxZfLAtwANksTeZEneQUGR8HGJ+hKAh1V HKiAGinVMF5zU+oaZIvDFnje302zUaoJAcoLLIzsT3AknievtyZJ7x8F/KUXXTpP mW/dGjuzPk+OA1CW0EuXmx9cIv//1w== =ncWS -----END PGP SIGNATURE----- --6Eex5IEh3dSPj9RBDzoWbFqwXIwbrlWkz-- From owner-svn-src-all@freebsd.org Fri May 10 11:21:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 779AA15A0009; Fri, 10 May 2019 11:21:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6CC6C24C; Fri, 10 May 2019 11:21:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE3D83985; Fri, 10 May 2019 11:21:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ABLvta018184; Fri, 10 May 2019 11:21:57 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ABLvwb018183; Fri, 10 May 2019 11:21:57 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905101121.x4ABLvwb018183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 10 May 2019 11:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347427 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 347427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D6CC6C24C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 11:21:58 -0000 Author: br Date: Fri May 10 11:21:57 2019 New Revision: 347427 URL: https://svnweb.freebsd.org/changeset/base/347427 Log: RISC-V ISA does not specify how to manage physical memory attributes (PMA). So do nothing in pmap_page_set_memattr() and don't panic. Reviewed by: markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20209 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Fri May 10 08:16:29 2019 (r347426) +++ head/sys/riscv/riscv/pmap.c Fri May 10 11:21:57 2019 (r347427) @@ -4200,16 +4200,6 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { m->md.pv_memattr = ma; - - /* - * RISCVTODO: Implement the below (from the amd64 pmap) - * If "m" is a normal page, update its direct mapping. This update - * can be relied upon to perform any cache operations that are - * required for data coherence. - */ - if ((m->flags & PG_FICTITIOUS) == 0 && - PHYS_IN_DMAP(VM_PAGE_TO_PHYS(m))) - panic("RISCVTODO: pmap_page_set_memattr"); } /* From owner-svn-src-all@freebsd.org Fri May 10 12:33:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F57915A20C6; Fri, 10 May 2019 12:33:43 +0000 (UTC) (envelope-from girgen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1CCE6EA67; Fri, 10 May 2019 12:33:42 +0000 (UTC) (envelope-from girgen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC1124639; Fri, 10 May 2019 12:33:42 +0000 (UTC) (envelope-from girgen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ACXg73055223; Fri, 10 May 2019 12:33:42 GMT (envelope-from girgen@FreeBSD.org) Received: (from girgen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ACXgJh055222; Fri, 10 May 2019 12:33:42 GMT (envelope-from girgen@FreeBSD.org) Message-Id: <201905101233.x4ACXgJh055222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: girgen set sender to girgen@FreeBSD.org using -f From: Palle Girgensohn Date: Fri, 10 May 2019 12:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r347428 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: girgen X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 347428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E1CCE6EA67 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 12:33:43 -0000 Author: girgen (ports committer) Date: Fri May 10 12:33:42 2019 New Revision: 347428 URL: https://svnweb.freebsd.org/changeset/base/347428 Log: Remove me, wrong repo. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Fri May 10 11:21:57 2019 (r347427) +++ svnadmin/conf/sizelimit.conf Fri May 10 12:33:42 2019 (r347428) @@ -27,4 +27,3 @@ np obrien peter rwatson -girgen From owner-svn-src-all@freebsd.org Fri May 10 12:45:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7476A15A249B; Fri, 10 May 2019 12:45:12 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B8156FD58; Fri, 10 May 2019 12:45:12 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1hP4tW-0009TH-5N; Fri, 10 May 2019 15:44:58 +0300 Date: Fri, 10 May 2019 15:44:58 +0300 From: Slawa Olhovchenkov To: Andrew Gallatin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf Message-ID: <20190510124458.GB65054@zxy.spb.ru> References: <201905092238.x49McFCO015665@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905092238.x49McFCO015665@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 0B8156FD58 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.947,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 12:45:12 -0000 On Thu, May 09, 2019 at 10:38:15PM +0000, Andrew Gallatin wrote: > Author: gallatin > Date: Thu May 9 22:38:15 2019 > New Revision: 347410 > URL: https://svnweb.freebsd.org/changeset/base/347410 > > Log: > Remove IPSEC from GENERIC due to performance issues > > Having IPSEC compiled into the kernel imposes a non-trivial > performance penalty on multi-threaded workloads due to IPSEC > refcounting. In my benchmarks of multi-threaded UDP > transmit (connected sockets), I've seen a roughly 20% performance > penalty when the IPSEC option is included in the kernel (16.8Mpps > vs 13.8Mpps with 32 senders on a 14 core / 28 HTT Xeon > 2697v3)). This is largely due to key_addref() incrementing and > decrementing an atomic reference count on the default > policy. This cause all CPUs to stall on the same cacheline, as it > bounces between different CPUs. > > Given that relatively few users use ipsec, and that it can be > loaded as a module, it seems reasonable to ask those users to > load the ipsec module so as to avoid imposing this penalty on the > GENERIC kernel. Its my hope that this will make FreeBSD look > better in "out of the box" benchmark comparisons with other > operating systems. > > Many thanks to ae for fixing auto-loading of ipsec.ko when > ifconfig tries to configure ipsec, and to cy for volunteering > to ensure the the racoon ports will load the ipsec.ko module > > Reviewed by: cem, cy, delphij, gnn, jhb, jpaetzel > Differential Revision: https://reviews.freebsd.org/D20163 pf have ifdef for IPSEC, but don't have support IPSEC_SUPPORT (netpfil/pf/if_pfsync.c). From owner-svn-src-all@freebsd.org Fri May 10 13:18:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE91D15A2C0F; Fri, 10 May 2019 13:18:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83D9870C9B; Fri, 10 May 2019 13:18:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 744944CEC; Fri, 10 May 2019 13:18:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ADINjI077024; Fri, 10 May 2019 13:18:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ADINjQ077023; Fri, 10 May 2019 13:18:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905101318.x4ADINjQ077023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 May 2019 13:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347429 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 347429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 83D9870C9B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 13:18:24 -0000 Author: kevans Date: Fri May 10 13:18:22 2019 New Revision: 347429 URL: https://svnweb.freebsd.org/changeset/base/347429 Log: ifconfig(8): Add kld mappings for ipsec/enc Additionally, providing mappings makes the comparison for already loaded modules a little more strict. This should have been done at initial introduction, but there was no real reason- however, it proves necessary for enc which has a standard enc -> if_enc mapping but there also exists an 'enc' module that's actually CAM. The mapping lets us unambiguously determine the correct module. Discussed with: ae MFC after: 4 days Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Fri May 10 12:33:42 2019 (r347428) +++ head/sbin/ifconfig/ifconfig.c Fri May 10 13:18:22 2019 (r347429) @@ -71,6 +71,7 @@ static const char rcsid[] = #ifdef JAIL #include #endif +#include #include #include #include @@ -146,6 +147,20 @@ static struct module_map_entry { .ifname = "vmnet", .kldname = "if_tuntap", }, + { + .ifname = "ipsec", + .kldname = "ipsec", + }, + { + /* + * This mapping exists because there is a conflicting enc module + * in CAM. ifconfig's guessing behavior will attempt to match + * the ifname to a module as well as if_${ifname} and clash with + * CAM enc. This is an assertion of the correct module to load. + */ + .ifname = "enc", + .kldname = "if_enc", + }, }; @@ -1436,6 +1451,7 @@ ifmaybeload(const char *name) char ifkind[IFNAMSIZ + MOD_PREFIX_LEN], ifname[IFNAMSIZ], *dp; const char *cp; struct module_map_entry *mme; + bool found; /* loading suppressed by the user */ if (noload) @@ -1451,16 +1467,18 @@ ifmaybeload(const char *name) /* Either derive it from the map or guess otherwise */ *ifkind = '\0'; + found = false; for (i = 0; i < nitems(module_map); ++i) { mme = &module_map[i]; if (strcmp(mme->ifname, ifname) == 0) { strlcpy(ifkind, mme->kldname, sizeof(ifkind)); + found = true; break; } } /* We didn't have an alias for it... we'll guess. */ - if (*ifkind == '\0') { + if (!found) { /* turn interface and unit into module name */ strlcpy(ifkind, "if_", sizeof(ifkind)); strlcat(ifkind, ifname, sizeof(ifkind)); @@ -1480,8 +1498,12 @@ ifmaybeload(const char *name) } else { cp = mstat.name; } - /* already loaded? */ - if (strcmp(ifname, cp) == 0 || + /* + * Is it already loaded? Don't compare with ifname if + * we were specifically told which kld to use. Doing + * so could lead to conflicts not trivially solved. + */ + if ((!found && strcmp(ifname, cp) == 0) || strcmp(ifkind, cp) == 0) return; } From owner-svn-src-all@freebsd.org Fri May 10 13:41:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D183915A331B; Fri, 10 May 2019 13:41:20 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7273E717AF; Fri, 10 May 2019 13:41:20 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DD5D5069; Fri, 10 May 2019 13:41:20 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ADfKtL087846; Fri, 10 May 2019 13:41:20 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ADfJvJ087843; Fri, 10 May 2019 13:41:19 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201905101341.x4ADfJvJ087843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 10 May 2019 13:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347430 - in head/sys: kern netinet sys X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: in head/sys: kern netinet sys X-SVN-Commit-Revision: 347430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7273E717AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 13:41:21 -0000 Author: gallatin Date: Fri May 10 13:41:19 2019 New Revision: 347430 URL: https://svnweb.freebsd.org/changeset/base/347430 Log: Bind TCP HPTS (pacer) threads to NUMA domains Bind the TCP pacer threads to NUMA domains and build per-domain pacer-thread lookup tables. These tables allow us to use the inpcb's NUMA domain information to match an inpcb with a pacer thread on the same domain. The motivation for this is to keep the TCP connection local to a NUMA domain as much as possible. Thanks to jhb for pre-reviewing an earlier version of the patch. Reviewed by: rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20134 Modified: head/sys/kern/kern_intr.c head/sys/netinet/tcp_hpts.c head/sys/sys/interrupt.h Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Fri May 10 13:18:22 2019 (r347429) +++ head/sys/kern/kern_intr.c Fri May 10 13:41:19 2019 (r347430) @@ -380,6 +380,25 @@ intr_event_bind_ithread(struct intr_event *ie, int cpu return (_intr_event_bind(ie, cpu, false, true)); } +/* + * Bind an interrupt event's ithread to the specified cpuset. + */ +int +intr_event_bind_ithread_cpuset(struct intr_event *ie, cpuset_t *cs) +{ + lwpid_t id; + + mtx_lock(&ie->ie_lock); + if (ie->ie_thread != NULL) { + id = ie->ie_thread->it_thread->td_tid; + mtx_unlock(&ie->ie_lock); + return (cpuset_setthread(id, cs)); + } else { + mtx_unlock(&ie->ie_lock); + } + return (ENODEV); +} + static struct intr_event * intr_lookup(int irq) { Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Fri May 10 13:18:22 2019 (r347429) +++ head/sys/netinet/tcp_hpts.c Fri May 10 13:41:19 2019 (r347430) @@ -131,6 +131,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -171,7 +172,7 @@ MALLOC_DEFINE(M_TCPHPTS, "tcp_hpts", "TCP hpts"); #include static int tcp_bind_threads = 1; #else -static int tcp_bind_threads = 0; +static int tcp_bind_threads = 2; #endif TUNABLE_INT("net.inet.tcp.bind_hptss", &tcp_bind_threads); @@ -207,6 +208,13 @@ static int32_t logging_on = 0; static int32_t hpts_sleep_max = (NUM_OF_HPTSI_SLOTS - 2); static int32_t tcp_hpts_precision = 120; +struct hpts_domain_info { + int count; + int cpu[MAXCPU]; +}; + +struct hpts_domain_info hpts_domains[MAXMEMDOM]; + SYSCTL_INT(_net_inet_tcp_hpts, OID_AUTO, precision, CTLFLAG_RW, &tcp_hpts_precision, 120, "Value for PRE() precision of callout"); @@ -1079,8 +1087,10 @@ hpts_random_cpu(struct inpcb *inp){ static uint16_t hpts_cpuid(struct inpcb *inp){ u_int cpuid; +#ifdef NUMA + struct hpts_domain_info *di; +#endif - /* * If one has been set use it i.e. we want both in and out on the * same hpts. @@ -1103,11 +1113,21 @@ hpts_cpuid(struct inpcb *inp){ * unknown cpuids to curcpu. Not the best, but apparently better * than defaulting to swi 0. */ - if (inp->inp_flowtype != M_HASHTYPE_NONE) { + + if (inp->inp_flowtype == M_HASHTYPE_NONE) + return (hpts_random_cpu(inp)); + /* + * Hash to a thread based on the flowid. If we are using numa, + * then restrict the hash to the numa domain where the inp lives. + */ +#ifdef NUMA + if (tcp_bind_threads == 2 && inp->inp_numa_domain != M_NODOM) { + di = &hpts_domains[inp->inp_numa_domain]; + cpuid = di->cpu[inp->inp_flowid % di->count]; + } else +#endif cpuid = inp->inp_flowid % mp_ncpus; - return (cpuid); - } - cpuid = hpts_random_cpu(inp); + return (cpuid); #endif } @@ -1781,8 +1801,11 @@ tcp_init_hptsi(void *st) struct timeval tv; sbintime_t sb; struct tcp_hpts_entry *hpts; + struct pcpu *pc; + cpuset_t cs; char unit[16]; uint32_t ncpus = mp_ncpus ? mp_ncpus : MAXCPU; + int count, domain; tcp_pace.rp_proc = NULL; tcp_pace.rp_num_hptss = ncpus; @@ -1861,6 +1884,11 @@ tcp_init_hptsi(void *st) } callout_init(&hpts->co, 1); } + + /* Don't try to bind to NUMA domains if we don't have any */ + if (vm_ndomains == 1 && tcp_bind_threads == 2) + tcp_bind_threads = 0; + /* * Now lets start ithreads to handle the hptss. */ @@ -1875,9 +1903,20 @@ tcp_init_hptsi(void *st) hpts, i, error); } created++; - if (tcp_bind_threads) { + if (tcp_bind_threads == 1) { if (intr_event_bind(hpts->ie, i) == 0) bound++; + } else if (tcp_bind_threads == 2) { + pc = pcpu_find(i); + domain = pc->pc_domain; + CPU_COPY(&cpuset_domain[domain], &cs); + if (intr_event_bind_ithread_cpuset(hpts->ie, &cs) + == 0) { + bound++; + count = hpts_domains[domain].count; + hpts_domains[domain].cpu[count] = i; + hpts_domains[domain].count++; + } } tv.tv_sec = 0; tv.tv_usec = hpts->p_hpts_sleep_time * HPTS_TICKS_PER_USEC; @@ -1893,9 +1932,20 @@ tcp_init_hptsi(void *st) C_PREL(tcp_hpts_precision)); } } - printf("TCP Hpts created %d swi interrupt thread and bound %d\n", - created, bound); - return; + /* + * If we somehow have an empty domain, fall back to choosing + * among all htps threads. + */ + for (i = 0; i < vm_ndomains; i++) { + if (hpts_domains[i].count == 0) { + tcp_bind_threads = 0; + break; + } + } + + printf("TCP Hpts created %d swi interrupt threads and bound %d to %s\n", + created, bound, + tcp_bind_threads == 2 ? "NUMA domains" : "cpus"); } SYSINIT(tcphptsi, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, tcp_init_hptsi, NULL); Modified: head/sys/sys/interrupt.h ============================================================================== --- head/sys/sys/interrupt.h Fri May 10 13:18:22 2019 (r347429) +++ head/sys/sys/interrupt.h Fri May 10 13:41:19 2019 (r347430) @@ -176,6 +176,8 @@ int intr_event_add_handler(struct intr_event *ie, cons int intr_event_bind(struct intr_event *ie, int cpu); int intr_event_bind_irqonly(struct intr_event *ie, int cpu); int intr_event_bind_ithread(struct intr_event *ie, int cpu); +int intr_event_bind_ithread_cpuset(struct intr_event *ie, + cpuset_t *mask); int intr_event_create(struct intr_event **event, void *source, int flags, int irq, void (*pre_ithread)(void *), void (*post_ithread)(void *), void (*post_filter)(void *), From owner-svn-src-all@freebsd.org Fri May 10 15:31:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FDD615A5554; Fri, 10 May 2019 15:31:30 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7DA3755D9; Fri, 10 May 2019 15:31:29 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 97D50270025C; Fri, 10 May 2019 11:31:22 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 97D50270025C DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1557502282; bh=qaFk2Vzc6wcd9n5JTnvelYNCbwwERo4Mc1KslPMq8lI=; h=Subject:To:From:Date:From; b=aBhOv8UxCZWJbVCZTZBgDd1tprIePciI9CgK3g7n8+IVQstrwRd9YSW+9XJ6r/KdZ /C5oNReOXNUmvWDvwwEMD4MGyv/UyV6Xgp/02RJkjxu2JQIZrR/6SZiFnPPBzHVYAn diMG28R929eqznUoKa6oVcD2YSf0RziSmHBVIteG8/Z0XYuUjeZzCj7m87FDmp5aY9 uZPs+AxFRMrRGrdFX+1bx001jqkWcZjGXFtFfJFePNSmursCQW5RtfgzCYAjSBnJrX yLc7VrHomz9nnvmzgeU0LtwtDyDYa0gGJWr+XYoOE7LdOhoVeb7SXtSMNGBADQB8q4 hXP1xj3TtgKvA== Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kp@freebsd.org References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510124458.GB65054@zxy.spb.ru> From: Andrew Gallatin Message-ID: <0842eef5-5f1f-c25a-a470-a424c536f1ed@cs.duke.edu> Date: Fri, 10 May 2019 11:31:21 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190510124458.GB65054@zxy.spb.ru> Content-Type: multipart/mixed; boundary="------------FA406BCE8D96BE8CAE3E7A66" Content-Language: en-US X-Rspamd-Queue-Id: C7DA3755D9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.85 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.85)[-0.854,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 15:31:30 -0000 This is a multi-part message in MIME format. --------------FA406BCE8D96BE8CAE3E7A66 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 2019-05-10 08:44, Slawa Olhovchenkov wrote: > pf have ifdef for IPSEC, but don't have support IPSEC_SUPPORT > (netpfil/pf/if_pfsync.c). > Thanks for pointing this out. It seems like IPSEC_SUPPORT would work for this. I've made a patch, and it compiles and the pf module loads. However, I have no knowledge of how to test it. Is this something that you use, and which you can test? Thanks, Drew --------------FA406BCE8D96BE8CAE3E7A66 Content-Type: text/x-patch; name="pf.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pf.diff" diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 45b1e090f95c..cc06637b862e 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -308,7 +308,7 @@ static void pfsync_bulk_update(void *); static void pfsync_bulk_fail(void *); static void pfsync_detach_ifnet(struct ifnet *); -#ifdef IPSEC +#ifdef IPSEC_SUPPORT static void pfsync_update_net_tdb(struct pfsync_tdb *); #endif static struct pfsync_bucket *pfsync_get_bucket(struct pfsync_softc *, @@ -1228,7 +1228,7 @@ pfsync_in_tdb(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) { int len = count * sizeof(struct pfsync_tdb); -#if defined(IPSEC) +#if defined(IPSEC_SUPPORT) struct pfsync_tdb *tp; struct mbuf *mp; int offp; @@ -1249,7 +1249,7 @@ pfsync_in_tdb(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) return (len); } -#if defined(IPSEC) +#if defined(IPSEC_SUPPORT) /* Update an in-kernel tdb. Silently fail if no tdb is found. */ static void pfsync_update_net_tdb(struct pfsync_tdb *pt) --------------FA406BCE8D96BE8CAE3E7A66-- From owner-svn-src-all@freebsd.org Fri May 10 15:50:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F78915A5ED1; Fri, 10 May 2019 15:50:11 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9F867638D; Fri, 10 May 2019 15:50:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4F6701D323; Fri, 10 May 2019 15:50:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [169.254.10.249] (c-24-4-212-61.hsd1.ca.comcast.net [24.4.212.61]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 7E537350D6; Fri, 10 May 2019 17:50:07 +0200 (CEST) From: "Kristof Provost" To: "Andrew Gallatin" Cc: "Slawa Olhovchenkov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf Date: Fri, 10 May 2019 08:50:04 -0700 X-Mailer: MailMate (2.0BETAr6137) Message-ID: <3884905F-0593-496D-8BAD-67C468C92AF2@FreeBSD.org> In-Reply-To: <0842eef5-5f1f-c25a-a470-a424c536f1ed@cs.duke.edu> References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510124458.GB65054@zxy.spb.ru> <0842eef5-5f1f-c25a-a470-a424c536f1ed@cs.duke.edu> MIME-Version: 1.0 X-Rspamd-Queue-Id: B9F867638D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 15:50:11 -0000 On 10 May 2019, at 8:31, Andrew Gallatin wrote: > On 2019-05-10 08:44, Slawa Olhovchenkov wrote: > >> pf have ifdef for IPSEC, but don't have support IPSEC_SUPPORT >> (netpfil/pf/if_pfsync.c). >> > > Thanks for pointing this out. It seems like IPSEC_SUPPORT would work > for this. I've made a patch, and it compiles and the pf module loads. > However, I have no knowledge of how to test it. Is this something > that you use, and which you can test? > I suspect this code has not actually been enabled for a long time. gettdb() doesn’t actually appear to be defined anywhere, so I wouldn’t expect it to ever compile. gettdb() does exist in OpenBSD, so my current guess is that this is just an import artefact, and we should `#ifdef OPENBSD` it or something, or just remove it completely. For completeness, and because I never shut up about this: to test pf `kldload pfsync`, `cd /usr/tests/sys/netpfil/pf` and `sudo kyua test` There’s more information in the current edition of the FreeBSD journal. Regards, Kristof From owner-svn-src-all@freebsd.org Fri May 10 16:01:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F95A15A63C2; Fri, 10 May 2019 16:01:26 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46D1B76E65; Fri, 10 May 2019 16:01:26 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F2B868AE; Fri, 10 May 2019 16:01:26 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AG1Qcs062967; Fri, 10 May 2019 16:01:26 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AG1PC5062966; Fri, 10 May 2019 16:01:26 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905101601.x4AG1PC5062966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 10 May 2019 16:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347433 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 347433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46D1B76E65 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 16:01:26 -0000 Author: dougm Date: Fri May 10 16:01:25 2019 New Revision: 347433 URL: https://svnweb.freebsd.org/changeset/base/347433 Log: A major change to subr_blist.c failed to update all the comments about changes to struct fields. Update those now. Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D20227 Modified: head/sys/sys/blist.h Modified: head/sys/sys/blist.h ============================================================================== --- head/sys/sys/blist.h Fri May 10 15:55:30 2019 (r347432) +++ head/sys/sys/blist.h Fri May 10 16:01:25 2019 (r347433) @@ -69,17 +69,17 @@ typedef uint64_t u_daddr_t; /* unsigned disk address * #define SWAPBLK_NONE ((daddr_t)((u_daddr_t)SWAPBLK_MASK + 1))/* flag */ /* - * Both blmeta and bmu_bitmap MUST be a power of 2 in size. + * Both blmeta and bm_bitmap MUST be a power of 2 in size. */ typedef struct blmeta { - u_daddr_t bm_bitmap; /* bitmap if we are a leaf */ + u_daddr_t bm_bitmap; /* marking unfilled block sets */ daddr_t bm_bighint; /* biggest contiguous block hint*/ } blmeta_t; typedef struct blist { daddr_t bl_blocks; /* area of coverage */ - daddr_t bl_avail; /* # available blocks */ + daddr_t bl_avail; /* # available blocks */ u_daddr_t bl_radix; /* coverage radix */ daddr_t bl_cursor; /* next-fit search starts at */ blmeta_t bl_root[1]; /* root of radix tree */ From owner-svn-src-all@freebsd.org Fri May 10 16:32:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98FBE15A6CF2; Fri, 10 May 2019 16:32:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EBF377EB6; Fri, 10 May 2019 16:32:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 122016E1B; Fri, 10 May 2019 16:32:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AGWijK082095; Fri, 10 May 2019 16:32:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AGWiA9082093; Fri, 10 May 2019 16:32:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905101632.x4AGWiA9082093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 10 May 2019 16:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347435 - in stable/11/sys/amd64: include vmm vmm/intel X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11/sys/amd64: include vmm vmm/intel X-SVN-Commit-Revision: 347435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3EBF377EB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 16:32:45 -0000 Author: jhb Date: Fri May 10 16:32:44 2019 New Revision: 347435 URL: https://svnweb.freebsd.org/changeset/base/347435 Log: MFC 338957: Handle a guest executing a vm instruction by trapping and raising an undefined instruction exception. Previously we would exit the guest, however an unprivileged user could execute these. Modified: stable/11/sys/amd64/include/vmm.h stable/11/sys/amd64/vmm/intel/vmx.c stable/11/sys/amd64/vmm/vmm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/include/vmm.h ============================================================================== --- stable/11/sys/amd64/include/vmm.h Fri May 10 16:31:51 2019 (r347434) +++ stable/11/sys/amd64/include/vmm.h Fri May 10 16:32:44 2019 (r347435) @@ -544,6 +544,7 @@ enum vm_exitcode { VM_EXITCODE_MWAIT, VM_EXITCODE_SVM, VM_EXITCODE_REQIDLE, + VM_EXITCODE_VMINSN, VM_EXITCODE_MAX }; Modified: stable/11/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx.c Fri May 10 16:31:51 2019 (r347434) +++ stable/11/sys/amd64/vmm/intel/vmx.c Fri May 10 16:32:44 2019 (r347435) @@ -266,6 +266,9 @@ SDT_PROBE_DEFINE3(vmm, vmx, exit, monitor, SDT_PROBE_DEFINE3(vmm, vmx, exit, mwait, "struct vmx *", "int", "struct vm_exit *"); +SDT_PROBE_DEFINE3(vmm, vmx, exit, vminsn, + "struct vmx *", "int", "struct vm_exit *"); + SDT_PROBE_DEFINE4(vmm, vmx, exit, unknown, "struct vmx *", "int", "struct vm_exit *", "uint32_t"); @@ -2637,6 +2640,19 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ case EXIT_REASON_MWAIT: SDT_PROBE3(vmm, vmx, exit, mwait, vmx, vcpu, vmexit); vmexit->exitcode = VM_EXITCODE_MWAIT; + break; + case EXIT_REASON_VMCALL: + case EXIT_REASON_VMCLEAR: + case EXIT_REASON_VMLAUNCH: + case EXIT_REASON_VMPTRLD: + case EXIT_REASON_VMPTRST: + case EXIT_REASON_VMREAD: + case EXIT_REASON_VMRESUME: + case EXIT_REASON_VMWRITE: + case EXIT_REASON_VMXOFF: + case EXIT_REASON_VMXON: + SDT_PROBE3(vmm, vmx, exit, vminsn, vmx, vcpu, vmexit); + vmexit->exitcode = VM_EXITCODE_VMINSN; break; default: SDT_PROBE4(vmm, vmx, exit, unknown, Modified: stable/11/sys/amd64/vmm/vmm.c ============================================================================== --- stable/11/sys/amd64/vmm/vmm.c Fri May 10 16:31:51 2019 (r347434) +++ stable/11/sys/amd64/vmm/vmm.c Fri May 10 16:32:44 2019 (r347435) @@ -1677,6 +1677,7 @@ restart: break; case VM_EXITCODE_MONITOR: case VM_EXITCODE_MWAIT: + case VM_EXITCODE_VMINSN: vm_inject_ud(vm, vcpuid); break; default: From owner-svn-src-all@freebsd.org Fri May 10 16:36:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48CEE15A6EAE; Fri, 10 May 2019 16:36:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0B0C801DF; Fri, 10 May 2019 16:36:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A27EF6E20; Fri, 10 May 2019 16:36:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AGacij082460; Fri, 10 May 2019 16:36:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AGacGN082457; Fri, 10 May 2019 16:36:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905101636.x4AGacGN082457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 10 May 2019 16:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347436 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 347436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E0B0C801DF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 16:36:39 -0000 Author: jhb Date: Fri May 10 16:36:38 2019 New Revision: 347436 URL: https://svnweb.freebsd.org/changeset/base/347436 Log: MFC 340707: Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES to avoid buffer accessed out of bounds, also switch to snprintf(3). PR: 200859 Modified: stable/11/usr.sbin/bhyve/pci_ahci.c stable/11/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_ahci.c Fri May 10 16:32:44 2019 (r347435) +++ stable/11/usr.sbin/bhyve/pci_ahci.c Fri May 10 16:36:38 2019 (r347436) @@ -105,7 +105,7 @@ enum sata_fis_type { * ATA commands */ #define ATA_SF_ENAB_SATA_SF 0x10 -#define ATA_SATA_SF_AN 0x05 +#define ATA_SATA_SF_AN 0x05 #define ATA_SF_DIS_SATA_SF 0x90 /* @@ -119,6 +119,8 @@ static FILE *dbg; #endif #define WPRINTF(format, arg...) printf(format, ##arg) +#define AHCI_PORT_IDENT 20 + 1 + struct ahci_ioreq { struct blockif_req io_req; struct ahci_port *io_pr; @@ -136,7 +138,7 @@ struct ahci_port { struct pci_ahci_softc *pr_sc; uint8_t *cmd_lst; uint8_t *rfis; - char ident[20 + 1]; + char ident[AHCI_PORT_IDENT]; int port; int atapi; int reset; @@ -2374,7 +2376,8 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst *p MD5Init(&mdctx); MD5Update(&mdctx, opts, strlen(opts)); MD5Final(digest, &mdctx); - sprintf(sc->port[p].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + snprintf(sc->port[p].ident, AHCI_PORT_IDENT, + "BHYVE-%02X%02X-%02X%02X-%02X%02X", digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); Modified: stable/11/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_virtio_block.c Fri May 10 16:32:44 2019 (r347435) +++ stable/11/usr.sbin/bhyve/pci_virtio_block.c Fri May 10 16:36:38 2019 (r347436) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #define VTBLK_S_IOERR 1 #define VTBLK_S_UNSUPP 2 -#define VTBLK_BLK_ID_BYTES 20 +#define VTBLK_BLK_ID_BYTES 20 + 1 /* Capability bits */ #define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ @@ -344,7 +344,8 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * MD5Init(&mdctx); MD5Update(&mdctx, opts, strlen(opts)); MD5Final(digest, &mdctx); - sprintf(sc->vbsc_ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, + "BHYVE-%02X%02X-%02X%02X-%02X%02X", digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); /* setup virtio block config space */ From owner-svn-src-all@freebsd.org Fri May 10 16:38:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFC5315A6FC0; Fri, 10 May 2019 16:38:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5677B805D2; Fri, 10 May 2019 16:38:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 311176E27; Fri, 10 May 2019 16:38:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AGcmUP082616; Fri, 10 May 2019 16:38:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AGcmrR082615; Fri, 10 May 2019 16:38:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905101638.x4AGcmrR082615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 10 May 2019 16:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347437 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 347437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5677B805D2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 16:38:49 -0000 Author: jhb Date: Fri May 10 16:38:48 2019 New Revision: 347437 URL: https://svnweb.freebsd.org/changeset/base/347437 Log: MFC 342944: Fix spelling of identifier Modified: stable/11/usr.sbin/bhyve/bhyve.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/11/usr.sbin/bhyve/bhyve.8 Fri May 10 16:36:38 2019 (r347436) +++ stable/11/usr.sbin/bhyve/bhyve.8 Fri May 10 16:38:48 2019 (r347437) @@ -323,7 +323,7 @@ address and a VNC should listen on. The default is to listen on localhost IPv4 address and default VNC port 5900. An IPv6 address must be enclosed in square brackets and may contain an -optional zone identifer. +optional zone identifier. .It Ar width No and Ar height A display resolution, width and height, respectively. If not specified, a default resolution of 1024x768 pixels will be used. From owner-svn-src-all@freebsd.org Fri May 10 16:43:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F61C15A723C; Fri, 10 May 2019 16:43:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0553180AFC; Fri, 10 May 2019 16:43:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8E136FC7; Fri, 10 May 2019 16:43:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AGhlkx087907; Fri, 10 May 2019 16:43:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AGhlja087906; Fri, 10 May 2019 16:43:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905101643.x4AGhlja087906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 10 May 2019 16:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347439 - head/lib/libnetgraph X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libnetgraph X-SVN-Commit-Revision: 347439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0553180AFC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 16:43:48 -0000 Author: markj Date: Fri May 10 16:43:47 2019 New Revision: 347439 URL: https://svnweb.freebsd.org/changeset/base/347439 Log: Atomically update the global gMsgId in libnetgraph. Otherwise concurrently running threads may inadvertently use the same token for different messages. Preserve the behaviour of disallowing negative message tokens, but allow a message token value of zero since this simplifies the code a bit and tokens are documented to be non-negative. PR: 234442 Reported and tested by: eugen MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/lib/libnetgraph/msg.c Modified: head/lib/libnetgraph/msg.c ============================================================================== --- head/lib/libnetgraph/msg.c Fri May 10 16:41:33 2019 (r347438) +++ head/lib/libnetgraph/msg.c Fri May 10 16:43:47 2019 (r347439) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -51,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include "internal.h" /* Next message token value */ -static int gMsgId; +static _Atomic(unsigned int) gMsgId; /* For delivering both messages and replies */ static int NgDeliverMsg(int cs, const char *path, @@ -72,9 +73,7 @@ NgSendMsg(int cs, const char *path, memset(&msg, 0, sizeof(msg)); msg.header.version = NG_VERSION; msg.header.typecookie = cookie; - if (++gMsgId < 0) - gMsgId = 1; - msg.header.token = gMsgId; + msg.header.token = atomic_fetch_add(&gMsgId, 1) & INT_MAX; msg.header.flags = NGF_ORIG; msg.header.cmd = cmd; snprintf((char *)msg.header.cmdstr, NG_CMDSTRSIZ, "cmd%d", cmd); @@ -143,9 +142,7 @@ NgSendAsciiMsg(int cs, const char *path, const char *f /* Now send binary version */ binary = (struct ng_mesg *)reply->data; - if (++gMsgId < 0) - gMsgId = 1; - binary->header.token = gMsgId; + binary->header.token = atomic_fetch_add(&gMsgId, 1) & INT_MAX; binary->header.version = NG_VERSION; if (NgDeliverMsg(cs, path, binary, binary->data, binary->header.arglen) < 0) { From owner-svn-src-all@freebsd.org Fri May 10 16:43:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 414EE15A725F; Fri, 10 May 2019 16:43:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D691380B86; Fri, 10 May 2019 16:43:55 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DE476FC9; Fri, 10 May 2019 16:43:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AGhsRL087971; Fri, 10 May 2019 16:43:54 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AGhsYx087970; Fri, 10 May 2019 16:43:54 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905101643.x4AGhsYx087970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 10 May 2019 16:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347440 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 347440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D691380B86 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 16:43:56 -0000 Author: manu Date: Fri May 10 16:43:53 2019 New Revision: 347440 URL: https://svnweb.freebsd.org/changeset/base/347440 Log: ahci: Check if bus is cache-coherent We do this for FDT systems but not for ACPI ones. Check the presence of the _CCA attribute. Sponsored by: Ampere Computing, LLC Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D20144 Modified: head/sys/dev/ahci/ahci_generic.c Modified: head/sys/dev/ahci/ahci_generic.c ============================================================================== --- head/sys/dev/ahci/ahci_generic.c Fri May 10 16:43:47 2019 (r347439) +++ head/sys/dev/ahci/ahci_generic.c Fri May 10 16:43:53 2019 (r347440) @@ -89,6 +89,7 @@ ahci_fdt_probe(device_t dev) static int ahci_acpi_probe(device_t dev) { + struct ahci_controller *ctlr = device_get_softc(dev); ACPI_HANDLE h; if ((h = acpi_get_handle(dev)) == NULL) @@ -98,6 +99,12 @@ ahci_acpi_probe(device_t dev) pci_get_subclass(dev) == PCIS_STORAGE_SATA && pci_get_progif(dev) == PCIP_STORAGE_SATA_AHCI_1_0) { device_set_desc_copy(dev, "AHCI SATA controller"); + if (ACPI_FAILURE(acpi_GetInteger(h, "_CCA", + &ctlr->dma_coherent))) + ctlr->dma_coherent = 0; + if (bootverbose) + device_printf(dev, "Bus is%s cache-coherent\n", + ctlr->dma_coherent ? "" : " not"); return (BUS_PROBE_DEFAULT); } From owner-svn-src-all@freebsd.org Fri May 10 16:44:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E03915A72C7; Fri, 10 May 2019 16:44:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D67F580D90; Fri, 10 May 2019 16:44:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB7E06FD7; Fri, 10 May 2019 16:44:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AGiZQN088066; Fri, 10 May 2019 16:44:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AGiZE0088065; Fri, 10 May 2019 16:44:35 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905101644.x4AGiZE0088065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 10 May 2019 16:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347441 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 347441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D67F580D90 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 16:44:36 -0000 Author: manu Date: Fri May 10 16:44:35 2019 New Revision: 347441 URL: https://svnweb.freebsd.org/changeset/base/347441 Log: efibootmgr: Do not add the new boot entry in dry-run is specified While here fix a typo. Sponsored-by: Ampere Computing, LLC Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D20212 Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Fri May 10 16:43:53 2019 (r347440) +++ head/usr.sbin/efibootmgr/efibootmgr.c Fri May 10 16:44:35 2019 (r347441) @@ -679,7 +679,7 @@ make_boot_var(const char *label, const char *loader, c lopt_size = create_loadopt(load_opt_buf, MAX_LOADOPT_LEN, load_attrs, dp, llen + klen, label, env, env ? strlen(env) + 1 : 0); if (lopt_size == BAD_LENGTH) - errx(1, "Can't crate loadopt"); + errx(1, "Can't create loadopt"); ret = 0; if (!dry_run) { @@ -690,7 +690,8 @@ make_boot_var(const char *label, const char *loader, c if (ret) err(1, "efi_set_variable"); - add_to_boot_order(bootvar); /* first, still not active */ + if (!dry_run) + add_to_boot_order(bootvar); /* first, still not active */ new_ent = malloc(sizeof(struct entry)); if (new_ent == NULL) err(1, "malloc"); From owner-svn-src-all@freebsd.org Fri May 10 16:45:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9670215A7343; Fri, 10 May 2019 16:45:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D68880EF5; Fri, 10 May 2019 16:45:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A9FD6FDA; Fri, 10 May 2019 16:45:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AGjHeV088152; Fri, 10 May 2019 16:45:17 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AGjH6R088150; Fri, 10 May 2019 16:45:17 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905101645.x4AGjH6R088150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 10 May 2019 16:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347442 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 347442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D68880EF5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 16:45:18 -0000 Author: manu Date: Fri May 10 16:45:17 2019 New Revision: 347442 URL: https://svnweb.freebsd.org/changeset/base/347442 Log: arm64: rockchip: Don't always put PLL to normal mode We used to put every PLL in normal mode (meaning that the output would be the result of the PLL configuration) instead of slow mode (the output is equal to the external oscillator frequency, 24-26Mhz) but this doesn't work for most of the PLLs as when we put them into normal mode the registers configuring the output frequency haven't been set. Add a normal_mode member in clk_pll_def/clk_pll_sc struct and if it's true we then set the PLL to normal mode. For now only set it to the LPLL and BPLL (Little cluster PLL and Big cluster PLL respectively). Reviewed by: ganbold Differential Revision: https://reviews.freebsd.org/D20174 Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c head/sys/arm64/rockchip/clk/rk_clk_pll.c head/sys/arm64/rockchip/clk/rk_clk_pll.h Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3399_cru.c Fri May 10 16:44:35 2019 (r347441) +++ head/sys/arm64/rockchip/clk/rk3399_cru.c Fri May 10 16:45:17 2019 (r347442) @@ -764,6 +764,7 @@ static struct rk_clk_pll_def lpll = { .gate_shift = 0, .flags = RK_CLK_PLL_HAVE_GATE, .rates = rk3399_pll_rates, + .normal_mode = true, }; static struct rk_clk_pll_def bpll = { @@ -778,6 +779,7 @@ static struct rk_clk_pll_def bpll = { .gate_shift = 1, .flags = RK_CLK_PLL_HAVE_GATE, .rates = rk3399_pll_rates, + .normal_mode = true, }; static struct rk_clk_pll_def dpll = { Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.c Fri May 10 16:44:35 2019 (r347441) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.c Fri May 10 16:45:17 2019 (r347442) @@ -54,6 +54,8 @@ struct rk_clk_pll_sc { struct rk_clk_pll_rate *rates; struct rk_clk_pll_rate *frac_rates; + + bool normal_mode; }; #define WRITE4(_clk, off, val) \ @@ -344,11 +346,13 @@ rk3399_clk_pll_init(struct clknode *clk, device_t dev) sc = clknode_get_softc(clk); - /* Setting to normal mode */ - reg = RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT; - reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT; - WRITE4(clk, sc->base_offset + RK3399_CLK_PLL_MODE_OFFSET, - reg | RK3399_CLK_PLL_WRITE_MASK); + if (sc->normal_mode) { + /* Setting to normal mode */ + reg = RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT; + reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT; + WRITE4(clk, sc->base_offset + RK3399_CLK_PLL_MODE_OFFSET, + reg | RK3399_CLK_PLL_WRITE_MASK); + } clknode_init_parent_idx(clk, 0); @@ -521,6 +525,7 @@ rk3399_clk_pll_register(struct clkdom *clkdom, struct sc->flags = clkdef->flags; sc->rates = clkdef->rates; sc->frac_rates = clkdef->frac_rates; + sc->normal_mode = clkdef->normal_mode; clknode_register(clkdom, clk); Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.h Fri May 10 16:44:35 2019 (r347441) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.h Fri May 10 16:45:17 2019 (r347442) @@ -57,6 +57,8 @@ struct rk_clk_pll_def { struct rk_clk_pll_rate *rates; struct rk_clk_pll_rate *frac_rates; + + bool normal_mode; }; #define RK_CLK_PLL_HAVE_GATE 0x1 From owner-svn-src-all@freebsd.org Fri May 10 16:51:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5BFB15A7507; Fri, 10 May 2019 16:51:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B94C81295; Fri, 10 May 2019 16:51:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48BA97151; Fri, 10 May 2019 16:51:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AGpbrY092175; Fri, 10 May 2019 16:51:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AGpb2K092174; Fri, 10 May 2019 16:51:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905101651.x4AGpb2K092174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 10 May 2019 16:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347443 - stable/11/sys/amd64/vmm/io X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/amd64/vmm/io X-SVN-Commit-Revision: 347443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B94C81295 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 16:51:37 -0000 Author: jhb Date: Fri May 10 16:51:36 2019 New Revision: 347443 URL: https://svnweb.freebsd.org/changeset/base/347443 Log: Complete the MFC of 345963 after the MFC of 333174. Suggested by: kib Modified: stable/11/sys/amd64/vmm/io/ppt.c Modified: stable/11/sys/amd64/vmm/io/ppt.c ============================================================================== --- stable/11/sys/amd64/vmm/io/ppt.c Fri May 10 16:45:17 2019 (r347442) +++ stable/11/sys/amd64/vmm/io/ppt.c Fri May 10 16:51:36 2019 (r347443) @@ -354,25 +354,12 @@ ppt_is_mmio(struct vm *vm, vm_paddr_t gpa) static void ppt_pci_reset(device_t dev) { - int ps; if (pcie_flr(dev, - max(pcie_get_max_completion_timeout(dev) / 1000, 10), - true)) + max(pcie_get_max_completion_timeout(dev) / 1000, 10), true)) return; - /* - * If FLR fails, attempt a power-management reset by cycling - * the device in/out of D3 state. - * PCI spec says we can only go into D3 state from D0 state. - * Transition from D[12] into D0 before going to D3 state. - */ - ps = pci_get_powerstate(dev); - if (ps != PCI_POWERSTATE_D0 && ps != PCI_POWERSTATE_D3) - pci_set_powerstate(dev, PCI_POWERSTATE_D0); - if (pci_get_powerstate(dev) != PCI_POWERSTATE_D3) - pci_set_powerstate(dev, PCI_POWERSTATE_D3); - pci_set_powerstate(dev, ps); + pci_power_reset(dev); } int From owner-svn-src-all@freebsd.org Fri May 10 17:05:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8082E15A7BC1; Fri, 10 May 2019 17:05:41 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DD981E4E; Fri, 10 May 2019 17:05:41 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 231AF7347; Fri, 10 May 2019 17:05:41 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AH5faW098551; Fri, 10 May 2019 17:05:41 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AH5fMN098550; Fri, 10 May 2019 17:05:41 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201905101705.x4AH5fMN098550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Fri, 10 May 2019 17:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347445 - head/usr.bin/dtc X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/usr.bin/dtc X-SVN-Commit-Revision: 347445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46DD981E4E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:05:41 -0000 Author: luporl Date: Fri May 10 17:05:40 2019 New Revision: 347445 URL: https://svnweb.freebsd.org/changeset/base/347445 Log: Fix build issue with clang 8.0.1 The algorithm header is needed to use std::remove_if Modified: head/usr.bin/dtc/fdt.hh Modified: head/usr.bin/dtc/fdt.hh ============================================================================== --- head/usr.bin/dtc/fdt.hh Fri May 10 16:58:05 2019 (r347444) +++ head/usr.bin/dtc/fdt.hh Fri May 10 17:05:40 2019 (r347445) @@ -34,6 +34,7 @@ #ifndef _FDT_HH_ #define _FDT_HH_ +#include #include #include #include From owner-svn-src-all@freebsd.org Fri May 10 17:28:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 034C815A83B1; Fri, 10 May 2019 17:28:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CDD4829B3; Fri, 10 May 2019 17:28:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B74D76A5; Fri, 10 May 2019 17:28:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHSt4s009238; Fri, 10 May 2019 17:28:55 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHSs1g009236; Fri, 10 May 2019 17:28:54 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101728.x4AHSs1g009236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347446 - vendor/netcat/dist X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/dist X-SVN-Commit-Revision: 347446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9CDD4829B3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:28:56 -0000 Author: des Date: Fri May 10 17:28:54 2019 New Revision: 347446 URL: https://svnweb.freebsd.org/changeset/base/347446 Log: Import netcat from OpenBSD 6.0. Modified: vendor/netcat/dist/nc.1 vendor/netcat/dist/netcat.c vendor/netcat/dist/socks.c Modified: vendor/netcat/dist/nc.1 ============================================================================== --- vendor/netcat/dist/nc.1 Fri May 10 17:05:40 2019 (r347445) +++ vendor/netcat/dist/nc.1 Fri May 10 17:28:54 2019 (r347446) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.71 2015/09/25 14:56:33 schwarze Exp $ +.\" $OpenBSD: nc.1,v 1.74 2016/07/02 05:58:00 jmc Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: September 12 2015 $ +.Dd $Mdocdate: July 2 2016 $ .Dt NC 1 .Os .Sh NAME @@ -40,6 +40,8 @@ .Op Fl I Ar length .Op Fl i Ar interval .Op Fl K Ar keyfile +.Op Fl M Ar ttl +.Op Fl m Ar minttl .Op Fl O Ar length .Op Fl P Ar proxy_username .Op Fl p Ar source_port @@ -171,6 +173,11 @@ options. Additionally, any timeouts specified with the .Fl w option are ignored. +.It Fl M Ar ttl +Set the TTL / hop limit of outgoing packets. +.It Fl m Ar minttl +Ask the kernel to drop incoming packets whose TTL / hop limit is under +.Ar minttl . .It Fl N .Xr shutdown 2 the network socket after EOF on the input. @@ -337,8 +344,8 @@ sockets, a destination is required and is the socket p option is given). .Pp .Ar port -can be a single integer or a range of ports. -Ranges are in the form nn-mm. +can be a specified as a numeric port number, or as a service name. +Ports may be specified in a range of the form nn-mm. In general, a destination port must be specified, unless the Modified: vendor/netcat/dist/netcat.c ============================================================================== --- vendor/netcat/dist/netcat.c Fri May 10 17:05:40 2019 (r347445) +++ vendor/netcat/dist/netcat.c Fri May 10 17:28:54 2019 (r347446) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.150 2016/01/04 02:18:31 bcook Exp $ */ +/* $OpenBSD: netcat.c,v 1.160 2016/07/13 16:35:47 jsing Exp $ */ /* * Copyright (c) 2001 Eric Jackson * Copyright (c) 2015 Bob Beck. All rights reserved. @@ -115,6 +115,8 @@ int timeout = -1; int family = AF_UNSPEC; char *portlist[PORT_MAX+1]; char *unix_dg_tmp_socket; +int ttl = -1; +int minttl = -1; void atelnet(int, unsigned char *, unsigned int); void build_ports(char *); @@ -133,7 +135,7 @@ int unix_listen(char *); void set_common_sockopts(int, int); int map_tos(char *, int *); int map_tls(char *, int *); -void report_connect(const struct sockaddr *, socklen_t); +void report_connect(const struct sockaddr *, socklen_t, char *); void report_tls(struct tls *tls_ctx, char * host, char *tls_expectname); void usage(int); ssize_t drainbuf(int, unsigned char *, size_t *, struct tls *); @@ -144,7 +146,7 @@ struct tls *tls_setup_server(struct tls *, int, char * int main(int argc, char *argv[]) { - int ch, s, ret, socksv; + int ch, s = -1, ret, socksv; char *host, *uport; struct addrinfo hints; struct servent *sv; @@ -158,7 +160,6 @@ main(int argc, char *argv[]) struct tls *tls_ctx = NULL; ret = 1; - s = 0; socksv = 5; host = NULL; uport = NULL; @@ -167,7 +168,7 @@ main(int argc, char *argv[]) signal(SIGPIPE, SIG_IGN); while ((ch = getopt(argc, argv, - "46C:cDde:FH:hI:i:K:klNnO:P:p:R:rSs:T:tUuV:vw:X:x:z")) != -1) { + "46C:cDde:FH:hI:i:K:klM:m:NnO:P:p:R:rSs:T:tUuV:vw:X:x:z")) != -1) { switch (ch) { case '4': family = AF_INET; @@ -223,6 +224,16 @@ main(int argc, char *argv[]) case 'l': lflag = 1; break; + case 'M': + ttl = strtonum(optarg, 0, 255, &errstr); + if (errstr) + errx(1, "ttl is %s", errstr); + break; + case 'm': + minttl = strtonum(optarg, 0, 255, &errstr); + if (errstr) + errx(1, "minttl is %s", errstr); + break; case 'N': Nflag = 1; break; @@ -323,8 +334,14 @@ main(int argc, char *argv[]) if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) err(1, "pledge"); } else if (Fflag) { - if (pledge("stdio inet dns sendfd", NULL) == -1) + if (Pflag) { + if (pledge("stdio inet dns sendfd tty", NULL) == -1) + err(1, "pledge"); + } else if (pledge("stdio inet dns sendfd", NULL) == -1) err(1, "pledge"); + } else if (Pflag) { + if (pledge("stdio inet dns tty", NULL) == -1) + err(1, "pledge"); } else if (usetls) { if (pledge("stdio rpath inet dns", NULL) == -1) err(1, "pledge"); @@ -434,7 +451,10 @@ main(int argc, char *argv[]) if (Kflag && (privkey = tls_load_file(Kflag, &privkeylen, NULL)) == NULL) errx(1, "unable to load TLS key file %s", Kflag); - if (pledge("stdio inet dns", NULL) == -1) + if (Pflag) { + if (pledge("stdio inet dns tty", NULL) == -1) + err(1, "pledge"); + } else if (pledge("stdio inet dns", NULL) == -1) err(1, "pledge"); if (tls_init() == -1) @@ -449,7 +469,7 @@ main(int argc, char *argv[]) errx(1, "unable to set TLS key file %s", Kflag); if (TLSopt & TLS_LEGACY) { tls_config_set_protocols(tls_cfg, TLS_PROTOCOLS_ALL); - tls_config_set_ciphers(tls_cfg, "legacy"); + tls_config_set_ciphers(tls_cfg, "all"); } if (!lflag && (TLSopt & TLS_CCERT)) errx(1, "clientcert is only valid with -l"); @@ -516,7 +536,7 @@ main(int argc, char *argv[]) err(1, "connect"); if (vflag) - report_connect((struct sockaddr *)&z, len); + report_connect((struct sockaddr *)&z, len, NULL); readwrite(s, NULL); } else { @@ -528,7 +548,8 @@ main(int argc, char *argv[]) err(1, "accept"); } if (vflag) - report_connect((struct sockaddr *)&cliaddr, len); + report_connect((struct sockaddr *)&cliaddr, len, + family == AF_UNIX ? host : NULL); if ((usetls) && (tls_cctx = tls_setup_server(tls_ctx, connfd, host))) readwrite(connfd, tls_cctx); @@ -576,8 +597,8 @@ main(int argc, char *argv[]) build_ports(uport); /* Cycle through portlist, connecting to each port. */ - for (i = 0; portlist[i] != NULL; i++) { - if (s) + for (s = -1, i = 0; portlist[i] != NULL; i++) { + if (s != -1) close(s); if (usetls) { @@ -594,7 +615,7 @@ main(int argc, char *argv[]) else s = remote_connect(host, portlist[i], hints); - if (s < 0) + if (s == -1) continue; ret = 0; @@ -643,7 +664,7 @@ main(int argc, char *argv[]) } } - if (s) + if (s != -1) close(s); tls_config_free(tls_cfg); @@ -659,7 +680,7 @@ int unix_bind(char *path, int flags) { struct sockaddr_un s_un; - int s; + int s, save_errno; /* Create unix domain socket. */ if ((s = socket(AF_UNIX, flags | (uflag ? SOCK_DGRAM : SOCK_STREAM), @@ -677,7 +698,9 @@ unix_bind(char *path, int flags) } if (bind(s, (struct sockaddr *)&s_un, sizeof(s_un)) < 0) { + save_errno = errno; close(s); + errno = save_errno; return (-1); } return (s); @@ -753,7 +776,7 @@ int unix_connect(char *path) { struct sockaddr_un s_un; - int s; + int s, save_errno; if (uflag) { if ((s = unix_bind(unix_dg_tmp_socket, SOCK_CLOEXEC)) < 0) @@ -773,7 +796,9 @@ unix_connect(char *path) return (-1); } if (connect(s, (struct sockaddr *)&s_un, sizeof(s_un)) < 0) { + save_errno = errno; close(s); + errno = save_errno; return (-1); } return (s); @@ -807,7 +832,7 @@ int remote_connect(const char *host, const char *port, struct addrinfo hints) { struct addrinfo *res, *res0; - int s, error, on = 1; + int s, error, on = 1, save_errno; if ((error = getaddrinfo(host, port, &hints, &res))) errx(1, "getaddrinfo: %s", gai_strerror(error)); @@ -846,7 +871,9 @@ remote_connect(const char *host, const char *port, str warn("connect to %s port %s (%s) failed", host, port, uflag ? "udp" : "tcp"); + save_errno = errno; close(s); + errno = save_errno; s = -1; } while ((res0 = res0->ai_next) != NULL); @@ -892,7 +919,7 @@ int local_listen(char *host, char *port, struct addrinfo hints) { struct addrinfo *res, *res0; - int s, ret, x = 1; + int s, ret, x = 1, save_errno; int error; /* Allow nodename to be null. */ @@ -924,7 +951,9 @@ local_listen(char *host, char *port, struct addrinfo h res0->ai_addrlen) == 0) break; + save_errno = errno; close(s); + errno = save_errno; s = -1; } while ((res0 = res0->ai_next) != NULL); @@ -1273,6 +1302,27 @@ atelnet(int nfd, unsigned char *buf, unsigned int size } } + +int +strtoport(char *portstr, int udp) +{ + struct servent *entry; + const char *errstr; + char *proto; + int port = -1; + + proto = udp ? "udp" : "tcp"; + + port = strtonum(portstr, 1, PORT_MAX, &errstr); + if (errstr == NULL) + return port; + if (errno != EINVAL) + errx(1, "port number %s: %s", errstr, portstr); + if ((entry = getservbyname(portstr, proto)) == NULL) + errx(1, "service \"%s\" unknown", portstr); + return ntohs(entry->s_port); +} + /* * build_ports() * Build an array of ports in portlist[], listing each port @@ -1281,7 +1331,6 @@ atelnet(int nfd, unsigned char *buf, unsigned int size void build_ports(char *p) { - const char *errstr; char *n; int hi, lo, cp; int x = 0; @@ -1291,13 +1340,8 @@ build_ports(char *p) n++; /* Make sure the ports are in order: lowest->highest. */ - hi = strtonum(n, 1, PORT_MAX, &errstr); - if (errstr) - errx(1, "port number %s: %s", errstr, n); - lo = strtonum(p, 1, PORT_MAX, &errstr); - if (errstr) - errx(1, "port number %s: %s", errstr, p); - + hi = strtoport(n, uflag); + lo = strtoport(p, uflag); if (lo > hi) { cp = hi; hi = lo; @@ -1323,11 +1367,12 @@ build_ports(char *p) } } } else { - hi = strtonum(p, 1, PORT_MAX, &errstr); - if (errstr) - errx(1, "port number %s: %s", errstr, p); - portlist[0] = strdup(p); - if (portlist[0] == NULL) + char *tmp; + + hi = strtoport(p, uflag); + if (asprintf(&tmp, "%d", hi) != -1) + portlist[0] = tmp; + else err(1, NULL); } } @@ -1367,18 +1412,13 @@ set_common_sockopts(int s, int af) err(1, NULL); } if (Tflag != -1) { - int proto, option; - - if (af == AF_INET6) { - proto = IPPROTO_IPV6; - option = IPV6_TCLASS; - } else { - proto = IPPROTO_IP; - option = IP_TOS; - } - - if (setsockopt(s, proto, option, &Tflag, sizeof(Tflag)) == -1) + if (af == AF_INET && setsockopt(s, IPPROTO_IP, + IP_TOS, &Tflag, sizeof(Tflag)) == -1) err(1, "set IP ToS"); + + else if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6, + IPV6_TCLASS, &Tflag, sizeof(Tflag)) == -1) + err(1, "set IPv6 traffic class"); } if (Iflag) { if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, @@ -1390,6 +1430,26 @@ set_common_sockopts(int s, int af) &Oflag, sizeof(Oflag)) == -1) err(1, "set TCP send buffer size"); } + + if (ttl != -1) { + if (af == AF_INET && setsockopt(s, IPPROTO_IP, + IP_TTL, &ttl, sizeof(ttl))) + err(1, "set IP TTL"); + + else if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6, + IPV6_UNICAST_HOPS, &ttl, sizeof(ttl))) + err(1, "set IPv6 unicast hops"); + } + + if (minttl != -1) { + if (af == AF_INET && setsockopt(s, IPPROTO_IP, + IP_MINTTL, &minttl, sizeof(minttl))) + err(1, "set IP min TTL"); + + else if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6, + IPV6_MINHOPCOUNT, &minttl, sizeof(minttl))) + err(1, "set IPv6 min hop count"); + } } int @@ -1487,13 +1547,18 @@ report_tls(struct tls * tls_ctx, char * host, char *tl } void -report_connect(const struct sockaddr *sa, socklen_t salen) +report_connect(const struct sockaddr *sa, socklen_t salen, char *path) { char remote_host[NI_MAXHOST]; char remote_port[NI_MAXSERV]; int herr; int flags = NI_NUMERICSERV; + if (path != NULL) { + fprintf(stderr, "Connection on %s received!\n", path); + return; + } + if (nflag) flags |= NI_NUMERICHOST; @@ -1532,6 +1597,8 @@ help(void) \t-K keyfile Private key file\n\ \t-k Keep inbound sockets open for multiple connects\n\ \t-l Listen mode, for inbound connects\n\ + \t-M ttl Outgoing TTL / Hop Limit\n\ + \t-m minttl Minimum incoming TTL / Hop Limit\n\ \t-N Shutdown the network socket after EOF on stdin\n\ \t-n Suppress name/port resolutions\n\ \t-O length TCP send buffer length\n\ @@ -1561,11 +1628,10 @@ usage(int ret) fprintf(stderr, "usage: nc [-46cDdFhklNnrStUuvz] [-C certfile] [-e name] " "[-H hash] [-I length]\n" - "\t [-i interval] [-K keyfile] [-O length] [-P proxy_username]\n" - "\t [-p source_port] [-R CAfile] [-s source] " - "[-T keyword] [-V rtable]\n" - "\t [-w timeout] [-X proxy_protocol] [-x proxy_address[:port]]\n" - "\t [destination] [port]\n"); + "\t [-i interval] [-K keyfile] [-M ttl] [-m minttl] [-O length]\n" + "\t [-P proxy_username] [-p source_port] [-R CAfile] [-s source]\n" + "\t [-T keyword] [-V rtable] [-w timeout] [-X proxy_protocol]\n" + "\t [-x proxy_address[:port]] [destination] [port]\n"); if (ret) exit(1); } Modified: vendor/netcat/dist/socks.c ============================================================================== --- vendor/netcat/dist/socks.c Fri May 10 17:05:40 2019 (r347445) +++ vendor/netcat/dist/socks.c Fri May 10 17:28:54 2019 (r347446) @@ -1,4 +1,4 @@ -/* $OpenBSD: socks.c,v 1.23 2015/12/10 18:31:52 mmcc Exp $ */ +/* $OpenBSD: socks.c,v 1.24 2016/06/27 14:43:04 deraadt Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -241,7 +241,7 @@ socks_connect(const char *host, const char *port, buf[2] = 0; buf[3] = SOCKS_DOMAIN; buf[4] = hlen; - memcpy(buf + 5, host, hlen); + memcpy(buf + 5, host, hlen); memcpy(buf + 5 + hlen, &serverport, sizeof serverport); wlen = 7 + hlen; break; From owner-svn-src-all@freebsd.org Fri May 10 17:29:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AE3315A83D1; Fri, 10 May 2019 17:29:01 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3796C829E6; Fri, 10 May 2019 17:29:01 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A012A76A6; Fri, 10 May 2019 17:29:00 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHT0MQ009291; Fri, 10 May 2019 17:29:00 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHT0bh009290; Fri, 10 May 2019 17:29:00 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101729.x4AHT0bh009290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347447 - vendor/netcat/6.0 X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/6.0 X-SVN-Commit-Revision: 347447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3796C829E6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:29:01 -0000 Author: des Date: Fri May 10 17:29:00 2019 New Revision: 347447 URL: https://svnweb.freebsd.org/changeset/base/347447 Log: Tag netcat from OpenBSD 6.0. Added: vendor/netcat/6.0/ - copied from r347446, vendor/netcat/dist/ From owner-svn-src-all@freebsd.org Fri May 10 17:29:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A14915A8415; Fri, 10 May 2019 17:29:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0D2C82BD8; Fri, 10 May 2019 17:29:17 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF59A76A9; Fri, 10 May 2019 17:29:17 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHTHl7009371; Fri, 10 May 2019 17:29:17 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHTH2s009370; Fri, 10 May 2019 17:29:17 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101729.x4AHTH2s009370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347448 - vendor/netcat/dist X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/dist X-SVN-Commit-Revision: 347448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0D2C82BD8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:29:18 -0000 Author: des Date: Fri May 10 17:29:17 2019 New Revision: 347448 URL: https://svnweb.freebsd.org/changeset/base/347448 Log: Import netcat from OpenBSD 6.1. Modified: vendor/netcat/dist/nc.1 vendor/netcat/dist/netcat.c Modified: vendor/netcat/dist/nc.1 ============================================================================== --- vendor/netcat/dist/nc.1 Fri May 10 17:29:00 2019 (r347447) +++ vendor/netcat/dist/nc.1 Fri May 10 17:29:17 2019 (r347448) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.74 2016/07/02 05:58:00 jmc Exp $ +.\" $OpenBSD: nc.1,v 1.82 2017/02/09 20:15:59 jca Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 2 2016 $ +.Dd $Mdocdate: February 9 2017 $ .Dt NC 1 .Os .Sh NAME @@ -43,6 +43,7 @@ .Op Fl M Ar ttl .Op Fl m Ar minttl .Op Fl O Ar length +.Op Fl o Ar staplefile .Op Fl P Ar proxy_username .Op Fl p Ar source_port .Op Fl R Ar CAfile @@ -187,6 +188,12 @@ Do not do any DNS or service lookups on any specified hostnames or ports. .It Fl O Ar length Specifies the size of the TCP send buffer. +.It Fl o Ar staplefile +Specifies the filename from which to load data to be stapled +during the TLS handshake. +The file is expected to contain an OCSP response from an OCSP server in +DER format. +May only be used with TLS and when a certificate is being used. .It Fl P Ar proxy_username Specifies a username to present to a proxy server that requires authentication. If no username is specified then authentication will not be attempted. @@ -224,14 +231,17 @@ Change IPv4 TOS value or TLS options. For TLS options .Ar keyword may be one of -.Ar tlslegacy , -which allows legacy TLS protocols; -.Ar noverify , +.Ar tlsall ; +which allows the use of all supported TLS protocols and ciphers, +.Ar noverify ; which disables certificate verification; .Ar noname , -which disables certificate name checking; or +which disables certificate name checking; .Ar clientcert , -which requires a client certificate on incoming connections. +which requires a client certificate on incoming connections; or +.Ar muststaple , +which requires the peer to provide a valid stapled OCSP response +with the handshake. It is illegal to specify TLS options if not using TLS. .Pp For IPv4 TOS value @@ -317,6 +327,9 @@ If .Ar port is not specified, the well-known port for the proxy protocol is used (1080 for SOCKS, 3128 for HTTPS). +An IPv6 address can be specified unambiguously by enclosing +.Ar proxy_address +in square brackets. .It Fl z Specifies that .Nm Modified: vendor/netcat/dist/netcat.c ============================================================================== --- vendor/netcat/dist/netcat.c Fri May 10 17:29:00 2019 (r347447) +++ vendor/netcat/dist/netcat.c Fri May 10 17:29:17 2019 (r347448) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.160 2016/07/13 16:35:47 jsing Exp $ */ +/* $OpenBSD: netcat.c,v 1.178 2017/03/09 13:58:00 bluhm Exp $ */ /* * Copyright (c) 2001 Eric Jackson * Copyright (c) 2015 Bob Beck. All rights reserved. @@ -67,10 +67,11 @@ #define BUFSIZE 16384 #define DEFAULT_CA_FILE "/etc/ssl/cert.pem" -#define TLS_LEGACY (1 << 1) +#define TLS_ALL (1 << 1) #define TLS_NOVERIFY (1 << 2) #define TLS_NONAME (1 << 3) #define TLS_CCERT (1 << 4) +#define TLS_MUSTSTAPLE (1 << 5) /* Command Line Options */ int dflag; /* detached, no stdin */ @@ -99,17 +100,12 @@ int rtableid = -1; int usetls; /* use TLS */ char *Cflag; /* Public cert file */ char *Kflag; /* Private key file */ +char *oflag; /* OCSP stapling file */ char *Rflag = DEFAULT_CA_FILE; /* Root CA file */ int tls_cachanged; /* Using non-default CA file */ int TLSopt; /* TLS options */ char *tls_expectname; /* required name in peer cert */ char *tls_expecthash; /* required hash of peer cert */ -uint8_t *cacert; -size_t cacertlen; -uint8_t *privkey; -size_t privkeylen; -uint8_t *pubcert; -size_t pubcertlen; int timeout = -1; int family = AF_UNSPEC; @@ -125,6 +121,7 @@ int local_listen(char *, char *, struct addrinfo); void readwrite(int, struct tls *); void fdpass(int nfd) __attribute__((noreturn)); int remote_connect(const char *, const char *, struct addrinfo); +int timeout_tls(int, struct tls *, int (*)(struct tls *)); int timeout_connect(int, const struct sockaddr *, socklen_t); int socks_connect(const char *, const char *, struct addrinfo, const char *, const char *, struct addrinfo, int, const char *); @@ -152,8 +149,8 @@ main(int argc, char *argv[]) struct servent *sv; socklen_t len; struct sockaddr_storage cliaddr; - char *proxy; - const char *errstr, *proxyhost = "", *proxyport = NULL; + char *proxy, *proxyport = NULL; + const char *errstr; struct addrinfo proxyhints; char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; struct tls_config *tls_cfg = NULL; @@ -168,7 +165,7 @@ main(int argc, char *argv[]) signal(SIGPIPE, SIG_IGN); while ((ch = getopt(argc, argv, - "46C:cDde:FH:hI:i:K:klM:m:NnO:P:p:R:rSs:T:tUuV:vw:X:x:z")) != -1) { + "46C:cDde:FH:hI:i:K:klM:m:NnO:o:P:p:R:rSs:T:tUuV:vw:X:x:z")) != -1) { switch (ch) { case '4': family = AF_INET; @@ -300,6 +297,9 @@ main(int argc, char *argv[]) errx(1, "TCP send window %s: %s", errstr, optarg); break; + case 'o': + oflag = optarg; + break; case 'S': Sflag = 1; break; @@ -385,6 +385,8 @@ main(int argc, char *argv[]) errx(1, "you must specify -c to use -C"); if (Kflag && !usetls) errx(1, "you must specify -c to use -K"); + if (oflag && !Cflag) + errx(1, "you must specify -C to use -o"); if (tls_cachanged && !usetls) errx(1, "you must specify -c to use -R"); if (tls_expecthash && !usetls) @@ -425,15 +427,29 @@ main(int argc, char *argv[]) if (family == AF_UNIX) errx(1, "no proxy support for unix sockets"); - /* XXX IPv6 transport to proxy would probably work */ - if (family == AF_INET6) - errx(1, "no proxy support for IPv6"); - if (sflag) errx(1, "no proxy support for local source address"); - proxyhost = strsep(&proxy, ":"); - proxyport = proxy; + if (*proxy == '[') { + ++proxy; + proxyport = strchr(proxy, ']'); + if (proxyport == NULL) + errx(1, "missing closing bracket in proxy"); + *proxyport++ = '\0'; + if (*proxyport == '\0') + /* Use default proxy port. */ + proxyport = NULL; + else { + if (*proxyport == ':') + ++proxyport; + else + errx(1, "garbage proxy port delimiter"); + } + } else { + proxyport = strrchr(proxy, ':'); + if (proxyport != NULL) + *proxyport++ = '\0'; + } memset(&proxyhints, 0, sizeof(struct addrinfo)); proxyhints.ai_family = family; @@ -444,32 +460,30 @@ main(int argc, char *argv[]) } if (usetls) { - if (Rflag && (cacert = tls_load_file(Rflag, &cacertlen, NULL)) == NULL) - errx(1, "unable to load root CA file %s", Rflag); - if (Cflag && (pubcert = tls_load_file(Cflag, &pubcertlen, NULL)) == NULL) - errx(1, "unable to load TLS certificate file %s", Cflag); - if (Kflag && (privkey = tls_load_file(Kflag, &privkeylen, NULL)) == NULL) - errx(1, "unable to load TLS key file %s", Kflag); - if (Pflag) { - if (pledge("stdio inet dns tty", NULL) == -1) + if (pledge("stdio inet dns tty rpath", NULL) == -1) err(1, "pledge"); - } else if (pledge("stdio inet dns", NULL) == -1) + } else if (pledge("stdio inet dns rpath", NULL) == -1) err(1, "pledge"); if (tls_init() == -1) errx(1, "unable to initialize TLS"); if ((tls_cfg = tls_config_new()) == NULL) errx(1, "unable to allocate TLS config"); - if (Rflag && tls_config_set_ca_mem(tls_cfg, cacert, cacertlen) == -1) - errx(1, "unable to set root CA file %s", Rflag); - if (Cflag && tls_config_set_cert_mem(tls_cfg, pubcert, pubcertlen) == -1) - errx(1, "unable to set TLS certificate file %s", Cflag); - if (Kflag && tls_config_set_key_mem(tls_cfg, privkey, privkeylen) == -1) - errx(1, "unable to set TLS key file %s", Kflag); - if (TLSopt & TLS_LEGACY) { - tls_config_set_protocols(tls_cfg, TLS_PROTOCOLS_ALL); - tls_config_set_ciphers(tls_cfg, "all"); + if (Rflag && tls_config_set_ca_file(tls_cfg, Rflag) == -1) + errx(1, "%s", tls_config_error(tls_cfg)); + if (Cflag && tls_config_set_cert_file(tls_cfg, Cflag) == -1) + errx(1, "%s", tls_config_error(tls_cfg)); + if (Kflag && tls_config_set_key_file(tls_cfg, Kflag) == -1) + errx(1, "%s", tls_config_error(tls_cfg)); + if (oflag && tls_config_set_ocsp_staple_file(tls_cfg, oflag) == -1) + errx(1, "%s", tls_config_error(tls_cfg)); + if (TLSopt & TLS_ALL) { + if (tls_config_set_protocols(tls_cfg, + TLS_PROTOCOLS_ALL) != 0) + errx(1, "%s", tls_config_error(tls_cfg)); + if (tls_config_set_ciphers(tls_cfg, "all") != 0) + errx(1, "%s", tls_config_error(tls_cfg)); } if (!lflag && (TLSopt & TLS_CCERT)) errx(1, "clientcert is only valid with -l"); @@ -481,6 +495,14 @@ main(int argc, char *argv[]) "together"); tls_config_insecure_noverifycert(tls_cfg); } + if (TLSopt & TLS_MUSTSTAPLE) + tls_config_ocsp_require_stapling(tls_cfg); + + if (Pflag) { + if (pledge("stdio inet dns tty", NULL) == -1) + err(1, "pledge"); + } else if (pledge("stdio inet dns", NULL) == -1) + err(1, "pledge"); } if (lflag) { struct tls *tls_cctx = NULL; @@ -556,12 +578,7 @@ main(int argc, char *argv[]) if (!usetls) readwrite(connfd, NULL); if (tls_cctx) { - int i; - - do { - i = tls_close(tls_cctx); - } while (i == TLS_WANT_POLLIN || - i == TLS_WANT_POLLOUT); + timeout_tls(s, tls_cctx, tls_close); tls_free(tls_cctx); tls_cctx = NULL; } @@ -580,8 +597,9 @@ main(int argc, char *argv[]) } else if (family == AF_UNIX) { ret = 0; - if ((s = unix_connect(host)) > 0 && !zflag) { - readwrite(s, NULL); + if ((s = unix_connect(host)) > 0) { + if (!zflag) + readwrite(s, NULL); close(s); } else ret = 1; @@ -610,7 +628,7 @@ main(int argc, char *argv[]) } if (xflag) s = socks_connect(host, portlist[i], hints, - proxyhost, proxyport, proxyhints, socksv, + proxy, proxyport, proxyhints, socksv, Pflag); else s = remote_connect(host, portlist[i], hints); @@ -651,12 +669,7 @@ main(int argc, char *argv[]) if (!zflag) readwrite(s, tls_ctx); if (tls_ctx) { - int j; - - do { - j = tls_close(tls_ctx); - } while (j == TLS_WANT_POLLIN || - j == TLS_WANT_POLLOUT); + timeout_tls(s, tls_ctx, tls_close); tls_free(tls_ctx); tls_ctx = NULL; } @@ -706,21 +719,48 @@ unix_bind(char *path, int flags) return (s); } +int +timeout_tls(int s, struct tls *tls_ctx, int (*func)(struct tls *)) +{ + struct pollfd pfd; + int ret; + + while ((ret = (*func)(tls_ctx)) != 0) { + if (ret == TLS_WANT_POLLIN) + pfd.events = POLLIN; + else if (ret == TLS_WANT_POLLOUT) + pfd.events = POLLOUT; + else + break; + pfd.fd = s; + if ((ret = poll(&pfd, 1, timeout)) == 1) + continue; + else if (ret == 0) { + errno = ETIMEDOUT; + ret = -1; + break; + } else + err(1, "poll failed"); + } + + return (ret); +} + void tls_setup_client(struct tls *tls_ctx, int s, char *host) { - int i; + const char *errstr; if (tls_connect_socket(tls_ctx, s, tls_expectname ? tls_expectname : host) == -1) { errx(1, "tls connection failed (%s)", tls_error(tls_ctx)); } - do { - if ((i = tls_handshake(tls_ctx)) == -1) - errx(1, "tls handshake failed (%s)", - tls_error(tls_ctx)); - } while (i == TLS_WANT_POLLIN || i == TLS_WANT_POLLOUT); + if (timeout_tls(s, tls_ctx, tls_handshake) == -1) { + if ((errstr = tls_error(tls_ctx)) == NULL) + errstr = strerror(errno); + errx(1, "tls handshake failed (%s)", errstr); + } if (vflag) report_tls(tls_ctx, host, tls_expectname); if (tls_expecthash && tls_peer_cert_hash(tls_ctx) && @@ -732,22 +772,15 @@ struct tls * tls_setup_server(struct tls *tls_ctx, int connfd, char *host) { struct tls *tls_cctx; + const char *errstr; - if (tls_accept_socket(tls_ctx, &tls_cctx, - connfd) == -1) { - warnx("tls accept failed (%s)", - tls_error(tls_ctx)); - tls_cctx = NULL; + if (tls_accept_socket(tls_ctx, &tls_cctx, connfd) == -1) { + warnx("tls accept failed (%s)", tls_error(tls_ctx)); + } else if (timeout_tls(connfd, tls_cctx, tls_handshake) == -1) { + if ((errstr = tls_error(tls_cctx)) == NULL) + errstr = strerror(errno); + warnx("tls handshake failed (%s)", errstr); } else { - int i; - - do { - if ((i = tls_handshake(tls_cctx)) == -1) - warnx("tls handshake failed (%s)", - tls_error(tls_cctx)); - } while(i == TLS_WANT_POLLIN || i == TLS_WANT_POLLOUT); - } - if (tls_cctx) { int gotcert = tls_peer_cert_provided(tls_cctx); if (vflag && gotcert) @@ -832,15 +865,15 @@ int remote_connect(const char *host, const char *port, struct addrinfo hints) { struct addrinfo *res, *res0; - int s, error, on = 1, save_errno; + int s = -1, error, on = 1, save_errno; - if ((error = getaddrinfo(host, port, &hints, &res))) - errx(1, "getaddrinfo: %s", gai_strerror(error)); + if ((error = getaddrinfo(host, port, &hints, &res0))) + errx(1, "getaddrinfo for host \"%s\" port %s: %s", host, + port, gai_strerror(error)); - res0 = res; - do { - if ((s = socket(res0->ai_family, res0->ai_socktype | - SOCK_NONBLOCK, res0->ai_protocol)) < 0) + for (res = res0; res; res = res->ai_next) { + if ((s = socket(res->ai_family, res->ai_socktype | + SOCK_NONBLOCK, res->ai_protocol)) < 0) continue; /* Bind to a local port or source address if specified. */ @@ -850,7 +883,7 @@ remote_connect(const char *host, const char *port, str /* try SO_BINDANY, but don't insist */ setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on)); memset(&ahints, 0, sizeof(struct addrinfo)); - ahints.ai_family = res0->ai_family; + ahints.ai_family = res->ai_family; ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; ahints.ai_protocol = uflag ? IPPROTO_UDP : IPPROTO_TCP; ahints.ai_flags = AI_PASSIVE; @@ -863,9 +896,9 @@ remote_connect(const char *host, const char *port, str freeaddrinfo(ares); } - set_common_sockopts(s, res0->ai_family); + set_common_sockopts(s, res->ai_family); - if (timeout_connect(s, res0->ai_addr, res0->ai_addrlen) == 0) + if (timeout_connect(s, res->ai_addr, res->ai_addrlen) == 0) break; if (vflag) warn("connect to %s port %s (%s) failed", host, port, @@ -875,9 +908,9 @@ remote_connect(const char *host, const char *port, str close(s); errno = save_errno; s = -1; - } while ((res0 = res0->ai_next) != NULL); + } - freeaddrinfo(res); + freeaddrinfo(res0); return (s); } @@ -919,7 +952,7 @@ int local_listen(char *host, char *port, struct addrinfo hints) { struct addrinfo *res, *res0; - int s, ret, x = 1, save_errno; + int s = -1, ret, x = 1, save_errno; int error; /* Allow nodename to be null. */ @@ -932,37 +965,36 @@ local_listen(char *host, char *port, struct addrinfo h if (host == NULL && hints.ai_family == AF_UNSPEC) hints.ai_family = AF_INET; - if ((error = getaddrinfo(host, port, &hints, &res))) + if ((error = getaddrinfo(host, port, &hints, &res0))) errx(1, "getaddrinfo: %s", gai_strerror(error)); - res0 = res; - do { - if ((s = socket(res0->ai_family, res0->ai_socktype, - res0->ai_protocol)) < 0) + for (res = res0; res; res = res->ai_next) { + if ((s = socket(res->ai_family, res->ai_socktype, + res->ai_protocol)) < 0) continue; ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); if (ret == -1) err(1, NULL); - set_common_sockopts(s, res0->ai_family); + set_common_sockopts(s, res->ai_family); - if (bind(s, (struct sockaddr *)res0->ai_addr, - res0->ai_addrlen) == 0) + if (bind(s, (struct sockaddr *)res->ai_addr, + res->ai_addrlen) == 0) break; save_errno = errno; close(s); errno = save_errno; s = -1; - } while ((res0 = res0->ai_next) != NULL); + } if (!uflag && s != -1) { if (listen(s, 1) < 0) err(1, "listen"); } - freeaddrinfo(res); + freeaddrinfo(res0); return (s); } @@ -1007,21 +1039,15 @@ readwrite(int net_fd, struct tls *tls_ctx) while (1) { /* both inputs are gone, buffers are empty, we are done */ if (pfd[POLL_STDIN].fd == -1 && pfd[POLL_NETIN].fd == -1 && - stdinbufpos == 0 && netinbufpos == 0) { - close(net_fd); + stdinbufpos == 0 && netinbufpos == 0) return; - } /* both outputs are gone, we can't continue */ - if (pfd[POLL_NETOUT].fd == -1 && pfd[POLL_STDOUT].fd == -1) { - close(net_fd); + if (pfd[POLL_NETOUT].fd == -1 && pfd[POLL_STDOUT].fd == -1) return; - } /* listen and net in gone, queues empty, done */ if (lflag && pfd[POLL_NETIN].fd == -1 && - stdinbufpos == 0 && netinbufpos == 0) { - close(net_fd); + stdinbufpos == 0 && netinbufpos == 0) return; - } /* help says -i is for "wait between lines sent". We read and * write arbitrary amounts of data, and we don't want to start @@ -1033,10 +1059,8 @@ readwrite(int net_fd, struct tls *tls_ctx) num_fds = poll(pfd, 4, timeout); /* treat poll errors */ - if (num_fds == -1) { - close(net_fd); + if (num_fds == -1) err(1, "polling error"); - } /* timeout happened */ if (num_fds == 0) @@ -1507,10 +1531,11 @@ map_tls(char *s, int *val) const char *keyword; int val; } *t, tlskeywords[] = { - { "tlslegacy", TLS_LEGACY }, + { "tlsall", TLS_ALL }, { "noverify", TLS_NOVERIFY }, { "noname", TLS_NONAME }, { "clientcert", TLS_CCERT}, + { "muststaple", TLS_MUSTSTAPLE}, { NULL, -1 }, }; @@ -1527,6 +1552,8 @@ void report_tls(struct tls * tls_ctx, char * host, char *tls_expectname) { time_t t; + const char *ocsp_url; + fprintf(stderr, "TLS handshake negotiated %s/%s with host %s\n", tls_conn_version(tls_ctx), tls_conn_cipher(tls_ctx), host); fprintf(stderr, "Peer name: %s\n", @@ -1544,6 +1571,39 @@ report_tls(struct tls * tls_ctx, char * host, char *tl if (tls_peer_cert_hash(tls_ctx)) fprintf(stderr, "Cert Hash: %s\n", tls_peer_cert_hash(tls_ctx)); + ocsp_url = tls_peer_ocsp_url(tls_ctx); + if (ocsp_url != NULL) + fprintf(stderr, "OCSP URL: %s\n", ocsp_url); + switch (tls_peer_ocsp_response_status(tls_ctx)) { + case TLS_OCSP_RESPONSE_SUCCESSFUL: + fprintf(stderr, "OCSP Stapling: %s\n", + tls_peer_ocsp_result(tls_ctx) == NULL ? "" : + tls_peer_ocsp_result(tls_ctx)); + fprintf(stderr, + " response_status=%d cert_status=%d crl_reason=%d\n", + tls_peer_ocsp_response_status(tls_ctx), + tls_peer_ocsp_cert_status(tls_ctx), + tls_peer_ocsp_crl_reason(tls_ctx)); + t = tls_peer_ocsp_this_update(tls_ctx); + fprintf(stderr, " this update: %s", + t != -1 ? ctime(&t) : "\n"); + t = tls_peer_ocsp_next_update(tls_ctx); + fprintf(stderr, " next update: %s", + t != -1 ? ctime(&t) : "\n"); + t = tls_peer_ocsp_revocation_time(tls_ctx); + fprintf(stderr, " revocation: %s", + t != -1 ? ctime(&t) : "\n"); + break; + case -1: + break; + default: + fprintf(stderr, "OCSP Stapling: failure - response_status %d (%s)\n", + tls_peer_ocsp_response_status(tls_ctx), + tls_peer_ocsp_result(tls_ctx) == NULL ? "" : + tls_peer_ocsp_result(tls_ctx)); + break; + + } } void @@ -1602,6 +1662,7 @@ help(void) \t-N Shutdown the network socket after EOF on stdin\n\ \t-n Suppress name/port resolutions\n\ \t-O length TCP send buffer length\n\ + \t-o staplefile Staple file\n\ \t-P proxyuser\tUsername for proxy authentication\n\ \t-p port\t Specify local port for remote connects\n\ \t-R CAfile CA bundle\n\ @@ -1629,8 +1690,10 @@ usage(int ret) "usage: nc [-46cDdFhklNnrStUuvz] [-C certfile] [-e name] " "[-H hash] [-I length]\n" "\t [-i interval] [-K keyfile] [-M ttl] [-m minttl] [-O length]\n" - "\t [-P proxy_username] [-p source_port] [-R CAfile] [-s source]\n" - "\t [-T keyword] [-V rtable] [-w timeout] [-X proxy_protocol]\n" + "\t [-o staplefile] [-P proxy_username] [-p source_port] " + "[-R CAfile]\n" + "\t [-s source] [-T keyword] [-V rtable] [-w timeout] " + "[-X proxy_protocol]\n" "\t [-x proxy_address[:port]] [destination] [port]\n"); if (ret) exit(1); From owner-svn-src-all@freebsd.org Fri May 10 17:29:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28F1915A8449; Fri, 10 May 2019 17:29:25 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9534182C60; Fri, 10 May 2019 17:29:24 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1601576AB; Fri, 10 May 2019 17:29:23 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHTMnj009420; Fri, 10 May 2019 17:29:22 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHTMgX009419; Fri, 10 May 2019 17:29:22 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101729.x4AHTMgX009419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347449 - vendor/netcat/6.1 X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/6.1 X-SVN-Commit-Revision: 347449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9534182C60 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:29:25 -0000 Author: des Date: Fri May 10 17:29:22 2019 New Revision: 347449 URL: https://svnweb.freebsd.org/changeset/base/347449 Log: Tag netcat from OpenBSD 6.1. Added: vendor/netcat/6.1/ - copied from r347448, vendor/netcat/dist/ From owner-svn-src-all@freebsd.org Fri May 10 17:29:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41C5115A8473; Fri, 10 May 2019 17:29:32 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF0E382D17; Fri, 10 May 2019 17:29:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00FC476AC; Fri, 10 May 2019 17:29:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHTUBS009471; Fri, 10 May 2019 17:29:30 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHTUKC009469; Fri, 10 May 2019 17:29:30 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101729.x4AHTUKC009469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347450 - vendor/netcat/dist X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/dist X-SVN-Commit-Revision: 347450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF0E382D17 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:29:32 -0000 Author: des Date: Fri May 10 17:29:30 2019 New Revision: 347450 URL: https://svnweb.freebsd.org/changeset/base/347450 Log: Import netcat from OpenBSD 6.2. Modified: vendor/netcat/dist/nc.1 vendor/netcat/dist/netcat.c Modified: vendor/netcat/dist/nc.1 ============================================================================== --- vendor/netcat/dist/nc.1 Fri May 10 17:29:22 2019 (r347449) +++ vendor/netcat/dist/nc.1 Fri May 10 17:29:30 2019 (r347450) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.82 2017/02/09 20:15:59 jca Exp $ +.\" $OpenBSD: nc.1,v 1.87 2017/07/15 18:11:47 jmc Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: February 9 2017 $ +.Dd $Mdocdate: July 15 2017 $ .Dt NC 1 .Os .Sh NAME @@ -50,9 +50,11 @@ .Op Fl s Ar source .Op Fl T Ar keyword .Op Fl V Ar rtable +.Op Fl W Ar recvlimit .Op Fl w Ar timeout .Op Fl X Ar proxy_protocol .Op Fl x Ar proxy_address Ns Op : Ns Ar port +.Op Fl Z Ar peercertfile .Op Ar destination .Op Ar port .Sh DESCRIPTION @@ -230,10 +232,12 @@ option. Change IPv4 TOS value or TLS options. For TLS options .Ar keyword -may be one of -.Ar tlsall ; -which allows the use of all supported TLS protocols and ciphers, -.Ar noverify ; +may be one of: +.Ar tlsall , +which allows the use of all supported TLS protocols and ciphers; +.Ar tlscompat , +which allows the use of all supported TLS protocols and "compat" ciphers; +.Ar noverify , which disables certificate verification; .Ar noname , which disables certificate name checking; @@ -287,6 +291,10 @@ Set the routing table to be used. Have .Nm give more verbose output. +.It Fl W Ar recvlimit +Terminate after receiving +.Ar recvlimit +packets from the network. .It Fl w Ar timeout Connections which cannot be established or are idle timeout after .Ar timeout @@ -330,6 +338,10 @@ for SOCKS, 3128 for HTTPS). An IPv6 address can be specified unambiguously by enclosing .Ar proxy_address in square brackets. +.It Fl Z Ar peercertfile +Specifies the filename in which the peer supplied certificates will be saved +in PEM format. +May only be used with TLS. .It Fl z Specifies that .Nm Modified: vendor/netcat/dist/netcat.c ============================================================================== --- vendor/netcat/dist/netcat.c Fri May 10 17:29:22 2019 (r347449) +++ vendor/netcat/dist/netcat.c Fri May 10 17:29:30 2019 (r347450) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.178 2017/03/09 13:58:00 bluhm Exp $ */ +/* $OpenBSD: netcat.c,v 1.187 2017/07/15 17:27:39 jsing Exp $ */ /* * Copyright (c) 2001 Eric Jackson * Copyright (c) 2015 Bob Beck. All rights reserved. @@ -53,25 +53,27 @@ #include #include #include -#include #include +#include + #include "atomicio.h" #define PORT_MAX 65535 #define UNIX_DG_TMP_SOCKET_SIZE 19 -#define POLL_STDIN 0 -#define POLL_NETOUT 1 -#define POLL_NETIN 2 -#define POLL_STDOUT 3 -#define BUFSIZE 16384 -#define DEFAULT_CA_FILE "/etc/ssl/cert.pem" +#define POLL_STDIN 0 +#define POLL_NETOUT 1 +#define POLL_NETIN 2 +#define POLL_STDOUT 3 +#define BUFSIZE 16384 +#define DEFAULT_CA_FILE "/etc/ssl/cert.pem" #define TLS_ALL (1 << 1) #define TLS_NOVERIFY (1 << 2) #define TLS_NONAME (1 << 3) #define TLS_CCERT (1 << 4) #define TLS_MUSTSTAPLE (1 << 5) +#define TLS_COMPAT (1 << 6) /* Command Line Options */ int dflag; /* detached, no stdin */ @@ -106,7 +108,9 @@ int tls_cachanged; /* Using non-default CA file */ int TLSopt; /* TLS options */ char *tls_expectname; /* required name in peer cert */ char *tls_expecthash; /* required hash of peer cert */ +FILE *Zflag; /* file to save peer cert */ +int recvcount, recvlimit; int timeout = -1; int family = AF_UNSPEC; char *portlist[PORT_MAX+1]; @@ -115,8 +119,9 @@ int ttl = -1; int minttl = -1; void atelnet(int, unsigned char *, unsigned int); +int strtoport(char *portstr, int udp); void build_ports(char *); -void help(void); +void help(void) __attribute__((noreturn)); int local_listen(char *, char *, struct addrinfo); void readwrite(int, struct tls *); void fdpass(int nfd) __attribute__((noreturn)); @@ -132,8 +137,9 @@ int unix_listen(char *); void set_common_sockopts(int, int); int map_tos(char *, int *); int map_tls(char *, int *); +void save_peer_cert(struct tls *_tls_ctx, FILE *_fp); void report_connect(const struct sockaddr *, socklen_t, char *); -void report_tls(struct tls *tls_ctx, char * host, char *tls_expectname); +void report_tls(struct tls *tls_ctx, char * host); void usage(int); ssize_t drainbuf(int, unsigned char *, size_t *, struct tls *); ssize_t fillbuf(int, unsigned char *, size_t *, struct tls *); @@ -149,7 +155,7 @@ main(int argc, char *argv[]) struct servent *sv; socklen_t len; struct sockaddr_storage cliaddr; - char *proxy, *proxyport = NULL; + char *proxy = NULL, *proxyport = NULL; const char *errstr; struct addrinfo proxyhints; char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; @@ -165,7 +171,8 @@ main(int argc, char *argv[]) signal(SIGPIPE, SIG_IGN); while ((ch = getopt(argc, argv, - "46C:cDde:FH:hI:i:K:klM:m:NnO:o:P:p:R:rSs:T:tUuV:vw:X:x:z")) != -1) { + "46C:cDde:FH:hI:i:K:klM:m:NnO:o:P:p:R:rSs:T:tUuV:vW:w:X:x:Z:z")) + != -1) { switch (ch) { case '4': family = AF_INET; @@ -268,6 +275,11 @@ main(int argc, char *argv[]) case 'v': vflag = 1; break; + case 'W': + recvlimit = strtonum(optarg, 1, INT_MAX, &errstr); + if (errstr) + errx(1, "receive limit %s: %s", errstr, optarg); + break; case 'w': timeout = strtonum(optarg, 0, INT_MAX / 1000, &errstr); if (errstr) @@ -279,6 +291,12 @@ main(int argc, char *argv[]) if ((proxy = strdup(optarg)) == NULL) err(1, NULL); break; + case 'Z': + if (strcmp(optarg, "-") == 0) + Zflag = stderr; + else if ((Zflag = fopen(optarg, "w")) == NULL) + err(1, "can't open %s", optarg); + break; case 'z': zflag = 1; break; @@ -333,12 +351,15 @@ main(int argc, char *argv[]) if (family == AF_UNIX) { if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) err(1, "pledge"); - } else if (Fflag) { - if (Pflag) { - if (pledge("stdio inet dns sendfd tty", NULL) == -1) - err(1, "pledge"); - } else if (pledge("stdio inet dns sendfd", NULL) == -1) + } else if (Fflag && Pflag) { + if (pledge("stdio inet dns sendfd tty", NULL) == -1) err(1, "pledge"); + } else if (Fflag) { + if (pledge("stdio inet dns sendfd", NULL) == -1) + err(1, "pledge"); + } else if (Pflag && usetls) { + if (pledge("stdio rpath inet dns tty", NULL) == -1) + err(1, "pledge"); } else if (Pflag) { if (pledge("stdio inet dns tty", NULL) == -1) err(1, "pledge"); @@ -353,7 +374,7 @@ main(int argc, char *argv[]) host = argv[0]; uport = NULL; } else if (argv[0] && !argv[1]) { - if (!lflag) + if (!lflag) usage(1); uport = argv[0]; host = NULL; @@ -381,10 +402,14 @@ main(int argc, char *argv[]) errx(1, "cannot use -c and -F"); if (TLSopt && !usetls) errx(1, "you must specify -c to use TLS options"); + if ((TLSopt & (TLS_ALL|TLS_COMPAT)) == (TLS_ALL|TLS_COMPAT)) + errx(1, "cannot use -T tlsall and -T tlscompat"); if (Cflag && !usetls) errx(1, "you must specify -c to use -C"); if (Kflag && !usetls) errx(1, "you must specify -c to use -K"); + if (Zflag && !usetls) + errx(1, "you must specify -c to use -Z"); if (oflag && !Cflag) errx(1, "you must specify -C to use -o"); if (tls_cachanged && !usetls) @@ -460,12 +485,6 @@ main(int argc, char *argv[]) } if (usetls) { - if (Pflag) { - if (pledge("stdio inet dns tty rpath", NULL) == -1) - err(1, "pledge"); - } else if (pledge("stdio inet dns rpath", NULL) == -1) - err(1, "pledge"); - if (tls_init() == -1) errx(1, "unable to initialize TLS"); if ((tls_cfg = tls_config_new()) == NULL) @@ -478,11 +497,12 @@ main(int argc, char *argv[]) errx(1, "%s", tls_config_error(tls_cfg)); if (oflag && tls_config_set_ocsp_staple_file(tls_cfg, oflag) == -1) errx(1, "%s", tls_config_error(tls_cfg)); - if (TLSopt & TLS_ALL) { + if (TLSopt & (TLS_ALL|TLS_COMPAT)) { if (tls_config_set_protocols(tls_cfg, TLS_PROTOCOLS_ALL) != 0) errx(1, "%s", tls_config_error(tls_cfg)); - if (tls_config_set_ciphers(tls_cfg, "all") != 0) + if (tls_config_set_ciphers(tls_cfg, + (TLSopt & TLS_ALL) ? "all" : "compat") != 0) errx(1, "%s", tls_config_error(tls_cfg)); } if (!lflag && (TLSopt & TLS_CCERT)) @@ -491,7 +511,7 @@ main(int argc, char *argv[]) tls_config_insecure_noverifyname(tls_cfg); if (TLSopt & TLS_NOVERIFY) { if (tls_expecthash != NULL) - errx(1, "-H and -T noverify may not be used" + errx(1, "-H and -T noverify may not be used " "together"); tls_config_insecure_noverifycert(tls_cfg); } @@ -530,18 +550,19 @@ main(int argc, char *argv[]) s = local_listen(host, uport, hints); if (s < 0) err(1, NULL); - /* - * For UDP and -k, don't connect the socket, let it - * receive datagrams from multiple socket pairs. - */ - if (uflag && kflag) + if (uflag && kflag) { + /* + * For UDP and -k, don't connect the socket, + * let it receive datagrams from multiple + * socket pairs. + */ readwrite(s, NULL); - /* - * For UDP and not -k, we will use recvfrom() initially - * to wait for a caller, then use the regular functions - * to talk to the caller. - */ - else if (uflag && !kflag) { + } else if (uflag && !kflag) { + /* + * For UDP and not -k, we will use recvfrom() + * initially to wait for a caller, then use + * the regular functions to talk to the caller. + */ int rv, plen; char buf[16384]; struct sockaddr_storage z; @@ -606,7 +627,7 @@ main(int argc, char *argv[]) if (uflag) unlink(unix_dg_tmp_socket); - exit(ret); + return ret; } else { int i = 0; @@ -682,7 +703,7 @@ main(int argc, char *argv[]) tls_config_free(tls_cfg); - exit(ret); + return ret; } /* @@ -698,7 +719,7 @@ unix_bind(char *path, int flags) /* Create unix domain socket. */ if ((s = socket(AF_UNIX, flags | (uflag ? SOCK_DGRAM : SOCK_STREAM), 0)) < 0) - return (-1); + return -1; memset(&s_un, 0, sizeof(struct sockaddr_un)); s_un.sun_family = AF_UNIX; @@ -707,16 +728,17 @@ unix_bind(char *path, int flags) sizeof(s_un.sun_path)) { close(s); errno = ENAMETOOLONG; - return (-1); + return -1; } if (bind(s, (struct sockaddr *)&s_un, sizeof(s_un)) < 0) { save_errno = errno; close(s); errno = save_errno; - return (-1); + return -1; } - return (s); + + return s; } int @@ -743,7 +765,7 @@ timeout_tls(int s, struct tls *tls_ctx, int (*func)(st err(1, "poll failed"); } - return (ret); + return ret; } void @@ -762,10 +784,15 @@ tls_setup_client(struct tls *tls_ctx, int s, char *hos errx(1, "tls handshake failed (%s)", errstr); } if (vflag) - report_tls(tls_ctx, host, tls_expectname); + report_tls(tls_ctx, host); if (tls_expecthash && tls_peer_cert_hash(tls_ctx) && strcmp(tls_expecthash, tls_peer_cert_hash(tls_ctx)) != 0) errx(1, "peer certificate is not %s", tls_expecthash); + if (Zflag) { + save_peer_cert(tls_ctx, Zflag); + if (Zflag != stderr && (fclose(Zflag) != 0)) + err(1, "fclose failed saving peer cert"); + } } struct tls * @@ -784,7 +811,7 @@ tls_setup_server(struct tls *tls_ctx, int connfd, char int gotcert = tls_peer_cert_provided(tls_cctx); if (vflag && gotcert) - report_tls(tls_cctx, host, tls_expectname); + report_tls(tls_cctx, host); if ((TLSopt & TLS_CCERT) && !gotcert) warnx("No client certificate provided"); else if (gotcert && tls_peer_cert_hash(tls_ctx) && tls_expecthash && @@ -813,10 +840,10 @@ unix_connect(char *path) if (uflag) { if ((s = unix_bind(unix_dg_tmp_socket, SOCK_CLOEXEC)) < 0) - return (-1); + return -1; } else { if ((s = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0)) < 0) - return (-1); + return -1; } memset(&s_un, 0, sizeof(struct sockaddr_un)); @@ -826,15 +853,15 @@ unix_connect(char *path) sizeof(s_un.sun_path)) { close(s); errno = ENAMETOOLONG; - return (-1); + return -1; } if (connect(s, (struct sockaddr *)&s_un, sizeof(s_un)) < 0) { save_errno = errno; close(s); errno = save_errno; - return (-1); + return -1; } - return (s); + return s; } @@ -847,13 +874,13 @@ unix_listen(char *path) { int s; if ((s = unix_bind(path, 0)) < 0) - return (-1); + return -1; if (listen(s, 5) < 0) { close(s); - return (-1); + return -1; } - return (s); + return s; } /* @@ -912,7 +939,7 @@ remote_connect(const char *host, const char *port, str freeaddrinfo(res0); - return (s); + return s; } int @@ -940,7 +967,7 @@ timeout_connect(int s, const struct sockaddr *name, so err(1, "poll failed"); } - return (ret); + return ret; } /* @@ -996,7 +1023,7 @@ local_listen(char *host, char *port, struct addrinfo h freeaddrinfo(res0); - return (s); + return s; } /* @@ -1150,6 +1177,12 @@ readwrite(int net_fd, struct tls *tls_ctx) shutdown(pfd[POLL_NETIN].fd, SHUT_RD); pfd[POLL_NETIN].fd = -1; } + if (recvlimit > 0 && ++recvcount >= recvlimit) { + if (pfd[POLL_NETIN].fd != -1) + shutdown(pfd[POLL_NETIN].fd, SHUT_RD); + pfd[POLL_NETIN].fd = -1; + pfd[POLL_STDIN].fd = -1; + } /* read something - poll stdout */ if (netinbufpos > 0) pfd[POLL_STDOUT].events = POLLOUT; @@ -1417,7 +1450,7 @@ udptest(int s) else ret = -1; } - return (ret); + return ret; } void @@ -1517,11 +1550,11 @@ map_tos(char *s, int *val) for (t = toskeywords; t->keyword != NULL; t++) { if (strcmp(s, t->keyword) == 0) { *val = t->val; - return (1); + return 1; } } - return (0); + return 0; } int @@ -1536,21 +1569,36 @@ map_tls(char *s, int *val) { "noname", TLS_NONAME }, { "clientcert", TLS_CCERT}, { "muststaple", TLS_MUSTSTAPLE}, + { "tlscompat", TLS_COMPAT }, { NULL, -1 }, }; for (t = tlskeywords; t->keyword != NULL; t++) { if (strcmp(s, t->keyword) == 0) { *val |= t->val; - return (1); + return 1; } } - return (0); + return 0; } void -report_tls(struct tls * tls_ctx, char * host, char *tls_expectname) +save_peer_cert(struct tls *tls_ctx, FILE *fp) { + const char *pem; + size_t plen; + + if ((pem = tls_peer_cert_chain_pem(tls_ctx, &plen)) == NULL) + errx(1, "Can't get peer certificate"); + if (fprintf(fp, "%.*s", (int)plen, pem) < 0) + err(1, "unable to save peer cert"); + if (fflush(fp) != 0) + err(1, "unable to flush peer cert"); +} + +void +report_tls(struct tls * tls_ctx, char * host) +{ time_t t; const char *ocsp_url; @@ -1675,9 +1723,11 @@ help(void) \t-u UDP mode\n\ \t-V rtable Specify alternate routing table\n\ \t-v Verbose\n\ + \t-W recvlimit Terminate after receiving a number of packets\n\ \t-w timeout Timeout for connects and final net reads\n\ \t-X proto Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\ \t-x addr[:port]\tSpecify proxy address and port\n\ + \t-Z Peer certificate file\n\ \t-z Zero-I/O mode [used for scanning]\n\ Port numbers can be individual or ranges: lo-hi [inclusive]\n"); exit(1); @@ -1692,9 +1742,11 @@ usage(int ret) "\t [-i interval] [-K keyfile] [-M ttl] [-m minttl] [-O length]\n" "\t [-o staplefile] [-P proxy_username] [-p source_port] " "[-R CAfile]\n" - "\t [-s source] [-T keyword] [-V rtable] [-w timeout] " - "[-X proxy_protocol]\n" - "\t [-x proxy_address[:port]] [destination] [port]\n"); + "\t [-s source] [-T keyword] [-V rtable] [-W recvlimit] " + "[-w timeout]\n" + "\t [-X proxy_protocol] [-x proxy_address[:port]] " + "[-Z peercertfile]\n" + "\t [destination] [port]\n"); if (ret) exit(1); } From owner-svn-src-all@freebsd.org Fri May 10 17:29:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08E7115A84AA; Fri, 10 May 2019 17:29:38 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F95682DCA; Fri, 10 May 2019 17:29:37 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6325E76B0; Fri, 10 May 2019 17:29:37 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHTbxO009520; Fri, 10 May 2019 17:29:37 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHTbG2009519; Fri, 10 May 2019 17:29:37 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101729.x4AHTbG2009519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347451 - vendor/netcat/6.2 X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/6.2 X-SVN-Commit-Revision: 347451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F95682DCA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:29:38 -0000 Author: des Date: Fri May 10 17:29:37 2019 New Revision: 347451 URL: https://svnweb.freebsd.org/changeset/base/347451 Log: Tag netcat from OpenBSD 6.2. Added: vendor/netcat/6.2/ - copied from r347450, vendor/netcat/dist/ From owner-svn-src-all@freebsd.org Fri May 10 17:29:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F79215A84D9; Fri, 10 May 2019 17:29:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1325A82EAE; Fri, 10 May 2019 17:29:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB4ED76B1; Fri, 10 May 2019 17:29:44 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHTism009574; Fri, 10 May 2019 17:29:44 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHTi67009572; Fri, 10 May 2019 17:29:44 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101729.x4AHTi67009572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347452 - vendor/netcat/dist X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/dist X-SVN-Commit-Revision: 347452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1325A82EAE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:29:45 -0000 Author: des Date: Fri May 10 17:29:44 2019 New Revision: 347452 URL: https://svnweb.freebsd.org/changeset/base/347452 Log: Import netcat from OpenBSD 6.3. Modified: vendor/netcat/dist/nc.1 vendor/netcat/dist/netcat.c Modified: vendor/netcat/dist/nc.1 ============================================================================== --- vendor/netcat/dist/nc.1 Fri May 10 17:29:37 2019 (r347451) +++ vendor/netcat/dist/nc.1 Fri May 10 17:29:44 2019 (r347452) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.87 2017/07/15 18:11:47 jmc Exp $ +.\" $OpenBSD: nc.1,v 1.88 2017/11/28 16:59:10 jsing Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 15 2017 $ +.Dd $Mdocdate: November 28 2017 $ .Dt NC 1 .Os .Sh NAME @@ -233,10 +233,6 @@ Change IPv4 TOS value or TLS options. For TLS options .Ar keyword may be one of: -.Ar tlsall , -which allows the use of all supported TLS protocols and ciphers; -.Ar tlscompat , -which allows the use of all supported TLS protocols and "compat" ciphers; .Ar noverify , which disables certificate verification; .Ar noname , @@ -246,6 +242,15 @@ which requires a client certificate on incoming connec .Ar muststaple , which requires the peer to provide a valid stapled OCSP response with the handshake. +The following TLS options specify a value in the form of a key=value pair: +.Ar ciphers , +which allows the supported TLS ciphers to be specified (see +.Xr tls_config_set_ciphers 3 +for further details); +.Ar protocols , +which allows the supported TLS protocols to be specified (see +.Xr tls_config_parse_protocols 3 +for further details). It is illegal to specify TLS options if not using TLS. .Pp For IPv4 TOS value @@ -497,10 +502,15 @@ the source port, with a timeout of 5 seconds: .Pp .Dl $ nc -p 31337 -w 5 host.example.com 42 .Pp +Open a TCP connection to port 443 of www.example.com, and negotiate TLS with +any supported TLS protocol version and "compat" ciphers: +.Pp +.Dl $ nc -cv -T protocols=all -T ciphers=compat www.example.com 443 +.Pp Open a TCP connection to port 443 of www.google.ca, and negotiate TLS. -Check for a different name in the certificate for validation. +Check for a different name in the certificate for validation: .Pp -.Dl $ nc -v -c -e adsf.au.doubleclick.net www.google.ca 443 +.Dl $ nc -cv -e adsf.au.doubleclick.net www.google.ca 443 .Pp Open a UDP connection to port 53 of host.example.com: .Pp Modified: vendor/netcat/dist/netcat.c ============================================================================== --- vendor/netcat/dist/netcat.c Fri May 10 17:29:37 2019 (r347451) +++ vendor/netcat/dist/netcat.c Fri May 10 17:29:44 2019 (r347452) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.187 2017/07/15 17:27:39 jsing Exp $ */ +/* $OpenBSD: netcat.c,v 1.190 2018/03/19 16:35:29 jsing Exp $ */ /* * Copyright (c) 2001 Eric Jackson * Copyright (c) 2015 Bob Beck. All rights reserved. @@ -68,12 +68,10 @@ #define BUFSIZE 16384 #define DEFAULT_CA_FILE "/etc/ssl/cert.pem" -#define TLS_ALL (1 << 1) -#define TLS_NOVERIFY (1 << 2) -#define TLS_NONAME (1 << 3) -#define TLS_CCERT (1 << 4) -#define TLS_MUSTSTAPLE (1 << 5) -#define TLS_COMPAT (1 << 6) +#define TLS_NOVERIFY (1 << 1) +#define TLS_NONAME (1 << 2) +#define TLS_CCERT (1 << 3) +#define TLS_MUSTSTAPLE (1 << 4) /* Command Line Options */ int dflag; /* detached, no stdin */ @@ -108,6 +106,8 @@ int tls_cachanged; /* Using non-default CA file */ int TLSopt; /* TLS options */ char *tls_expectname; /* required name in peer cert */ char *tls_expecthash; /* required hash of peer cert */ +char *tls_ciphers; /* TLS ciphers */ +char *tls_protocols; /* TLS protocols */ FILE *Zflag; /* file to save peer cert */ int recvcount, recvlimit; @@ -135,8 +135,8 @@ int unix_bind(char *, int); int unix_connect(char *); int unix_listen(char *); void set_common_sockopts(int, int); -int map_tos(char *, int *); -int map_tls(char *, int *); +int process_tos_opt(char *, int *); +int process_tls_opt(char *, int *); void save_peer_cert(struct tls *_tls_ctx, FILE *_fp); void report_connect(const struct sockaddr *, socklen_t, char *); void report_tls(struct tls *tls_ctx, char * host); @@ -161,6 +161,7 @@ main(int argc, char *argv[]) char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; struct tls_config *tls_cfg = NULL; struct tls *tls_ctx = NULL; + uint32_t protocols; ret = 1; socksv = 5; @@ -324,9 +325,9 @@ main(int argc, char *argv[]) case 'T': errstr = NULL; errno = 0; - if (map_tos(optarg, &Tflag)) + if (process_tls_opt(optarg, &TLSopt)) break; - if (map_tls(optarg, &TLSopt)) + if (process_tos_opt(optarg, &Tflag)) break; if (strlen(optarg) > 1 && optarg[0] == '0' && optarg[1] == 'x') @@ -402,8 +403,6 @@ main(int argc, char *argv[]) errx(1, "cannot use -c and -F"); if (TLSopt && !usetls) errx(1, "you must specify -c to use TLS options"); - if ((TLSopt & (TLS_ALL|TLS_COMPAT)) == (TLS_ALL|TLS_COMPAT)) - errx(1, "cannot use -T tlsall and -T tlscompat"); if (Cflag && !usetls) errx(1, "you must specify -c to use -C"); if (Kflag && !usetls) @@ -485,8 +484,6 @@ main(int argc, char *argv[]) } if (usetls) { - if (tls_init() == -1) - errx(1, "unable to initialize TLS"); if ((tls_cfg = tls_config_new()) == NULL) errx(1, "unable to allocate TLS config"); if (Rflag && tls_config_set_ca_file(tls_cfg, Rflag) == -1) @@ -497,14 +494,12 @@ main(int argc, char *argv[]) errx(1, "%s", tls_config_error(tls_cfg)); if (oflag && tls_config_set_ocsp_staple_file(tls_cfg, oflag) == -1) errx(1, "%s", tls_config_error(tls_cfg)); - if (TLSopt & (TLS_ALL|TLS_COMPAT)) { - if (tls_config_set_protocols(tls_cfg, - TLS_PROTOCOLS_ALL) != 0) - errx(1, "%s", tls_config_error(tls_cfg)); - if (tls_config_set_ciphers(tls_cfg, - (TLSopt & TLS_ALL) ? "all" : "compat") != 0) - errx(1, "%s", tls_config_error(tls_cfg)); - } + if (tls_config_parse_protocols(&protocols, tls_protocols) == -1) + errx(1, "invalid TLS protocols `%s'", tls_protocols); + if (tls_config_set_protocols(tls_cfg, protocols) == -1) + errx(1, "%s", tls_config_error(tls_cfg)); + if (tls_config_set_ciphers(tls_cfg, tls_ciphers) == -1) + errx(1, "%s", tls_config_error(tls_cfg)); if (!lflag && (TLSopt & TLS_CCERT)) errx(1, "clientcert is only valid with -l"); if (TLSopt & TLS_NONAME) @@ -563,13 +558,12 @@ main(int argc, char *argv[]) * initially to wait for a caller, then use * the regular functions to talk to the caller. */ - int rv, plen; - char buf[16384]; + int rv; + char buf[2048]; struct sockaddr_storage z; len = sizeof(z); - plen = 2048; - rv = recvfrom(s, buf, plen, MSG_PEEK, + rv = recvfrom(s, buf, sizeof(buf), MSG_PEEK, (struct sockaddr *)&z, &len); if (rv < 0) err(1, "recvfrom"); @@ -1510,7 +1504,7 @@ set_common_sockopts(int s, int af) } int -map_tos(char *s, int *val) +process_tos_opt(char *s, int *val) { /* DiffServ Codepoints and other TOS mappings */ const struct toskeywords { @@ -1558,24 +1552,41 @@ map_tos(char *s, int *val) } int -map_tls(char *s, int *val) +process_tls_opt(char *s, int *flags) { + size_t len; + char *v; + const struct tlskeywords { const char *keyword; - int val; + int flag; + char **value; } *t, tlskeywords[] = { - { "tlsall", TLS_ALL }, - { "noverify", TLS_NOVERIFY }, - { "noname", TLS_NONAME }, - { "clientcert", TLS_CCERT}, - { "muststaple", TLS_MUSTSTAPLE}, - { "tlscompat", TLS_COMPAT }, - { NULL, -1 }, + { "ciphers", -1, &tls_ciphers }, + { "clientcert", TLS_CCERT, NULL }, + { "muststaple", TLS_MUSTSTAPLE, NULL }, + { "noverify", TLS_NOVERIFY, NULL }, + { "noname", TLS_NONAME, NULL }, + { "protocols", -1, &tls_protocols }, + { NULL, -1, NULL }, }; + len = strlen(s); + if ((v = strchr(s, '=')) != NULL) { + len = v - s; + v++; + } + for (t = tlskeywords; t->keyword != NULL; t++) { - if (strcmp(s, t->keyword) == 0) { - *val |= t->val; + if (strlen(t->keyword) == len && + strncmp(s, t->keyword, len) == 0) { + if (t->value != NULL) { + if (v == NULL) + errx(1, "invalid tls value `%s'", s); + *t->value = v; + } else { + *flags |= t->flag; + } return 1; } } From owner-svn-src-all@freebsd.org Fri May 10 17:29:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DDF615A8505; Fri, 10 May 2019 17:29:59 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F2D482FA6; Fri, 10 May 2019 17:29:53 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05B6A76B2; Fri, 10 May 2019 17:29:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHTnqV009622; Fri, 10 May 2019 17:29:49 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHTnY5009621; Fri, 10 May 2019 17:29:49 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101729.x4AHTnY5009621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347453 - vendor/netcat/6.3 X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/6.3 X-SVN-Commit-Revision: 347453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F2D482FA6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:29:59 -0000 Author: des Date: Fri May 10 17:29:49 2019 New Revision: 347453 URL: https://svnweb.freebsd.org/changeset/base/347453 Log: Tag netcat from OpenBSD 6.3. Added: vendor/netcat/6.3/ - copied from r347452, vendor/netcat/dist/ From owner-svn-src-all@freebsd.org Fri May 10 17:31:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2152A15A8676; Fri, 10 May 2019 17:31:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C818B833D9; Fri, 10 May 2019 17:31:32 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5144781F; Fri, 10 May 2019 17:31:32 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHVWxY012827; Fri, 10 May 2019 17:31:32 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHVW5L012824; Fri, 10 May 2019 17:31:32 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101731.x4AHVW5L012824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347454 - vendor/netcat/dist X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/dist X-SVN-Commit-Revision: 347454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C818B833D9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:31:33 -0000 Author: des Date: Fri May 10 17:31:31 2019 New Revision: 347454 URL: https://svnweb.freebsd.org/changeset/base/347454 Log: Import netcat from OpenBSD 6.4. Modified: vendor/netcat/dist/nc.1 vendor/netcat/dist/netcat.c vendor/netcat/dist/socks.c Modified: vendor/netcat/dist/nc.1 ============================================================================== --- vendor/netcat/dist/nc.1 Fri May 10 17:29:49 2019 (r347453) +++ vendor/netcat/dist/nc.1 Fri May 10 17:31:31 2019 (r347454) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.88 2017/11/28 16:59:10 jsing Exp $ +.\" $OpenBSD: nc.1,v 1.91 2018/09/25 20:05:07 jmc Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: November 28 2017 $ +.Dd $Mdocdate: September 25 2018 $ .Dt NC 1 .Os .Sh NAME @@ -96,27 +96,31 @@ and much, much more The options are as follows: .Bl -tag -width Ds .It Fl 4 -Forces -.Nm -to use IPv4 addresses only. +Use IPv4 addresses only. .It Fl 6 -Forces -.Nm -to use IPv6 addresses only. +Use IPv6 addresses only. .It Fl C Ar certfile -Specifies the filename from which the public key part of the TLS -certificate is loaded, in PEM format. -May only be used with TLS. +Load the public key part of the TLS peer certificate from +.Ar certfile , +in PEM format. +Requires +.Fl c . .It Fl c -If using a TCP socket to connect or listen, use TLS. -Illegal if not using TCP sockets. +Use TLS to connect or listen. +Cannot be used together with any of the options +.Fl FuU . .It Fl D Enable debugging on the socket. .It Fl d Do not attempt to read from stdin. .It Fl e Ar name -Specify the name that must be present in the peer certificate when using TLS. -Illegal if not using TLS. +Only accept the TLS peer certificate if it contains the +.Ar name . +Requires +.Fl c . +If not specified, +.Ar destination +is used. .It Fl F Pass the first connected socket using .Xr sendmsg 2 @@ -132,47 +136,49 @@ using the .Xr ssh_config 5 .Cm ProxyUseFdpass option). +Cannot be used with +.Fl c +or +.Fl U . .It Fl H Ar hash -Specifies the required hash string of the peer certificate when using TLS. -The string format required is that used by -.Xr tls_peer_cert_hash 3 . -Illegal if not using TLS, and may not be used with -T noverify. +Only accept the TLS peer certificate if its hash returned from +.Xr tls_peer_cert_hash 3 +matches +.Ar hash . +Requires +.Fl c +and cannot be used with +.Fl T Cm noverify . .It Fl h -Prints out +Print out the .Nm -help. +help text and exit. .It Fl I Ar length -Specifies the size of the TCP receive buffer. +Specify the size of the TCP receive buffer. .It Fl i Ar interval -Specifies a delay time interval between lines of text sent and received. +Sleep for +.Ar interval +seconds between lines of text sent and received. Also causes a delay time between connections to multiple ports. .It Fl K Ar keyfile -Specifies the filename from which the private key -is loaded in PEM format. -May only be used with TLS. +Load the TLS private key from +.Ar keyfile , +in PEM format. +Requires +.Fl c . .It Fl k -Forces -.Nm -to stay listening for another connection after its current connection -is completed. -It is an error to use this option without the -.Fl l -option. +When a connection is completed, listen for another one. +Requires +.Fl l . When used together with the .Fl u option, the server socket is not connected and it can receive UDP datagrams from multiple hosts. .It Fl l -Used to specify that -.Nm -should listen for an incoming connection rather than initiate a +Listen for an incoming connection rather than initiating a connection to a remote host. -It is an error to use this option in conjunction with the -.Fl p , -.Fl s , -or -.Fl z -options. +Cannot be used together with any of the options +.Fl psxz . Additionally, any timeouts specified with the .Fl w option are ignored. @@ -189,97 +195,111 @@ Some servers require this to finish their work. Do not do any DNS or service lookups on any specified addresses, hostnames or ports. .It Fl O Ar length -Specifies the size of the TCP send buffer. +Specify the size of the TCP send buffer. .It Fl o Ar staplefile -Specifies the filename from which to load data to be stapled -during the TLS handshake. -The file is expected to contain an OCSP response from an OCSP server in +During the TLS handshake, load data to be stapled from +.Ar staplefile , +which is expected to contain an OCSP response from an OCSP server in DER format. -May only be used with TLS and when a certificate is being used. +Requires +.Fl c +and +.Fl C . .It Fl P Ar proxy_username Specifies a username to present to a proxy server that requires authentication. If no username is specified then authentication will not be attempted. Proxy authentication is only supported for HTTP CONNECT proxies at present. .It Fl p Ar source_port -Specifies the source port +Specify the source port .Nm should use, subject to privilege restrictions and availability. -It is an error to use this option in conjunction with the -.Fl l -option. +Cannot be used together with +.Fl l . .It Fl R Ar CAfile -Specifies the filename from which the root CA bundle for certificate -verification is loaded, in PEM format. -Illegal if not using TLS. -The default is +Load the root CA bundle for TLS certificate verification from +.Ar CAfile , +in PEM format, instead of .Pa /etc/ssl/cert.pem . +Requires +.Fl c . .It Fl r -Specifies that source and/or destination ports should be chosen randomly +Choose source and/or destination ports randomly instead of sequentially within a range or in the order that the system assigns them. .It Fl S -Enables the RFC 2385 TCP MD5 signature option. +Enable the RFC 2385 TCP MD5 signature option. .It Fl s Ar source -Specifies the IP of the interface which is used to send the packets. +Send packets from the interface with the +.Ar source +IP address. For .Ux Ns -domain datagram sockets, specifies the local temporary socket file to create and use so that datagrams can be received. -It is an error to use this option in conjunction with the +Cannot be used together with .Fl l -option. +or +.Fl x . .It Fl T Ar keyword -Change IPv4 TOS value or TLS options. -For TLS options +Change the IPv4 TOS/IPv6 traffic class value or the TLS options. +.Pp +For TLS options, .Ar keyword may be one of: -.Ar noverify , +.Cm noverify , which disables certificate verification; -.Ar noname , +.Cm noname , which disables certificate name checking; -.Ar clientcert , +.Cm clientcert , which requires a client certificate on incoming connections; or -.Ar muststaple , +.Cm muststaple , which requires the peer to provide a valid stapled OCSP response with the handshake. -The following TLS options specify a value in the form of a key=value pair: -.Ar ciphers , +The following TLS options specify a value in the form of a +.Ar key Ns = Ns Ar value +pair: +.Cm ciphers , which allows the supported TLS ciphers to be specified (see .Xr tls_config_set_ciphers 3 for further details); -.Ar protocols , +.Cm protocols , which allows the supported TLS protocols to be specified (see .Xr tls_config_parse_protocols 3 for further details). -It is illegal to specify TLS options if not using TLS. +Specifying TLS options requires +.Fl c . .Pp -For IPv4 TOS value +For the IPv4 TOS/IPv6 traffic class value, .Ar keyword may be one of -.Ar critical , -.Ar inetcontrol , -.Ar lowdelay , -.Ar netcontrol , -.Ar throughput , -.Ar reliability , +.Cm critical , +.Cm inetcontrol , +.Cm lowdelay , +.Cm netcontrol , +.Cm throughput , +.Cm reliability , or one of the DiffServ Code Points: -.Ar ef , -.Ar af11 ... af43 , -.Ar cs0 ... cs7 ; +.Cm ef , +.Cm af11 No ... Cm af43 , +.Cm cs0 No ... Cm cs7 ; or a number in either hex or decimal. .It Fl t -Causes -.Nm -to send RFC 854 DON'T and WON'T responses to RFC 854 DO and WILL requests. +Send RFC 854 DON'T and WON'T responses to RFC 854 DO and WILL requests. This makes it possible to use .Nm to script telnet sessions. .It Fl U -Specifies to use +Use .Ux Ns -domain sockets. +Cannot be used together with any of the options +.Fl cFx . .It Fl u -Use UDP instead of the default option of TCP. +Use UDP instead of TCP. +Cannot be used together with +.Fl c +or +.Fl x . For .Ux Ns -domain sockets, use a datagram socket instead of a stream socket. @@ -293,9 +313,7 @@ flag is given. .It Fl V Ar rtable Set the routing table to be used. .It Fl v -Have -.Nm -give more verbose output. +Produce more verbose output. .It Fl W Ar recvlimit Terminate after receiving .Ar recvlimit @@ -315,22 +333,20 @@ will listen forever for a connection, with or without flag. The default is no timeout. .It Fl X Ar proxy_protocol -Requests that -.Nm -should use the specified protocol when talking to the proxy server. +Use +.Ar proxy_protocol +when talking to the proxy server. Supported protocols are -.Dq 4 +.Cm 4 (SOCKS v.4), -.Dq 5 +.Cm 5 (SOCKS v.5) and -.Dq connect +.Cm connect (HTTPS proxy). If the protocol is not specified, SOCKS version 5 is used. .It Fl x Ar proxy_address Ns Op : Ns Ar port -Requests that -.Nm -should connect to +Connect to .Ar destination using a proxy at .Ar proxy_address @@ -343,17 +359,18 @@ for SOCKS, 3128 for HTTPS). An IPv6 address can be specified unambiguously by enclosing .Ar proxy_address in square brackets. +A proxy cannot be used with any of the options +.Fl lsuU . .It Fl Z Ar peercertfile -Specifies the filename in which the peer supplied certificates will be saved +Save the peer certificates to +.Ar peercertfile , in PEM format. -May only be used with TLS. +Requires +.Fl c . .It Fl z -Specifies that -.Nm -should just scan for listening daemons, without sending any data to them. -It is an error to use this option in conjunction with the -.Fl l -option. +Only scan for listening daemons, without sending any data to them. +Cannot be used together with +.Fl l . .El .Pp .Ar destination @@ -375,7 +392,8 @@ option is given). .Pp .Ar port can be a specified as a numeric port number, or as a service name. -Ports may be specified in a range of the form nn-mm. +Ports may be specified in a range of the form +.Ar nn Ns - Ns Ar mm . In general, a destination port must be specified, unless the @@ -548,8 +566,8 @@ if the proxy requires it: .Xr cat 1 , .Xr ssh 1 .Sh AUTHORS -Original implementation by *Hobbit* -.Aq Mt hobbit@avian.org . +Original implementation by +.An *Hobbit* Aq Mt hobbit@avian.org . .br Rewritten with IPv6 support by .An Eric Jackson Aq Mt ericj@monkey.org . Modified: vendor/netcat/dist/netcat.c ============================================================================== --- vendor/netcat/dist/netcat.c Fri May 10 17:29:49 2019 (r347453) +++ vendor/netcat/dist/netcat.c Fri May 10 17:31:31 2019 (r347454) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.190 2018/03/19 16:35:29 jsing Exp $ */ +/* $OpenBSD: netcat.c,v 1.195 2018/10/04 17:04:50 bluhm Exp $ */ /* * Copyright (c) 2001 Eric Jackson * Copyright (c) 2015 Bob Beck. All rights reserved. @@ -122,7 +122,7 @@ void atelnet(int, unsigned char *, unsigned int); int strtoport(char *portstr, int udp); void build_ports(char *); void help(void) __attribute__((noreturn)); -int local_listen(char *, char *, struct addrinfo); +int local_listen(const char *, const char *, struct addrinfo); void readwrite(int, struct tls *); void fdpass(int nfd) __attribute__((noreturn)); int remote_connect(const char *, const char *, struct addrinfo); @@ -349,13 +349,51 @@ main(int argc, char *argv[]) if (setrtable(rtableid) == -1) err(1, "setrtable"); + /* Cruft to make sure options are clean, and used properly. */ + if (argv[0] && !argv[1] && family == AF_UNIX) { + host = argv[0]; + uport = NULL; + } else if (argv[0] && !argv[1]) { + if (!lflag) + usage(1); + uport = argv[0]; + host = NULL; + } else if (argv[0] && argv[1]) { + host = argv[0]; + uport = argv[1]; + } else + usage(1); + + if (usetls) { + if (Cflag && unveil(Cflag, "r") == -1) + err(1, "unveil"); + if (unveil(Rflag, "r") == -1) + err(1, "unveil"); + if (Kflag && unveil(Kflag, "r") == -1) + err(1, "unveil"); + if (oflag && unveil(oflag, "r") == -1) + err(1, "unveil"); + } else { + if (family == AF_UNIX) { + if (unveil(host, "rwc") == -1) + err(1, "unveil"); + if (uflag && !lflag) { + if (unveil(sflag ? sflag : "/tmp", "rwc") == -1) + err(1, "unveil"); + } + } else { + if (unveil("/", "") == -1) + err(1, "unveil"); + } + } + if (family == AF_UNIX) { if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) err(1, "pledge"); } else if (Fflag && Pflag) { if (pledge("stdio inet dns sendfd tty", NULL) == -1) err(1, "pledge"); - } else if (Fflag) { + } else if (Fflag) { if (pledge("stdio inet dns sendfd", NULL) == -1) err(1, "pledge"); } else if (Pflag && usetls) { @@ -370,21 +408,6 @@ main(int argc, char *argv[]) } else if (pledge("stdio inet dns", NULL) == -1) err(1, "pledge"); - /* Cruft to make sure options are clean, and used properly. */ - if (argv[0] && !argv[1] && family == AF_UNIX) { - host = argv[0]; - uport = NULL; - } else if (argv[0] && !argv[1]) { - if (!lflag) - usage(1); - uport = argv[0]; - host = NULL; - } else if (argv[0] && argv[1]) { - host = argv[0]; - uport = argv[1]; - } else - usage(1); - if (lflag && sflag) errx(1, "cannot use -s and -l"); if (lflag && pflag) @@ -520,8 +543,6 @@ main(int argc, char *argv[]) err(1, "pledge"); } if (lflag) { - struct tls *tls_cctx = NULL; - int connfd; ret = 0; if (family == AF_UNIX) { @@ -541,8 +562,11 @@ main(int argc, char *argv[]) } /* Allow only one connection at a time, but stay alive. */ for (;;) { - if (family != AF_UNIX) + if (family != AF_UNIX) { + if (s != -1) + close(s); s = local_listen(host, uport, hints); + } if (s < 0) err(1, NULL); if (uflag && kflag) { @@ -577,6 +601,9 @@ main(int argc, char *argv[]) readwrite(s, NULL); } else { + struct tls *tls_cctx = NULL; + int connfd; + len = sizeof(cliaddr); connfd = accept4(s, (struct sockaddr *)&cliaddr, &len, SOCK_NONBLOCK); @@ -592,16 +619,12 @@ main(int argc, char *argv[]) readwrite(connfd, tls_cctx); if (!usetls) readwrite(connfd, NULL); - if (tls_cctx) { + if (tls_cctx) timeout_tls(s, tls_cctx, tls_close); - tls_free(tls_cctx); - tls_cctx = NULL; - } close(connfd); + tls_free(tls_cctx); } - if (family != AF_UNIX) - close(s); - else if (uflag) { + if (family == AF_UNIX && uflag) { if (connect(s, NULL, 0) < 0) err(1, "connect"); } @@ -633,6 +656,8 @@ main(int argc, char *argv[]) for (s = -1, i = 0; portlist[i] != NULL; i++) { if (s != -1) close(s); + tls_free(tls_ctx); + tls_ctx = NULL; if (usetls) { if ((tls_ctx = tls_client()) == NULL) @@ -683,18 +708,15 @@ main(int argc, char *argv[]) tls_setup_client(tls_ctx, s, host); if (!zflag) readwrite(s, tls_ctx); - if (tls_ctx) { + if (tls_ctx) timeout_tls(s, tls_ctx, tls_close); - tls_free(tls_ctx); - tls_ctx = NULL; - } } } } if (s != -1) close(s); - + tls_free(tls_ctx); tls_config_free(tls_cfg); return ret; @@ -970,7 +992,7 @@ timeout_connect(int s, const struct sockaddr *name, so * address. Returns -1 on failure. */ int -local_listen(char *host, char *port, struct addrinfo hints) +local_listen(const char *host, const char *port, struct addrinfo hints) { struct addrinfo *res, *res0; int s = -1, ret, x = 1, save_errno; Modified: vendor/netcat/dist/socks.c ============================================================================== --- vendor/netcat/dist/socks.c Fri May 10 17:29:49 2019 (r347453) +++ vendor/netcat/dist/socks.c Fri May 10 17:31:31 2019 (r347454) @@ -1,4 +1,4 @@ -/* $OpenBSD: socks.c,v 1.24 2016/06/27 14:43:04 deraadt Exp $ */ +/* $OpenBSD: socks.c,v 1.25 2018/03/27 16:31:10 deraadt Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -109,17 +109,16 @@ proxy_read_line(int fd, char *buf, size_t bufsz) return (off); } -static const char * -getproxypass(const char *proxyuser, const char *proxyhost) +static void +getproxypass(const char *proxyuser, const char *proxyhost, + char *pw, size_t pwlen) { char prompt[512]; - static char pw[256]; snprintf(prompt, sizeof(prompt), "Proxy password for %s@%s: ", proxyuser, proxyhost); - if (readpassphrase(prompt, pw, sizeof(pw), RPP_REQUIRE_TTY) == NULL) + if (readpassphrase(prompt, pw, pwlen, RPP_REQUIRE_TTY) == NULL) errx(1, "Unable to read proxy passphrase"); - return (pw); } /* @@ -188,7 +187,6 @@ socks_connect(const char *host, const char *port, struct sockaddr_in *in4 = (struct sockaddr_in *)&addr; struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)&addr; in_port_t serverport; - const char *proxypass = NULL; if (proxyport == NULL) proxyport = (socksv == -1) ? HTTP_PROXY_PORT : SOCKS_PORT; @@ -345,11 +343,14 @@ socks_connect(const char *host, const char *port, err(1, "write failed (%zu/%d)", cnt, r); if (authretry > 1) { + char proxypass[256]; char resp[1024]; - proxypass = getproxypass(proxyuser, proxyhost); + getproxypass(proxyuser, proxyhost, + proxypass, sizeof proxypass); r = snprintf(buf, sizeof(buf), "%s:%s", proxyuser, proxypass); + explicit_bzero(proxypass, sizeof proxypass); if (r == -1 || (size_t)r >= sizeof(buf) || b64_ntop(buf, strlen(buf), resp, sizeof(resp)) == -1) @@ -361,6 +362,8 @@ socks_connect(const char *host, const char *port, r = strlen(buf); if ((cnt = atomicio(vwrite, proxyfd, buf, r)) != r) err(1, "write failed (%zu/%d)", cnt, r); + explicit_bzero(proxypass, sizeof proxypass); + explicit_bzero(buf, sizeof buf); } /* Terminate headers */ From owner-svn-src-all@freebsd.org Fri May 10 17:31:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34B2F15A87C7; Fri, 10 May 2019 17:31:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7F3283430; Fri, 10 May 2019 17:31:38 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E473C7823; Fri, 10 May 2019 17:31:37 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHVbNh012878; Fri, 10 May 2019 17:31:37 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHVbIj012877; Fri, 10 May 2019 17:31:37 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101731.x4AHVbIj012877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347455 - vendor/netcat/6.4 X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/6.4 X-SVN-Commit-Revision: 347455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C7F3283430 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:31:39 -0000 Author: des Date: Fri May 10 17:31:37 2019 New Revision: 347455 URL: https://svnweb.freebsd.org/changeset/base/347455 Log: Tag netcat from OpenBSD 6.4. Added: vendor/netcat/6.4/ - copied from r347454, vendor/netcat/dist/ From owner-svn-src-all@freebsd.org Fri May 10 17:31:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0915015A87EF; Fri, 10 May 2019 17:31:47 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9ED6A834F9; Fri, 10 May 2019 17:31:46 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A0857830; Fri, 10 May 2019 17:31:46 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHVjYS013651; Fri, 10 May 2019 17:31:45 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHVjbo013648; Fri, 10 May 2019 17:31:45 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101731.x4AHVjbo013648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347456 - vendor/netcat/dist X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/dist X-SVN-Commit-Revision: 347456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9ED6A834F9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:31:47 -0000 Author: des Date: Fri May 10 17:31:45 2019 New Revision: 347456 URL: https://svnweb.freebsd.org/changeset/base/347456 Log: Import netcat from OpenBSD 6.5. Modified: vendor/netcat/dist/nc.1 vendor/netcat/dist/netcat.c vendor/netcat/dist/socks.c Modified: vendor/netcat/dist/nc.1 ============================================================================== --- vendor/netcat/dist/nc.1 Fri May 10 17:31:37 2019 (r347455) +++ vendor/netcat/dist/nc.1 Fri May 10 17:31:45 2019 (r347456) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.91 2018/09/25 20:05:07 jmc Exp $ +.\" $OpenBSD: nc.1,v 1.93 2018/12/27 17:45:36 jmc Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: September 25 2018 $ +.Dd $Mdocdate: December 27 2018 $ .Dt NC 1 .Os .Sh NAME @@ -391,8 +391,8 @@ sockets, a destination is required and is the socket p option is given). .Pp .Ar port -can be a specified as a numeric port number, or as a service name. -Ports may be specified in a range of the form +can be specified as a numeric port number or as a service name. +Port ranges may be specified as numeric port numbers of the form .Ar nn Ns - Ns Ar mm . In general, a destination port must be specified, Modified: vendor/netcat/dist/netcat.c ============================================================================== --- vendor/netcat/dist/netcat.c Fri May 10 17:31:37 2019 (r347455) +++ vendor/netcat/dist/netcat.c Fri May 10 17:31:45 2019 (r347456) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.195 2018/10/04 17:04:50 bluhm Exp $ */ +/* $OpenBSD: netcat.c,v 1.203 2019/02/26 17:32:47 jsing Exp $ */ /* * Copyright (c) 2001 Eric Jackson * Copyright (c) 2015 Bob Beck. All rights reserved. @@ -42,6 +42,7 @@ #include #include +#include #include #include #include @@ -66,7 +67,6 @@ #define POLL_NETIN 2 #define POLL_STDOUT 3 #define BUFSIZE 16384 -#define DEFAULT_CA_FILE "/etc/ssl/cert.pem" #define TLS_NOVERIFY (1 << 1) #define TLS_NONAME (1 << 2) @@ -98,10 +98,10 @@ int Tflag = -1; /* IP Type of Service */ int rtableid = -1; int usetls; /* use TLS */ -char *Cflag; /* Public cert file */ -char *Kflag; /* Private key file */ -char *oflag; /* OCSP stapling file */ -char *Rflag = DEFAULT_CA_FILE; /* Root CA file */ +const char *Cflag; /* Public cert file */ +const char *Kflag; /* Private key file */ +const char *oflag; /* OCSP stapling file */ +const char *Rflag; /* Root CA file */ int tls_cachanged; /* Using non-default CA file */ int TLSopt; /* TLS options */ char *tls_expectname; /* required name in peer cert */ @@ -138,7 +138,7 @@ void set_common_sockopts(int, int); int process_tos_opt(char *, int *); int process_tls_opt(char *, int *); void save_peer_cert(struct tls *_tls_ctx, FILE *_fp); -void report_connect(const struct sockaddr *, socklen_t, char *); +void report_sock(const char *, const struct sockaddr *, socklen_t, char *); void report_tls(struct tls *tls_ctx, char * host); void usage(int); ssize_t drainbuf(int, unsigned char *, size_t *, struct tls *); @@ -168,6 +168,7 @@ main(int argc, char *argv[]) host = NULL; uport = NULL; sv = NULL; + Rflag = tls_default_ca_cert_file(); signal(SIGPIPE, SIG_IGN); @@ -597,7 +598,8 @@ main(int argc, char *argv[]) err(1, "connect"); if (vflag) - report_connect((struct sockaddr *)&z, len, NULL); + report_sock("Connection received", + (struct sockaddr *)&z, len, NULL); readwrite(s, NULL); } else { @@ -612,7 +614,8 @@ main(int argc, char *argv[]) err(1, "accept"); } if (vflag) - report_connect((struct sockaddr *)&cliaddr, len, + report_sock("Connection received", + (struct sockaddr *)&cliaddr, len, family == AF_UNIX ? host : NULL); if ((usetls) && (tls_cctx = tls_setup_server(tls_ctx, connfd, host))) @@ -639,8 +642,10 @@ main(int argc, char *argv[]) if (!zflag) readwrite(s, NULL); close(s); - } else + } else { + warn("%s", host); ret = 1; + } if (uflag) unlink(unix_dg_tmp_socket); @@ -753,6 +758,8 @@ unix_bind(char *path, int flags) errno = save_errno; return -1; } + if (vflag) + report_sock("Bound", NULL, 0, path); return s; } @@ -889,13 +896,16 @@ int unix_listen(char *path) { int s; + if ((s = unix_bind(path, 0)) < 0) return -1; - if (listen(s, 5) < 0) { close(s); return -1; } + if (vflag) + report_sock("Listening", NULL, 0, path); + return s; } @@ -1036,7 +1046,17 @@ local_listen(const char *host, const char *port, struc if (listen(s, 1) < 0) err(1, "listen"); } + if (vflag && s != -1) { + struct sockaddr_storage ss; + socklen_t len; + len = sizeof(ss); + if (getsockname(s, (struct sockaddr *)&ss, &len) == -1) + err(1, "getsockname"); + report_sock(uflag ? "Bound" : "Listening", + (struct sockaddr *)&ss, len, NULL); + } + freeaddrinfo(res0); return s; @@ -1247,9 +1267,11 @@ drainbuf(int fd, unsigned char *buf, size_t *bufpos, s ssize_t n; ssize_t adjust; - if (tls) + if (tls) { n = tls_write(tls, buf, *bufpos); - else { + if (n == -1) + errx(1, "tls write failed (%s)", tls_error(tls)); + } else { n = write(fd, buf, *bufpos); /* don't treat EAGAIN, EINTR as error */ if (n == -1 && (errno == EAGAIN || errno == EINTR)) @@ -1271,9 +1293,11 @@ fillbuf(int fd, unsigned char *buf, size_t *bufpos, st size_t num = BUFSIZE - *bufpos; ssize_t n; - if (tls) + if (tls) { n = tls_read(tls, buf + *bufpos, num); - else { + if (n == -1) + errx(1, "tls read failed (%s)", tls_error(tls)); + } else { n = read(fd, buf + *bufpos, num); /* don't treat EAGAIN, EINTR as error */ if (n == -1 && (errno == EAGAIN || errno == EINTR)) @@ -1307,9 +1331,9 @@ fdpass(int nfd) if (isatty(STDOUT_FILENO)) errx(1, "Cannot pass file descriptor to tty"); - bzero(&mh, sizeof(mh)); - bzero(&cmsgbuf, sizeof(cmsgbuf)); - bzero(&iov, sizeof(iov)); + memset(&mh, 0, sizeof(mh)); + memset(&cmsgbuf, 0, sizeof(cmsgbuf)); + memset(&iov, 0, sizeof(iov)); mh.msg_control = (caddr_t)&cmsgbuf.buf; mh.msg_controllen = sizeof(cmsgbuf.buf); @@ -1324,7 +1348,7 @@ fdpass(int nfd) mh.msg_iov = &iov; mh.msg_iovlen = 1; - bzero(&pfd, sizeof(pfd)); + memset(&pfd, 0, sizeof(pfd)); pfd.fd = STDOUT_FILENO; pfd.events = POLLOUT; for (;;) { @@ -1408,7 +1432,7 @@ build_ports(char *p) int hi, lo, cp; int x = 0; - if ((n = strchr(p, '-')) != NULL) { + if (isdigit((unsigned char)*p) && (n = strchr(p, '-')) != NULL) { *n = '\0'; n++; @@ -1688,34 +1712,30 @@ report_tls(struct tls * tls_ctx, char * host) } void -report_connect(const struct sockaddr *sa, socklen_t salen, char *path) +report_sock(const char *msg, const struct sockaddr *sa, socklen_t salen, + char *path) { - char remote_host[NI_MAXHOST]; - char remote_port[NI_MAXSERV]; + char host[NI_MAXHOST], port[NI_MAXSERV]; int herr; int flags = NI_NUMERICSERV; if (path != NULL) { - fprintf(stderr, "Connection on %s received!\n", path); + fprintf(stderr, "%s on %s\n", msg, path); return; } if (nflag) flags |= NI_NUMERICHOST; - if ((herr = getnameinfo(sa, salen, - remote_host, sizeof(remote_host), - remote_port, sizeof(remote_port), - flags)) != 0) { + if ((herr = getnameinfo(sa, salen, host, sizeof(host), + port, sizeof(port), flags)) != 0) { if (herr == EAI_SYSTEM) err(1, "getnameinfo"); else errx(1, "getnameinfo: %s", gai_strerror(herr)); } - fprintf(stderr, - "Connection from %s %s " - "received!\n", remote_host, remote_port); + fprintf(stderr, "%s on %s %s\n", msg, host, port); } void Modified: vendor/netcat/dist/socks.c ============================================================================== --- vendor/netcat/dist/socks.c Fri May 10 17:31:37 2019 (r347455) +++ vendor/netcat/dist/socks.c Fri May 10 17:31:45 2019 (r347456) @@ -1,4 +1,4 @@ -/* $OpenBSD: socks.c,v 1.25 2018/03/27 16:31:10 deraadt Exp $ */ +/* $OpenBSD: socks.c,v 1.27 2019/01/10 12:44:54 mestre Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -65,7 +65,7 @@ decode_addrport(const char *h, const char *p, struct s int r; struct addrinfo hints, *res; - bzero(&hints, sizeof(hints)); + memset(&hints, 0, sizeof(hints)); hints.ai_family = v4only ? PF_INET : PF_UNSPEC; hints.ai_flags = numeric ? AI_NUMERICHOST : 0; hints.ai_socktype = SOCK_STREAM; From owner-svn-src-all@freebsd.org Fri May 10 17:31:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4980815A8814; Fri, 10 May 2019 17:31:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCFFA835D8; Fri, 10 May 2019 17:31:54 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19F737837; Fri, 10 May 2019 17:31:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AHVosZ013700; Fri, 10 May 2019 17:31:50 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AHVoAP013699; Fri, 10 May 2019 17:31:50 GMT (envelope-from des@FreeBSD.org) Message-Id: <201905101731.x4AHVoAP013699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 10 May 2019 17:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r347457 - vendor/netcat/6.5 X-SVN-Group: vendor X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor/netcat/6.5 X-SVN-Commit-Revision: 347457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DCFFA835D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 17:31:55 -0000 Author: des Date: Fri May 10 17:31:50 2019 New Revision: 347457 URL: https://svnweb.freebsd.org/changeset/base/347457 Log: Tag netcat from OpenBSD 6.5. Added: vendor/netcat/6.5/ - copied from r347456, vendor/netcat/dist/ From owner-svn-src-all@freebsd.org Fri May 10 18:09:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4823515A91DB; Fri, 10 May 2019 18:09:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2A06848FA; Fri, 10 May 2019 18:09:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C728F7D6D; Fri, 10 May 2019 18:09:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AI9RYY030927; Fri, 10 May 2019 18:09:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AI9RVw030926; Fri, 10 May 2019 18:09:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201905101809.x4AI9RVw030926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 May 2019 18:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347458 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 347458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2A06848FA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 18:09:28 -0000 Author: bdrewery Date: Fri May 10 18:09:27 2019 New Revision: 347458 URL: https://svnweb.freebsd.org/changeset/base/347458 Log: Fix build race with machine links and genoffset.o. Generate the ilinks for all dependency objects not just the ones in the CLEAN list. Possibly related to r345351 Reported by: kmoore MFC after: 2 weeks X-MFC-with: r345351 Sponsored by: Dell EMC Isilon Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Fri May 10 17:31:50 2019 (r347457) +++ head/sys/conf/kern.post.mk Fri May 10 18:09:27 2019 (r347458) @@ -357,7 +357,7 @@ _ILINKS+= x86 # Ensure that debug info references the path in the source tree. .for _link in ${_ILINKS} .if !exists(${.OBJDIR}/${_link}) -${SRCS} ${CLEAN:M*.o}: ${_link} +${SRCS} ${DEPENDOBJS}: ${_link} .endif .if defined(_MAP_DEBUG_PREFIX) .if ${_link} == "machine" From owner-svn-src-all@freebsd.org Fri May 10 18:10:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30AC915A9230; Fri, 10 May 2019 18:10:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA7F984A28; Fri, 10 May 2019 18:10:25 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 613141E2A4; Fri, 10 May 2019 18:10:25 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f54.google.com with SMTP id k18so4765386lfj.13; Fri, 10 May 2019 11:10:25 -0700 (PDT) X-Gm-Message-State: APjAAAXCPV4Cbs18uxSMRXnz2MkqyTJFjQdhY45Ij4YBwr4PNauvlxt6 Qm2lwGVGRxQqQ6I+gkwCrfZX+xyJo7vfhY+r2jk= X-Google-Smtp-Source: APXvYqwXVmokE277s8yihBwM0SY6ryc7pkSpllWAdqbTq8IJqgobPVkxv8TpFlKmwZSxJF4V8ekYvJJT4/jJl42FDXc= X-Received: by 2002:a19:a295:: with SMTP id l143mr6537214lfe.83.1557511823895; Fri, 10 May 2019 11:10:23 -0700 (PDT) MIME-Version: 1.0 References: <201905091806.x49I6Bx9067179@repo.freebsd.org> <1362fc5c-c5dd-438b-9696-de3ec3a538ca@FreeBSD.org> In-Reply-To: From: Kyle Evans Date: Fri, 10 May 2019 13:09:38 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347402 - head/sys/modules/ipsec To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: BA7F984A28 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 18:10:26 -0000 On Fri, May 10, 2019 at 2:46 AM Andrey V. Elsukov wrote: > > On 09.05.2019 22:13, Kyle Evans wrote: > >> there is two IPsec related interfaces that have problem with automatic > >> loading - if_enc and if_ipsec. So, if you add both to the mapping list, > >> this will be useful. CAM enc driver has conflicting name and prevents to > >> automatic loading of if_enc(4). It is probably always build in the > >> kernel, but renaming it into "ses" may break some third-party device > >> drivers. > >> > > > > I think you want something like [0] to add both of these to the map > > and stop ifconfig(8) from bailing on loading if_enc because 'enc' is > > loaded. This is safe at least for the set of modules currently mapped. > > > > Thanks, > > > > Kyle Evans > > > > [0] https://people.freebsd.org/~kevans/ipsec.diff > > It looks good to me. > > -- > WBR, Andrey V. Elsukov > Committed as r347429 -- any objection to reverting this link created in r347402 now? Thanks! Kyle Evans From owner-svn-src-all@freebsd.org Fri May 10 18:22:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F99315A9873; Fri, 10 May 2019 18:22:41 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAFC685572; Fri, 10 May 2019 18:22:40 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE02D80CB; Fri, 10 May 2019 18:22:40 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AIMeFk041187; Fri, 10 May 2019 18:22:40 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AIMeha041186; Fri, 10 May 2019 18:22:40 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905101822.x4AIMeha041186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 10 May 2019 18:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347461 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAFC685572 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 18:22:41 -0000 Author: dougm Date: Fri May 10 18:22:40 2019 New Revision: 347461 URL: https://svnweb.freebsd.org/changeset/base/347461 Log: Replace panic() with KASSERT() and provide more useful information when failure happens. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20226 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Fri May 10 18:18:41 2019 (r347460) +++ head/sys/kern/subr_blist.c Fri May 10 18:22:40 2019 (r347461) @@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -120,11 +121,10 @@ __FBSDID("$FreeBSD$"); #define malloc(a,b,c) calloc(a, 1) #define free(a,b) free(a) #define ummin(a,b) ((a) < (b) ? (a) : (b)) +#define KASSERT(a,b) assert(a) #include -void panic(const char *ctl, ...); - #endif /* @@ -235,8 +235,7 @@ blist_create(daddr_t blocks, int flags) blist_t bl; u_daddr_t nodes, radix; - if (blocks == 0) - panic("invalid block count"); + KASSERT(blocks > 0, ("invalid block count")); /* * Calculate the radix and node count used for scanning. @@ -288,8 +287,8 @@ blist_alloc(blist_t bl, daddr_t count) { daddr_t blk, cursor; - if (count > BLIST_MAX_ALLOC) - panic("allocation too large"); + KASSERT(count <= BLIST_MAX_ALLOC, + ("allocation too large: %d", (int)count)); /* * This loop iterates at most twice. An allocation failure in the @@ -325,15 +324,15 @@ blist_avail(blist_t bl) /* * blist_free() - free up space in the block bitmap. Return the base - * of a contiguous region. Panic if an inconsistancy is - * found. + * of a contiguous region. */ void blist_free(blist_t bl, daddr_t blkno, daddr_t count) { - if (blkno < 0 || blkno + count > bl->bl_blocks) - panic("freeing invalid range"); + KASSERT(blkno >= 0 && blkno + count <= bl->bl_blocks, + ("freeing invalid range: blkno %jx, count %d, blocks %jd", + (uintmax_t)blkno, (int)count, (uintmax_t)bl->bl_blocks)); blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix); bl->bl_avail += count; } @@ -349,8 +348,9 @@ blist_fill(blist_t bl, daddr_t blkno, daddr_t count) { daddr_t filled; - if (blkno < 0 || blkno + count > bl->bl_blocks) - panic("filling invalid range"); + KASSERT(blkno >= 0 && blkno + count <= bl->bl_blocks, + ("filling invalid range: blkno %jx, count %d, blocks %jd", + (uintmax_t)blkno, (int)count, (uintmax_t)bl->bl_blocks)); filled = blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix); bl->bl_avail -= filled; return (filled); @@ -840,8 +840,9 @@ blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) * count n */ mask = bitrange(blk & BLIST_BMAP_MASK, count); - if (scan->bm_bitmap & mask) - panic("freeing free block"); + KASSERT((scan->bm_bitmap & mask) == 0, + ("freeing free block: %jx, size %d, mask %jx", + (uintmax_t)blk, count, (uintmax_t)scan->bm_bitmap & mask)); scan->bm_bitmap |= mask; } @@ -1142,19 +1143,7 @@ main(int ac, char **av) break; } } - return(0); -} - -void -panic(const char *ctl, ...) -{ - va_list va; - - va_start(va, ctl); - vfprintf(stderr, ctl, va); - fprintf(stderr, "\n"); - va_end(va); - exit(1); + return (0); } #endif From owner-svn-src-all@freebsd.org Fri May 10 18:25:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2CCC15A9961; Fri, 10 May 2019 18:25:07 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56EAE857C8; Fri, 10 May 2019 18:25:07 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ECE580D1; Fri, 10 May 2019 18:25:07 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AIP6YI041337; Fri, 10 May 2019 18:25:06 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AIP6PG041336; Fri, 10 May 2019 18:25:06 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905101825.x4AIP6PG041336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 10 May 2019 18:25:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347462 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56EAE857C8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 18:25:07 -0000 Author: dougm Date: Fri May 10 18:25:06 2019 New Revision: 347462 URL: https://svnweb.freebsd.org/changeset/base/347462 Log: blist_next_leaf_alloc walks over all the meta-nodes between one leaf and the next one, and if blocks are allocated from the next leaf, it walks back toward where it started, as long as there are interleaving meta-nodes to be updated on account of the last free blocks under those meta-nodes being allocated. Only if the walk goes all the way back to the starting point must we calculate the position of the meta-node that is the least-comment parent of one leaf and the next, and update a bit in that meta-node to indicate the allocation of its last free block. There's no need to start calculating the position of that least-common parent until the walk back reaches the original starting point, and there's no need for a calculation that updates 'radius' to tell us when we've walked back to the beginning, since comparing scan to next suffices for that. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20229 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Fri May 10 18:22:40 2019 (r347461) +++ head/sys/kern/subr_blist.c Fri May 10 18:25:06 2019 (r347462) @@ -607,7 +607,6 @@ static int blst_next_leaf_alloc(blmeta_t *scan, daddr_t blk, int count) { blmeta_t *next; - daddr_t skip; u_daddr_t radix; int digit; @@ -632,13 +631,14 @@ blst_next_leaf_alloc(blmeta_t *scan, daddr_t blk, int /* * Update bitmaps of next-ancestors, up to least common ancestor. */ - skip = radix_to_skip(radix); - while (radix != BLIST_BMAP_RADIX && next->bm_bitmap == 0) { - (--next)->bm_bitmap ^= 1; - radix /= BLIST_META_RADIX; - } - if (next->bm_bitmap == 0) - scan[-digit * skip].bm_bitmap ^= (u_daddr_t)1 << digit; + while (next->bm_bitmap == 0) { + if (--next == scan) { + scan[-digit * radix_to_skip(radix)].bm_bitmap ^= + (u_daddr_t)1 << digit; + break; + } + next->bm_bitmap ^= 1; + } return (0); } From owner-svn-src-all@freebsd.org Fri May 10 18:25:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02C0415A99D7; Fri, 10 May 2019 18:25:57 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::601]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 717EB85920; Fri, 10 May 2019 18:25:56 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback16o.mail.yandex.net (mxback16o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::67]) by forward101o.mail.yandex.net (Yandex) with ESMTP id DECA23C01896; Fri, 10 May 2019 21:25:44 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback16o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 3f7dL0T8Ib-PibaARut; Fri, 10 May 2019 21:25:44 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1557512744; bh=4xkmhcbZgNosxyJaDGFIZdAEXsXDGZ613svF7p1Fbx8=; h=In-Reply-To:From:To:Subject:Cc:Date:References:Message-ID; b=GtkaZ7zHsFgiPhCEWgvWW9iBMXgI5pLr5WGKOAcgCnZw30EFUbrLew+HeV52iJixf TmEN6xBCT4+ycRwOaupWi9B4p075242R9iPM0P7mS2+NSGg+UKeCJ1yTL8s8T9UwvJ qhBoNEs5Vlx1KiykwiATw40rwqPR5TmdJS1m/yjc= Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ETj7VLB01G-PhxiW0nd; Fri, 10 May 2019 21:25:43 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf To: Andrew Gallatin , Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kp@freebsd.org References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510124458.GB65054@zxy.spb.ru> <0842eef5-5f1f-c25a-a470-a424c536f1ed@cs.duke.edu> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <02112b97-4624-440f-c6f2-f296da4c61f9@yandex.ru> Date: Fri, 10 May 2019 21:24:08 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <0842eef5-5f1f-c25a-a470-a424c536f1ed@cs.duke.edu> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ASCC4oYUQ7FJIijfRhxR0RzUjdure3YVp" X-Rspamd-Queue-Id: 717EB85920 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 18:25:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ASCC4oYUQ7FJIijfRhxR0RzUjdure3YVp Content-Type: multipart/mixed; boundary="U3RaihpY5SCFgxF8AgCuuO7x00CwL3Qlt"; protected-headers="v1" From: "Andrey V. Elsukov" To: Andrew Gallatin , Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kp@freebsd.org Message-ID: <02112b97-4624-440f-c6f2-f296da4c61f9@yandex.ru> Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510124458.GB65054@zxy.spb.ru> <0842eef5-5f1f-c25a-a470-a424c536f1ed@cs.duke.edu> In-Reply-To: <0842eef5-5f1f-c25a-a470-a424c536f1ed@cs.duke.edu> --U3RaihpY5SCFgxF8AgCuuO7x00CwL3Qlt Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 10.05.2019 18:31, Andrew Gallatin wrote: > On 2019-05-10 08:44, Slawa Olhovchenkov wrote: >=20 >> pf have ifdef for IPSEC, but don't have support IPSEC_SUPPORT >> (netpfil/pf/if_pfsync.c). >> >=20 > Thanks for pointing this out.=C2=A0 It seems like IPSEC_SUPPORT would w= ork > for this.=C2=A0 I've made a patch, and it compiles and the pf module lo= ads. > However, I have no knowledge of how to test it.=C2=A0 Is this something= > that you use, and which you can test? > I think you need to include opt_ipsec.h to have chance compile it. But as Kristof said, it wont work. --=20 WBR, Andrey V. Elsukov --U3RaihpY5SCFgxF8AgCuuO7x00CwL3Qlt-- --ASCC4oYUQ7FJIijfRhxR0RzUjdure3YVp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlzVwcgACgkQAcXqBBDI oXr6NQgAsOE2Kop4bH8/AEqcRSpZaYirhGJ5cgVBhL19Ci9XIm3mBXCNt5SEBjZj 5ipNXOBL5ldViB+D3wwgh5Thh23TADFC2btw+KKyAaTDDQ6y9sV4XXFqVzH0WbLl RyLssatksLHPrILL5YRlndUT7bcW/P6hJbn9SjRdY59IdiGoe1/u7yV5ft/sx0r0 O0nnyCRwZqCSn0SqiGeBqsROkNPWGHeGeqjZle7UKoJ/wDtA1gxs/qJcf3O9yJ4U BzCXqBMUz/ocV8fwABN1G2aFZpz3AdDXDaoaVtXiVp75xZKyOCGBmT1Rp7oOlV1a cF5ZTGFDla224dFicRumMx+qONSA2A== =Dl9W -----END PGP SIGNATURE----- --ASCC4oYUQ7FJIijfRhxR0RzUjdure3YVp-- From owner-svn-src-all@freebsd.org Fri May 10 18:39:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5545615AA00C; Fri, 10 May 2019 18:39:40 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0F27862D6; Fri, 10 May 2019 18:39:39 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id CB7EDB1DB; Fri, 10 May 2019 18:39:39 +0000 (UTC) Date: Fri, 10 May 2019 18:39:39 +0000 From: Alexey Dokuchaev To: "Andrey V. Elsukov" Cc: Andrew Gallatin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf Message-ID: <20190510183939.GA75776@FreeBSD.org> References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510084620.GA47901@FreeBSD.org> <1a15a141-89b7-9169-e4cc-df585e92ada1@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1a15a141-89b7-9169-e4cc-df585e92ada1@yandex.ru> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: F0F27862D6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.959,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 18:39:40 -0000 On Fri, May 10, 2019 at 12:11:47PM +0300, Andrey V. Elsukov wrote: > On 10.05.2019 11:46, Alexey Dokuchaev wrote: > > ... > > What is the reason behind having IPSEC_SUPPORT option instead of no > > special option at all? > > IPSEC_SUPPORT builds into the kernel PF_KEY domain protocol, that is > required by IPsec implementation to interact with userlevel. Currently > the kernel does not support unregistering of protocol domains. This is > mostly why option IPSEC_SUPPORT was introduced. Okay, I see, thank you Andrey for explanation. > The second cause -- reduce overhead that IPSEC produces even when it > is not used. So does it mean that if I don't plan to use IPSEC, I can safely remove IPSEC_SUPPORT from my config and also get slight performance boost? ./danfe From owner-svn-src-all@freebsd.org Fri May 10 18:46:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFA1415AA29A; Fri, 10 May 2019 18:46:46 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 530538676E; Fri, 10 May 2019 18:46:46 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward102p.mail.yandex.net (Yandex) with ESMTP id 9DC0A1D40742; Fri, 10 May 2019 21:46:34 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xcEoZzsk3c-kYIGPBBw; Fri, 10 May 2019 21:46:34 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1557513994; bh=SfNhIEDrmck7RSohhh9Qqaj6go/OwVvGBfD86mCTMEY=; h=In-Reply-To:From:To:Subject:Cc:Date:References:Message-ID; b=BujWgkTS6Py2c6+TmSHzCVo9Ex2hYssXZXpk99Zy7JBni5A+0rRSrG++FugXfakML JTs9dVnSmGD2AlOoAYHXrd25+wtLztf8KIS/vKBZhi4U5PxpEfgmxBarkyjg2a79ct POahKRVgr6Pvo2pR4zlA3Io1kMOkUzorGiIJZkGQ= Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 8s6pc2Vjny-kXMiDtTL; Fri, 10 May 2019 21:46:33 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf To: Alexey Dokuchaev Cc: Andrew Gallatin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510084620.GA47901@FreeBSD.org> <1a15a141-89b7-9169-e4cc-df585e92ada1@yandex.ru> <20190510183939.GA75776@FreeBSD.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: Date: Fri, 10 May 2019 21:44:58 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190510183939.GA75776@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1OjsZkzpeR46iCb5PBqizG4MCtaCLwJP8" X-Rspamd-Queue-Id: 530538676E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 18:46:47 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1OjsZkzpeR46iCb5PBqizG4MCtaCLwJP8 Content-Type: multipart/mixed; boundary="qaIVGnEFOiDNvGZ8jHYVV5Xgc0uGJbNtr"; protected-headers="v1" From: "Andrey V. Elsukov" To: Alexey Dokuchaev Cc: Andrew Gallatin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510084620.GA47901@FreeBSD.org> <1a15a141-89b7-9169-e4cc-df585e92ada1@yandex.ru> <20190510183939.GA75776@FreeBSD.org> In-Reply-To: <20190510183939.GA75776@FreeBSD.org> --qaIVGnEFOiDNvGZ8jHYVV5Xgc0uGJbNtr Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 10.05.2019 21:39, Alexey Dokuchaev wrote: >> The second cause -- reduce overhead that IPSEC produces even when it >> is not used. >=20 > So does it mean that if I don't plan to use IPSEC, I can safely remove > IPSEC_SUPPORT from my config and also get slight performance boost? Yes, currently each call to IPsec has check like `if (ipsec_enabled) {...}`, when you build the kernel without IPSEC/IPSEC_SUPPORT, this check will be removed too, this can add some performance boost :-) --=20 WBR, Andrey V. Elsukov --qaIVGnEFOiDNvGZ8jHYVV5Xgc0uGJbNtr-- --1OjsZkzpeR46iCb5PBqizG4MCtaCLwJP8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlzVxqoACgkQAcXqBBDI oXroFQgAieDB7U0EBvW7MbnY4clCqe+jEjoVqwfp7G62XB+DNyeQSSvQru3sBogu 5IdRrNMzXPb1mHe/+A0gVOzk1uXIVpFax5whe1ypIwyxtOEWbVWRTIfL0Pk0dS6n 2/07AyjK+NcOwfpxQMIeEo5AU1venM/sQOUreR9la03G/EG3SUl85VwMQSCNT17+ JgL66qZp3Tlxi+WjOBLrOiofiYmC+qztIPqH5urCjc2nRTdwJKYNOR/+X5HDNVeN eholCTPgD5jG+eI9bzxCvKtF60tz6LJbB+qZ9e6br6vObk7TtpHNWBw7EtcXMxrz E2+OnClsncgKFUUawOfgegtyDF9z/w== =kVu2 -----END PGP SIGNATURE----- --1OjsZkzpeR46iCb5PBqizG4MCtaCLwJP8-- From owner-svn-src-all@freebsd.org Fri May 10 18:53:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E5E15AA54F; Fri, 10 May 2019 18:53:50 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBAD186CE0; Fri, 10 May 2019 18:53:49 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id BE467B642; Fri, 10 May 2019 18:53:49 +0000 (UTC) Date: Fri, 10 May 2019 18:53:49 +0000 From: Alexey Dokuchaev To: "Andrey V. Elsukov" Cc: Andrew Gallatin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf Message-ID: <20190510185349.GA86585@FreeBSD.org> References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510084620.GA47901@FreeBSD.org> <1a15a141-89b7-9169-e4cc-df585e92ada1@yandex.ru> <20190510183939.GA75776@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: CBAD186CE0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 18:53:50 -0000 On Fri, May 10, 2019 at 09:44:58PM +0300, Andrey V. Elsukov wrote: > On 10.05.2019 21:39, Alexey Dokuchaev wrote: > >> The second cause -- reduce overhead that IPSEC produces even when it > >> is not used. > > > > So does it mean that if I don't plan to use IPSEC, I can safely remove > > IPSEC_SUPPORT from my config and also get slight performance boost? > > Yes, currently each call to IPsec has check like > `if (ipsec_enabled) {...}`, when you build the kernel without > IPSEC/IPSEC_SUPPORT, this check will be removed too, this can add some > performance boost :-) Got it. :-) Thanks for the fast response (and proper quoting). ./danfe From owner-svn-src-all@freebsd.org Fri May 10 19:11:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24BE315AA9E4; Fri, 10 May 2019 19:11:03 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0E22877F5; Fri, 10 May 2019 19:11:02 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1hPAv4-000BhF-4l; Fri, 10 May 2019 22:10:58 +0300 Date: Fri, 10 May 2019 22:10:58 +0300 From: Slawa Olhovchenkov To: Andrew Gallatin Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, kp@freebsd.org Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf Message-ID: <20190510191058.GC65054@zxy.spb.ru> References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510124458.GB65054@zxy.spb.ru> <0842eef5-5f1f-c25a-a470-a424c536f1ed@cs.duke.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0842eef5-5f1f-c25a-a470-a424c536f1ed@cs.duke.edu> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: B0E22877F5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 19:11:03 -0000 On Fri, May 10, 2019 at 11:31:21AM -0400, Andrew Gallatin wrote: > On 2019-05-10 08:44, Slawa Olhovchenkov wrote: > > > pf have ifdef for IPSEC, but don't have support IPSEC_SUPPORT > > (netpfil/pf/if_pfsync.c). > > > > Thanks for pointing this out. It seems like IPSEC_SUPPORT would work > for this. I've made a patch, and it compiles and the pf module loads. > However, I have no knowledge of how to test it. Is this something > that you use, and which you can test? I am don't use pf, I am just explore kernel for ame reasson (IPSEC performance penalty) and see mostly IPSEC code ifdef to #if defined(IPSEC) || defined(IPSEC_SUPPORT) and only netpfil/pf/if_pfsync.c ifdef to #if defined(IPSEC) > Thanks, > > Drew > > diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c > index 45b1e090f95c..cc06637b862e 100644 > --- a/sys/netpfil/pf/if_pfsync.c > +++ b/sys/netpfil/pf/if_pfsync.c > @@ -308,7 +308,7 @@ static void pfsync_bulk_update(void *); > static void pfsync_bulk_fail(void *); > > static void pfsync_detach_ifnet(struct ifnet *); > -#ifdef IPSEC > +#ifdef IPSEC_SUPPORT > static void pfsync_update_net_tdb(struct pfsync_tdb *); > #endif > static struct pfsync_bucket *pfsync_get_bucket(struct pfsync_softc *, > @@ -1228,7 +1228,7 @@ pfsync_in_tdb(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) > { > int len = count * sizeof(struct pfsync_tdb); > > -#if defined(IPSEC) > +#if defined(IPSEC_SUPPORT) > struct pfsync_tdb *tp; > struct mbuf *mp; > int offp; > @@ -1249,7 +1249,7 @@ pfsync_in_tdb(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) > return (len); > } > > -#if defined(IPSEC) > +#if defined(IPSEC_SUPPORT) > /* Update an in-kernel tdb. Silently fail if no tdb is found. */ > static void > pfsync_update_net_tdb(struct pfsync_tdb *pt) > _______________________________________________ > 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-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Fri May 10 19:36:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23CFC158330D; Fri, 10 May 2019 19:36:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFED688681; Fri, 10 May 2019 19:36:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F8278C6C; Fri, 10 May 2019 19:36:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AJaFMT078160; Fri, 10 May 2019 19:36:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AJaFCT078159; Fri, 10 May 2019 19:36:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905101936.x4AJaFCT078159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 10 May 2019 19:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347463 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 347463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFED688681 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 19:36:16 -0000 Author: jhibbits Date: Fri May 10 19:36:14 2019 New Revision: 347463 URL: https://svnweb.freebsd.org/changeset/base/347463 Log: powerpc: Initialize the Hardware Interrupt Offset Register (HIOR) earlier for ppc970 Since we now have a much larger KVA on powerpc64, it's possible to get SLB traps earlier in boot, possibly even before the HIOR is properly configured for us. Move the HIOR setup to immediately after reset, so that we use our exception handlers instead of Open Firmware's. PR: 233863 Submitted by: Mark Millard (partial) Reported by: Mark Millard MFC after: 2 weeks Modified: head/sys/powerpc/aim/mp_cpudep.c Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Fri May 10 18:25:06 2019 (r347462) +++ head/sys/powerpc/aim/mp_cpudep.c Fri May 10 19:36:14 2019 (r347463) @@ -68,6 +68,10 @@ cpudep_ap_early_bootstrap(void) case IBM970: case IBM970FX: case IBM970MP: + /* Set HIOR to 0 */ + __asm __volatile("mtspr 311,%0" :: "r"(0)); + powerpc_sync(); + /* Restore HID4 and HID5, which are necessary for the MMU */ #ifdef __powerpc64__ @@ -314,10 +318,6 @@ cpudep_ap_setup() case IBM970: case IBM970FX: case IBM970MP: - /* Set HIOR to 0 */ - __asm __volatile("mtspr 311,%0" :: "r"(0)); - powerpc_sync(); - /* * The 970 has strange rules about how to update HID registers. * See Table 2-3, 970MP manual From owner-svn-src-all@freebsd.org Fri May 10 19:55:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 401911583A1C; Fri, 10 May 2019 19:55:30 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDC5388F85; Fri, 10 May 2019 19:55:29 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8E119013; Fri, 10 May 2019 19:55:29 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AJtTIO088733; Fri, 10 May 2019 19:55:29 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AJtTHD088732; Fri, 10 May 2019 19:55:29 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905101955.x4AJtTHD088732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 10 May 2019 19:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347464 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDC5388F85 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 19:55:30 -0000 Author: dougm Date: Fri May 10 19:55:29 2019 New Revision: 347464 URL: https://svnweb.freebsd.org/changeset/base/347464 Log: Replace the expression "-mask & ~mask" with a function call that does the same thing, but is commented so that it might be better understood. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20231 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Fri May 10 19:36:14 2019 (r347463) +++ head/sys/kern/subr_blist.c Fri May 10 19:55:29 2019 (r347464) @@ -643,6 +643,19 @@ blst_next_leaf_alloc(blmeta_t *scan, daddr_t blk, int } /* + * Given a bitmask, flip all the bits from the least-significant 1-bit to the + * most significant bit. If the result is non-zero, then the least-significant + * 1-bit of the result is in the same position as the least-signification 0-bit + * in mask that is followed by a 1-bit. + */ +static inline u_daddr_t +flip_hibits(u_daddr_t mask) +{ + + return (-mask & ~mask); +} + +/* * BLST_LEAF_ALLOC() - allocate at a leaf in the radix tree (a bitmap). * * This function is the core of the allocator. Its execution time is @@ -659,7 +672,7 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count count1 = count - 1; num_shifts = fls(count1); mask = scan->bm_bitmap; - while ((-mask & ~mask) != 0 && num_shifts > 0) { + while (flip_hibits(mask) != 0 && num_shifts > 0) { /* * If bit i is set in mask, then bits in [i, i+range1] are set * in scan->bm_bitmap. The value of range1 is equal to count1 From owner-svn-src-all@freebsd.org Fri May 10 20:15:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B300615852C7; Fri, 10 May 2019 20:15:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5881889B85; Fri, 10 May 2019 20:15:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CAFB93A3; Fri, 10 May 2019 20:15:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AKFfCR099407; Fri, 10 May 2019 20:15:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AKFfJl099406; Fri, 10 May 2019 20:15:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905102015.x4AKFfJl099406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 10 May 2019 20:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347465 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 347465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5881889B85 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 20:15:41 -0000 Author: jhb Date: Fri May 10 20:15:40 2019 New Revision: 347465 URL: https://svnweb.freebsd.org/changeset/base/347465 Log: Apply r280991 to ip6_fragment. This uses m_dup_pkthdr() to copy all of the metadata about a packet to each of its fragments including VLAN tags, mbuf tags, etc. instead of hand-copying a few fields. Reviewed by: bz MFC after: 1 month Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20117 Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri May 10 19:55:29 2019 (r347464) +++ head/sys/netinet6/ip6_output.c Fri May 10 20:15:40 2019 (r347465) @@ -228,7 +228,20 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int h IP6STAT_INC(ip6s_odropped); return (ENOBUFS); } - m->m_flags = m0->m_flags & M_COPYFLAGS; + + /* + * Make sure the complete packet header gets copied + * from the originating mbuf to the newly created + * mbuf. This also ensures that existing firewall + * classification(s), VLAN tags and so on get copied + * to the resulting fragmented packet(s): + */ + if (m_dup_pkthdr(m, m0, M_NOWAIT) == 0) { + m_free(m); + IP6STAT_INC(ip6s_odropped); + return (ENOBUFS); + } + *mnext = m; mnext = &m->m_nextpkt; m->m_data += max_linkhdr; @@ -253,8 +266,6 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int h } m_cat(m, m_frgpart); m->m_pkthdr.len = fraglen + hlen + sizeof(*ip6f); - m->m_pkthdr.fibnum = m0->m_pkthdr.fibnum; - m->m_pkthdr.rcvif = NULL; ip6f->ip6f_reserved = 0; ip6f->ip6f_ident = id; ip6f->ip6f_nxt = nextproto; From owner-svn-src-all@freebsd.org Fri May 10 21:51:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C2DC158A08E; Fri, 10 May 2019 21:51:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22CE28CE35; Fri, 10 May 2019 21:51:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3368A46B; Fri, 10 May 2019 21:51:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ALpHJd049319; Fri, 10 May 2019 21:51:17 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ALpH55049318; Fri, 10 May 2019 21:51:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201905102151.x4ALpH55049318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 10 May 2019 21:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347466 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 347466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22CE28CE35 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 21:51:18 -0000 Author: glebius Date: Fri May 10 21:51:17 2019 New Revision: 347466 URL: https://svnweb.freebsd.org/changeset/base/347466 Log: Fix regression from r347375: do not panic when sending an IP multicast packet from an interface that doesn't have IPv4 address. Reported by: Michael Butler Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri May 10 20:15:40 2019 (r347465) +++ head/sys/netinet/ip_output.c Fri May 10 21:51:17 2019 (r347466) @@ -361,7 +361,11 @@ again: mtu = ifp->if_mtu; IFP_TO_IA(ifp, ia, &in_ifa_tracker); isbroadcast = 0; /* fool gcc */ - src = IA_SIN(ia)->sin_addr; + /* Interface may have no addresses. */ + if (ia != NULL) + src = IA_SIN(ia)->sin_addr; + else + src.s_addr = INADDR_ANY; } else if (ro != NULL) { if (ro->ro_rt == NULL) { /* From owner-svn-src-all@freebsd.org Fri May 10 21:55:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83E0C158A179; Fri, 10 May 2019 21:55:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25D908D1F2; Fri, 10 May 2019 21:55:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5A81A4DB; Fri, 10 May 2019 21:55:11 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ALtBgG051997; Fri, 10 May 2019 21:55:11 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ALtBNW051996; Fri, 10 May 2019 21:55:11 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905102155.x4ALtBNW051996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 10 May 2019 21:55:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347467 - head/sys/netinet/netdump X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/netinet/netdump X-SVN-Commit-Revision: 347467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25D908D1F2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 21:55:12 -0000 Author: cem Date: Fri May 10 21:55:11 2019 New Revision: 347467 URL: https://svnweb.freebsd.org/changeset/base/347467 Log: netdump: Don't store sensitive key data we don't need Prior to this revision, struct diocskerneldump_arg (and struct netdump_conf with embedded diocskerneldump_arg before r347192), were copied in their entirety to the global 'nd_conf' variable. Also prior to this revision, de-configuring netdump would *not* remove the the key material from global nd_conf. As part of Encrypted Kernel Crash Dumps (EKCD), which was developed contemporaneously with netdump but happened to land first, the diocskerneldump_arg structure will contain sensitive key material (kda_key[]) when encrypted dumps are configured. Netdump doesn't have any use for the key data -- encryption is handled in the core dumper code -- so in this revision, we no longer store it. Unfortunately, I think this leak dates to the initial import of netdump in r333283; so it's present in FreeBSD 12.0. Fortunately, the impact *seems* relatively minor. Any new *netdump* configuration would overwrite the key material; for active encrypted netdump configurations, the key data stored was just a duplicate of the key material already in the core dumper code; and no user interface (other than /dev/kmem) actually exposed the leaked material to userspace. Reviewed by: markj, rpokala (earlier commit message) MFC after: 2 weeks Security: yes (minor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20233 Modified: head/sys/netinet/netdump/netdump_client.c Modified: head/sys/netinet/netdump/netdump_client.c ============================================================================== --- head/sys/netinet/netdump/netdump_client.c Fri May 10 21:51:17 2019 (r347466) +++ head/sys/netinet/netdump/netdump_client.c Fri May 10 21:55:11 2019 (r347467) @@ -119,10 +119,16 @@ static uint64_t rcvd_acks; CTASSERT(sizeof(rcvd_acks) * NBBY == NETDUMP_MAX_IN_FLIGHT); /* Configuration parameters. */ -static struct diocskerneldump_arg nd_conf; -#define nd_server nd_conf.kda_server.in4 -#define nd_client nd_conf.kda_client.in4 -#define nd_gateway nd_conf.kda_gateway.in4 +static struct { + char ndc_iface[IFNAMSIZ]; + union kd_ip ndc_server; + union kd_ip ndc_client; + union kd_ip ndc_gateway; + uint8_t ndc_af; +} nd_conf; +#define nd_server nd_conf.ndc_server.in4 +#define nd_client nd_conf.ndc_client.in4 +#define nd_gateway nd_conf.ndc_gateway.in4 /* General dynamic settings. */ static struct ether_addr nd_gw_mac; @@ -1087,8 +1093,20 @@ netdump_configure(struct diocskerneldump_arg *conf, st return (ENODEV); nd_ifp = ifp; + netdump_reinit(ifp); - memcpy(&nd_conf, conf, sizeof(nd_conf)); +#define COPY_SIZED(elm) do { \ + _Static_assert(sizeof(nd_conf.ndc_ ## elm) == \ + sizeof(conf->kda_ ## elm), "elm " __XSTRING(elm) " mismatch"); \ + memcpy(&nd_conf.ndc_ ## elm, &conf->kda_ ## elm, \ + sizeof(nd_conf.ndc_ ## elm)); \ +} while (0) + COPY_SIZED(iface); + COPY_SIZED(server); + COPY_SIZED(client); + COPY_SIZED(gateway); + COPY_SIZED(af); +#undef COPY_SIZED nd_enabled = 1; return (0); } @@ -1193,7 +1211,7 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c error = ENXIO; break; } - if (nd_conf.kda_af != AF_INET) { + if (nd_conf.ndc_af != AF_INET) { error = EOPNOTSUPP; break; } @@ -1225,7 +1243,7 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c memcpy(&conf->kda_server, &nd_server, sizeof(nd_server)); memcpy(&conf->kda_client, &nd_client, sizeof(nd_client)); memcpy(&conf->kda_gateway, &nd_gateway, sizeof(nd_gateway)); - conf->kda_af = nd_conf.kda_af; + conf->kda_af = nd_conf.ndc_af; conf = NULL; break; @@ -1397,7 +1415,7 @@ netdump_modevent(module_t mod __unused, int what, void bzero(&kda, sizeof(kda)); kda.kda_index = KDA_REMOVE_DEV; - (void)dumper_remove(nd_conf.kda_iface, &kda); + (void)dumper_remove(nd_conf.ndc_iface, &kda); netdump_mbuf_drain(); nd_enabled = 0; From owner-svn-src-all@freebsd.org Fri May 10 22:02:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA499158A3E5; Fri, 10 May 2019 22:02:30 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FC428D657; Fri, 10 May 2019 22:02:30 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29A07A68A; Fri, 10 May 2019 22:02:30 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AM2UxS057357; Fri, 10 May 2019 22:02:30 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AM2U9F057356; Fri, 10 May 2019 22:02:30 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905102202.x4AM2U9F057356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 10 May 2019 22:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347468 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FC428D657 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 22:02:30 -0000 Author: dougm Date: Fri May 10 22:02:29 2019 New Revision: 347468 URL: https://svnweb.freebsd.org/changeset/base/347468 Log: Add a (q)uit option to the subr_blist test program. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20234 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Fri May 10 21:55:11 2019 (r347467) +++ head/sys/kern/subr_blist.c Fri May 10 22:02:29 2019 (r347468) @@ -1148,13 +1148,18 @@ main(int ac, char **av) "f %x %d -free\n" "l %x %d -fill\n" "r %d -resize\n" - "h/? -help" + "h/? -help\n" + "q -quit" ); break; + case 'q': + break; default: printf("?\n"); break; } + if (buf[0] == 'q') + break; } return (0); } From owner-svn-src-all@freebsd.org Fri May 10 22:49:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FA1C158AF23; Fri, 10 May 2019 22:49:02 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9942F8E702; Fri, 10 May 2019 22:49:01 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F02EAD38; Fri, 10 May 2019 22:49:01 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AMn1hN078243; Fri, 10 May 2019 22:49:01 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4AMn1Wp078242; Fri, 10 May 2019 22:49:01 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905102249.x4AMn1Wp078242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 10 May 2019 22:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347469 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9942F8E702 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 22:49:02 -0000 Author: dougm Date: Fri May 10 22:49:01 2019 New Revision: 347469 URL: https://svnweb.freebsd.org/changeset/base/347469 Log: When bitpos can't be implemented with an inline ffs* instruction, change the binary search so that it does not depend on a single bit only being set in the bitmask. Use bitpos more generally, and avoid some clearing of bits to accommodate its current behavior. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20232 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Fri May 10 22:02:29 2019 (r347468) +++ head/sys/kern/subr_blist.c Fri May 10 22:49:01 2019 (r347469) @@ -192,31 +192,41 @@ bitrange(int n, int count) /* - * Use binary search, or a faster method, to find the 1 bit in a u_daddr_t. - * Assumes that the argument has only one bit set. + * Find the first bit set in a u_daddr_t. */ static inline int -bitpos(u_daddr_t mask) +generic_bitpos(u_daddr_t mask) { int hi, lo, mid; - switch (sizeof(mask)) { + lo = 0; + hi = BLIST_BMAP_RADIX; + while (lo + 1 < hi) { + mid = (lo + hi) >> 1; + if (mask & bitrange(0, mid)) + hi = mid; + else + lo = mid; + } + return (lo); +} + +static inline int +bitpos(u_daddr_t mask) +{ + + return (_Generic(mask, #ifdef HAVE_INLINE_FFSLL - case sizeof(long long): - return (ffsll(mask) - 1); + long long: ffsll(mask) - 1, #endif - default: - lo = 0; - hi = BLIST_BMAP_RADIX; - while (lo + 1 < hi) { - mid = (lo + hi) >> 1; - if ((mask >> mid) != 0) - lo = mid; - else - hi = mid; - } - return (lo); - } +#ifdef HAVE_INLINE_FFSL + long: ffsl(mask) - 1, +#endif +#ifdef HAVE_INLINE_FFS + int: ffs(mask) - 1, +#endif + default: generic_bitpos(mask) + )); } /* @@ -532,7 +542,8 @@ blist_stats(blist_t bl, struct sbuf *s) struct gap_stats gstats; struct gap_stats *stats = &gstats; daddr_t i, nodes, radix; - u_daddr_t bit, diff, mask; + u_daddr_t diff, mask; + int digit; init_gap_stats(stats); nodes = 0; @@ -570,9 +581,9 @@ blist_stats(blist_t bl, struct sbuf *s) if (gap_stats_counting(stats)) diff ^= 1; while (diff != 0) { - bit = diff & -diff; - update_gap_stats(stats, i + bitpos(bit)); - diff ^= bit; + digit = bitpos(diff); + update_gap_stats(stats, i + digit); + diff ^= bitrange(digit, 1); } } nodes += radix_to_skip(radix); @@ -776,7 +787,7 @@ static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_t count, u_daddr_t radix) { daddr_t blk, i, r, skip; - u_daddr_t bit, mask; + u_daddr_t mask; bool scan_from_start; int digit; @@ -808,8 +819,7 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_ * Examine the nonempty subtree associated with each bit set in mask. */ do { - bit = mask & -mask; - digit = bitpos(bit); + digit = bitpos(mask); i = 1 + digit * skip; if (count <= scan[i].bm_bighint) { /* @@ -819,12 +829,12 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_ count, radix); if (r != SWAPBLK_NONE) { if (scan[i].bm_bitmap == 0) - scan->bm_bitmap ^= bit; + scan->bm_bitmap ^= bitrange(digit, 1); return (r); } } cursor = blk; - } while ((mask ^= bit) != 0); + } while ((mask ^= bitrange(digit, 1)) != 0); /* * We couldn't allocate count in this subtree. If the whole tree was @@ -1019,7 +1029,7 @@ static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab) { daddr_t skip; - u_daddr_t bit, mask; + u_daddr_t mask; int digit; if (radix == BLIST_BMAP_RADIX) { @@ -1051,11 +1061,10 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t mask = scan->bm_bitmap; /* Examine the nonempty subtree associated with each bit set in mask */ do { - bit = mask & -mask; - digit = bitpos(bit); + digit = bitpos(mask); blst_radix_print(&scan[1 + digit * skip], blk + digit * radix, radix, tab); - } while ((mask ^= bit) != 0); + } while ((mask ^= bitrange(digit, 1)) != 0); tab -= 4; printf( From owner-svn-src-all@freebsd.org Fri May 10 23:10:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D85F3158B757; Fri, 10 May 2019 23:10:23 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7641E8F2B2; Fri, 10 May 2019 23:10:23 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D4B7B0B0; Fri, 10 May 2019 23:10:23 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ANANO0088538; Fri, 10 May 2019 23:10:23 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ANAM2o088532; Fri, 10 May 2019 23:10:22 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905102310.x4ANAM2o088532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Fri, 10 May 2019 23:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347470 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 347470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7641E8F2B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 23:10:24 -0000 Author: johalun Date: Fri May 10 23:10:22 2019 New Revision: 347470 URL: https://svnweb.freebsd.org/changeset/base/347470 Log: Implement linux_pci_unregister_drm_driver in linuxkpi so that drm drivers can be unloaded. This patch is a part of D19565. Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Fri May 10 22:49:01 2019 (r347469) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Fri May 10 23:10:22 2019 (r347470) @@ -532,6 +532,7 @@ pci_write_config_dword(struct pci_dev *pdev, int where int linux_pci_register_driver(struct pci_driver *pdrv); int linux_pci_register_drm_driver(struct pci_driver *pdrv); void linux_pci_unregister_driver(struct pci_driver *pdrv); +void linux_pci_unregister_drm_driver(struct pci_driver *pdrv); #define pci_register_driver(pdrv) linux_pci_register_driver(pdrv) #define pci_unregister_driver(pdrv) linux_pci_unregister_driver(pdrv) Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Fri May 10 22:49:01 2019 (r347469) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Fri May 10 23:10:22 2019 (r347470) @@ -417,6 +417,22 @@ linux_pci_unregister_driver(struct pci_driver *pdrv) mtx_unlock(&Giant); } +void +linux_pci_unregister_drm_driver(struct pci_driver *pdrv) +{ + devclass_t bus; + + bus = devclass_find("vgapci"); + + spin_lock(&pci_lock); + list_del(&pdrv->links); + spin_unlock(&pci_lock); + mtx_lock(&Giant); + if (bus != NULL) + devclass_delete_driver(bus, &pdrv->bsddriver); + mtx_unlock(&Giant); +} + CTASSERT(sizeof(dma_addr_t) <= sizeof(uint64_t)); struct linux_dma_obj { From owner-svn-src-all@freebsd.org Fri May 10 23:10:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5E4B158B756; Fri, 10 May 2019 23:10:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57D1E8F2B1; Fri, 10 May 2019 23:10:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D42AB0AF; Fri, 10 May 2019 23:10:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ANANmC088537; Fri, 10 May 2019 23:10:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ANANSZ088536; Fri, 10 May 2019 23:10:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905102310.x4ANANSZ088536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 10 May 2019 23:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347471 - head/sys/netinet/netdump X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/netinet/netdump X-SVN-Commit-Revision: 347471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 57D1E8F2B1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 23:10:24 -0000 Author: cem Date: Fri May 10 23:10:22 2019 New Revision: 347471 URL: https://svnweb.freebsd.org/changeset/base/347471 Log: netdump: Fix boot-time configuration typo Boot-time netdump configuration is much more useful if one can configure the client and gateway addresses. Fix trivial typo. (Long-standing bug, I believe it dates to the original netdump commit.) Spotted by: one of vangyzen@ or markj@ Sponsored by: Dell EMC Isilon Modified: head/sys/netinet/netdump/netdump_client.c Modified: head/sys/netinet/netdump/netdump_client.c ============================================================================== --- head/sys/netinet/netdump/netdump_client.c Fri May 10 23:10:22 2019 (r347470) +++ head/sys/netinet/netdump/netdump_client.c Fri May 10 23:10:22 2019 (r347471) @@ -1394,11 +1394,11 @@ netdump_modevent(module_t mod __unused, int what, void freeenv(arg); } if ((arg = kern_getenv("net.dump.client")) != NULL) { - inet_aton(arg, &conf.kda_server.in4); + inet_aton(arg, &conf.kda_client.in4); freeenv(arg); } if ((arg = kern_getenv("net.dump.gateway")) != NULL) { - inet_aton(arg, &conf.kda_server.in4); + inet_aton(arg, &conf.kda_gateway.in4); freeenv(arg); } conf.kda_af = AF_INET; From owner-svn-src-all@freebsd.org Fri May 10 23:12:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9714C158B9FB; Fri, 10 May 2019 23:12:38 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BB0C8F7D3; Fri, 10 May 2019 23:12:38 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DD90B24B; Fri, 10 May 2019 23:12:38 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ANCbL5093897; Fri, 10 May 2019 23:12:37 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ANCbMJ093896; Fri, 10 May 2019 23:12:37 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905102312.x4ANCbMJ093896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 10 May 2019 23:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347472 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3BB0C8F7D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 23:12:38 -0000 Author: dougm Date: Fri May 10 23:12:37 2019 New Revision: 347472 URL: https://svnweb.freebsd.org/changeset/base/347472 Log: Don't use _Generic, as many systems don't know about it. Go back to a lo-tech switch statement. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20235 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Fri May 10 23:10:22 2019 (r347471) +++ head/sys/kern/subr_blist.c Fri May 10 23:12:37 2019 (r347472) @@ -215,18 +215,18 @@ static inline int bitpos(u_daddr_t mask) { - return (_Generic(mask, + switch (sizeof(mask)) { #ifdef HAVE_INLINE_FFSLL - long long: ffsll(mask) - 1, + case sizeof(long long): + return (ffsll(mask) - 1); #endif -#ifdef HAVE_INLINE_FFSL - long: ffsl(mask) - 1, -#endif #ifdef HAVE_INLINE_FFS - int: ffs(mask) - 1, + case sizeof(int): + return (ffs(mask) - 1); #endif - default: generic_bitpos(mask) - )); + default: + return (generic_bitpos(mask)); + } } /* From owner-svn-src-all@freebsd.org Fri May 10 23:13:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EFE4158BA54; Fri, 10 May 2019 23:13:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 451608F8E8; Fri, 10 May 2019 23:13:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E9ACB251; Fri, 10 May 2019 23:13:00 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4AND01K093953; Fri, 10 May 2019 23:13:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ANCx81093950; Fri, 10 May 2019 23:12:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905102312.x4ANCx81093950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 10 May 2019 23:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347473 - head/sys/netinet/netdump X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/netinet/netdump X-SVN-Commit-Revision: 347473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 451608F8E8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 23:13:00 -0000 Author: cem Date: Fri May 10 23:12:59 2019 New Revision: 347473 URL: https://svnweb.freebsd.org/changeset/base/347473 Log: netdump: Ref the interface we're attached to Serialize netdump configuration / deconfiguration, and discard our configuration when the affiliated interface goes away by monitoring ifnet_departure_event. Reviewed by: markj, with input from vangyzen@ (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20206 Modified: head/sys/netinet/netdump/netdump_client.c Modified: head/sys/netinet/netdump/netdump_client.c ============================================================================== --- head/sys/netinet/netdump/netdump_client.c Fri May 10 23:12:37 2019 (r347472) +++ head/sys/netinet/netdump/netdump_client.c Fri May 10 23:12:59 2019 (r347473) @@ -93,6 +93,8 @@ static int netdump_configure(struct diocskerneldump_a struct thread *); static int netdump_dumper(void *priv __unused, void *virtual, vm_offset_t physical __unused, off_t offset, size_t length); +static bool netdump_enabled(void); +static int netdump_enabled_sysctl(SYSCTL_HANDLER_ARGS); static int netdump_ether_output(struct mbuf *m, struct ifnet *ifp, struct ether_addr dst, u_short etype); static void netdump_handle_arp(struct mbuf **mb); @@ -102,11 +104,13 @@ static int netdump_ioctl(struct cdev *dev __unused, u static int netdump_modevent(module_t mod, int type, void *priv); static void netdump_network_poll(void); static void netdump_pkt_in(struct ifnet *ifp, struct mbuf *m); +static void netdump_reinit_internal(struct ifnet *ifp); static int netdump_send(uint32_t type, off_t offset, unsigned char *data, uint32_t datalen); static int netdump_send_arp(in_addr_t dst); static int netdump_start(struct dumperinfo *di); static int netdump_udp_output(struct mbuf *m); +static void netdump_unconfigure(void); /* Must be at least as big as the chunks dumpsys() gives us. */ static unsigned char nd_buf[MAXDUMPPGS * PAGE_SIZE]; @@ -131,8 +135,17 @@ static struct { #define nd_gateway nd_conf.ndc_gateway.in4 /* General dynamic settings. */ +static struct sx nd_conf_lk; +SX_SYSINIT(nd_conf, &nd_conf_lk, "netdump configuration lock"); +#define NETDUMP_WLOCK() sx_xlock(&nd_conf_lk) +#define NETDUMP_WUNLOCK() sx_xunlock(&nd_conf_lk) +#define NETDUMP_RLOCK() sx_slock(&nd_conf_lk) +#define NETDUMP_RUNLOCK() sx_sunlock(&nd_conf_lk) +#define NETDUMP_ASSERT_WLOCKED() sx_assert(&nd_conf_lk, SA_XLOCKED) +#define NETDUMP_ASSERT_LOCKED() sx_assert(&nd_conf_lk, SA_LOCKED) static struct ether_addr nd_gw_mac; static struct ifnet *nd_ifp; +static eventhandler_tag nd_detach_cookie; static uint16_t nd_server_port = NETDUMP_PORT; FEATURE(netdump, "Netdump client support"); @@ -144,10 +157,8 @@ static int nd_debug; SYSCTL_INT(_net_netdump, OID_AUTO, debug, CTLFLAG_RWTUN, &nd_debug, 0, "Debug message verbosity"); -static int nd_enabled; -SYSCTL_INT(_net_netdump, OID_AUTO, enabled, CTLFLAG_RD, - &nd_enabled, 0, - "netdump configuration status"); +SYSCTL_PROC(_net_netdump, OID_AUTO, enabled, CTLFLAG_RD | CTLTYPE_INT, + &nd_ifp, 0, netdump_enabled_sysctl, "I", "netdump configuration status"); static char nd_path[MAXPATHLEN]; SYSCTL_STRING(_net_netdump, OID_AUTO, path, CTLFLAG_RW, nd_path, sizeof(nd_path), @@ -165,6 +176,29 @@ SYSCTL_INT(_net_netdump, OID_AUTO, arp_retries, CTLFLA &nd_arp_retries, 0, "Number of ARP attempts before giving up"); +static bool +netdump_enabled(void) +{ + + NETDUMP_ASSERT_LOCKED(); + return (nd_ifp != NULL); +} + +static int +netdump_enabled_sysctl(SYSCTL_HANDLER_ARGS) +{ + int en, error; + + NETDUMP_RLOCK(); + en = netdump_enabled(); + NETDUMP_RUNLOCK(); + + error = SYSCTL_OUT(req, &en, sizeof(en)); + if (error != 0 || req->newptr == NULL) + return (error); + return (EPERM); +} + /* * Checks for netdump support on a network interface * @@ -248,7 +282,7 @@ netdump_udp_output(struct mbuf *m) struct udpiphdr *ui; struct ip *ip; - MPASS(nd_ifp != NULL); + MPASS(netdump_enabled()); M_PREPEND(m, sizeof(struct udpiphdr), M_NOWAIT); if (m == NULL) { @@ -306,7 +340,7 @@ netdump_send_arp(in_addr_t dst) struct arphdr *ah; int pktlen; - MPASS(nd_ifp != NULL); + MPASS(netdump_enabled()); /* Fill-up a broadcast address. */ memset(&bcast, 0xFF, ETHER_ADDR_LEN); @@ -409,7 +443,7 @@ netdump_send(uint32_t type, off_t offset, unsigned cha rcvd_acks = 0; retries = 0; - MPASS(nd_ifp != NULL); + MPASS(netdump_enabled()); retransmit: /* Chunks can be too big to fit in packets. */ @@ -875,7 +909,7 @@ static void netdump_network_poll(void) { - MPASS(nd_ifp != NULL); + MPASS(netdump_enabled()); nd_ifp->if_netdump_methods->nd_poll(nd_ifp, 1000); } @@ -945,7 +979,7 @@ netdump_start(struct dumperinfo *di) error = 0; /* Check if the dumping is allowed to continue. */ - if (nd_enabled == 0) + if (!netdump_enabled()) return (EINVAL); if (panicstr == NULL) { @@ -954,8 +988,6 @@ netdump_start(struct dumperinfo *di) return (EINVAL); } - MPASS(nd_ifp != NULL); - if (nd_server.s_addr == INADDR_ANY) { printf("netdump_start: can't netdump; no server IP given\n"); return (EINVAL); @@ -1065,36 +1097,68 @@ static struct cdevsw netdump_cdevsw = { static struct cdev *netdump_cdev; +static void +netdump_unconfigure(void) +{ + struct diocskerneldump_arg kda; + + NETDUMP_ASSERT_WLOCKED(); + KASSERT(netdump_enabled(), ("%s: nd_ifp NULL", __func__)); + + bzero(&kda, sizeof(kda)); + kda.kda_index = KDA_REMOVE_DEV; + (void)dumper_remove(nd_conf.ndc_iface, &kda); + + netdump_mbuf_drain(); + + if_rele(nd_ifp); + nd_ifp = NULL; + + bzero(&nd_conf, sizeof(nd_conf)); +} + +static void +netdump_ifdetach(void *arg __unused, struct ifnet *ifp) +{ + + NETDUMP_WLOCK(); + if (ifp == nd_ifp) + netdump_unconfigure(); + NETDUMP_WUNLOCK(); +} + static int netdump_configure(struct diocskerneldump_arg *conf, struct thread *td) { - struct epoch_tracker et; struct ifnet *ifp; + NETDUMP_ASSERT_WLOCKED(); + CURVNET_SET(TD_TO_VNET(td)); if (!IS_DEFAULT_VNET(curvnet)) { CURVNET_RESTORE(); return (EINVAL); } - NET_EPOCH_ENTER(et); - CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (strcmp(ifp->if_xname, conf->kda_iface) == 0) - break; - } - /* XXX ref */ - NET_EPOCH_EXIT(et); + ifp = ifunit_ref(conf->kda_iface); CURVNET_RESTORE(); if (ifp == NULL) return (ENOENT); - if ((if_getflags(ifp) & IFF_UP) == 0) + if ((if_getflags(ifp) & IFF_UP) == 0) { + if_rele(ifp); return (ENXIO); - if (!netdump_supported_nic(ifp) || ifp->if_type != IFT_ETHER) + } + if (!netdump_supported_nic(ifp) || ifp->if_type != IFT_ETHER) { + if_rele(ifp); return (ENODEV); + } + if (netdump_enabled()) + if_rele(nd_ifp); nd_ifp = ifp; - netdump_reinit(ifp); + netdump_reinit_internal(ifp); + #define COPY_SIZED(elm) do { \ _Static_assert(sizeof(nd_conf.ndc_ ## elm) == \ sizeof(conf->kda_ ## elm), "elm " __XSTRING(elm) " mismatch"); \ @@ -1107,23 +1171,35 @@ netdump_configure(struct diocskerneldump_arg *conf, st COPY_SIZED(gateway); COPY_SIZED(af); #undef COPY_SIZED - nd_enabled = 1; + return (0); } /* * Reinitialize the mbuf pool used by drivers while dumping. This is called - * from the generic ioctl handler for SIOCSIFMTU after the driver has - * reconfigured itself. + * from the generic ioctl handler for SIOCSIFMTU after any NIC driver has + * reconfigured itself. (I.e., it may not be a configured netdump interface.) */ void netdump_reinit(struct ifnet *ifp) { - int clsize, nmbuf, ncl, nrxr; - if (ifp != nd_ifp) + NETDUMP_WLOCK(); + if (ifp != nd_ifp) { + NETDUMP_WUNLOCK(); return; + } + netdump_reinit_internal(ifp); + NETDUMP_WUNLOCK(); +} +static void +netdump_reinit_internal(struct ifnet *ifp) +{ + int clsize, nmbuf, ncl, nrxr; + + NETDUMP_ASSERT_WLOCKED(); + ifp->if_netdump_methods->nd_init(ifp, &nrxr, &ncl, &clsize); KASSERT(nrxr > 0, ("invalid receive ring count %d", nrxr)); @@ -1168,6 +1244,8 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c conf = NULL; error = 0; + NETDUMP_WLOCK(); + switch (cmd) { #ifdef COMPAT_FREEBSD11 case DIOCSKERNELDUMP_FREEBSD11: @@ -1177,10 +1255,8 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c error = ENXIO; break; } - if (nd_enabled) { - nd_enabled = 0; - netdump_mbuf_drain(); - } + if (netdump_enabled()) + netdump_unconfigure(); break; #endif #ifdef COMPAT_FREEBSD12 @@ -1197,17 +1273,15 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c error = ENXIO; break; } - if (nd_enabled) { - nd_enabled = 0; - netdump_mbuf_drain(); - } + if (netdump_enabled()) + netdump_unconfigure(); break; case NETDUMPGCONF_FREEBSD12: gone_in(14, "FreeBSD 12.x ABI compat"); conf12 = (void *)addr; - if (!nd_enabled) { + if (!netdump_enabled()) { error = ENXIO; break; } @@ -1232,7 +1306,7 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c * For now, index is ignored; netdump doesn't support multiple * configurations (yet). */ - if (!nd_enabled) { + if (!netdump_enabled()) { error = ENXIO; conf = NULL; break; @@ -1293,13 +1367,10 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c if (conf->kda_index == KDA_REMOVE || conf->kda_index == KDA_REMOVE_DEV || conf->kda_index == KDA_REMOVE_ALL) { - if (nd_enabled || conf->kda_index == KDA_REMOVE_ALL) { - error = dumper_remove(conf->kda_iface, conf); - if (error == 0) { - nd_enabled = 0; - netdump_mbuf_drain(); - } - } + if (netdump_enabled()) + netdump_unconfigure(); + if (conf->kda_index == KDA_REMOVE_ALL) + error = dumper_remove(NULL, conf); break; } @@ -1342,10 +1413,8 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c conf->kda_encryptedkeysize); free(encryptedkey, M_TEMP); } - if (error != 0) { - nd_enabled = 0; - netdump_mbuf_drain(); - } + if (error != 0) + netdump_unconfigure(); break; default: error = ENOTTY; @@ -1354,6 +1423,7 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c explicit_bzero(&kda_copy, sizeof(kda_copy)); if (conf != NULL) explicit_bzero(conf, sizeof(*conf)); + NETDUMP_WUNLOCK(); return (error); } @@ -1385,6 +1455,9 @@ netdump_modevent(module_t mod __unused, int what, void if (error != 0) return (error); + nd_detach_cookie = EVENTHANDLER_REGISTER(ifnet_departure_event, + netdump_ifdetach, NULL, EVENTHANDLER_PRI_ANY); + if ((arg = kern_getenv("net.dump.iface")) != NULL) { strlcpy(conf.kda_iface, arg, sizeof(conf.kda_iface)); freeenv(arg); @@ -1404,23 +1477,21 @@ netdump_modevent(module_t mod __unused, int what, void conf.kda_af = AF_INET; /* Ignore errors; we print a message to the console. */ + NETDUMP_WLOCK(); (void)netdump_configure(&conf, curthread); + NETDUMP_WUNLOCK(); } break; case MOD_UNLOAD: - if (nd_enabled) { - struct diocskerneldump_arg kda; - + NETDUMP_WLOCK(); + if (netdump_enabled()) { printf("netdump: disabling dump device for unload\n"); - - bzero(&kda, sizeof(kda)); - kda.kda_index = KDA_REMOVE_DEV; - (void)dumper_remove(nd_conf.ndc_iface, &kda); - - netdump_mbuf_drain(); - nd_enabled = 0; + netdump_unconfigure(); } + NETDUMP_WUNLOCK(); destroy_dev(netdump_cdev); + EVENTHANDLER_DEREGISTER(ifnet_departure_event, + nd_detach_cookie); break; default: error = EOPNOTSUPP; From owner-svn-src-all@freebsd.org Fri May 10 23:45:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AAA4158C3C5; Fri, 10 May 2019 23:45:19 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6D3268464; Fri, 10 May 2019 23:45:18 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B126AB751; Fri, 10 May 2019 23:45:18 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ANjINk009168; Fri, 10 May 2019 23:45:18 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ANjHoD009161; Fri, 10 May 2019 23:45:17 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905102345.x4ANjHoD009161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 10 May 2019 23:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347474 - in stable/12: sbin/fsck_ffs sys/ufs/ufs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in stable/12: sbin/fsck_ffs sys/ufs/ufs X-SVN-Commit-Revision: 347474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D6D3268464 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 23:45:19 -0000 Author: mckusick Date: Fri May 10 23:45:16 2019 New Revision: 347474 URL: https://svnweb.freebsd.org/changeset/base/347474 Log: MFC of 347064, 347066, and 347130 Avoid leaking kernel stack when creating directory names. Modified: stable/12/sbin/fsck_ffs/dir.c stable/12/sbin/fsck_ffs/fsck.h stable/12/sbin/fsck_ffs/fsck_ffs.8 stable/12/sbin/fsck_ffs/globs.c stable/12/sbin/fsck_ffs/main.c stable/12/sys/ufs/ufs/dir.h stable/12/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_ffs/dir.c ============================================================================== --- stable/12/sbin/fsck_ffs/dir.c Fri May 10 23:12:59 2019 (r347473) +++ stable/12/sbin/fsck_ffs/dir.c Fri May 10 23:45:16 2019 (r347474) @@ -147,14 +147,23 @@ fsck_readdir(struct inodesc *idesc) struct direct *dp, *ndp; struct bufarea *bp; long size, blksiz, fix, dploc; + int dc; blksiz = idesc->id_numfrags * sblock.fs_fsize; bp = getdirblk(idesc->id_blkno, blksiz); if (idesc->id_loc % DIRBLKSIZ == 0 && idesc->id_filesize > 0 && idesc->id_loc < blksiz) { dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (dircheck(idesc, dp)) + if ((dc = dircheck(idesc, dp)) > 0) { + if (dc == 2) { + /* + * dircheck() cleared unused directory space. + * Mark the buffer as dirty to write it out. + */ + dirty(bp); + } goto dpok; + } if (idesc->id_fix == IGNORE) return (0); fix = dofix(idesc, "DIRECTORY CORRUPTED"); @@ -181,19 +190,26 @@ dpok: if ((idesc->id_loc % DIRBLKSIZ) == 0) return (dp); ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (idesc->id_loc < blksiz && idesc->id_filesize > 0 && - dircheck(idesc, ndp) == 0) { - size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); - idesc->id_loc += size; - idesc->id_filesize -= size; - if (idesc->id_fix == IGNORE) - return (0); - fix = dofix(idesc, "DIRECTORY CORRUPTED"); - bp = getdirblk(idesc->id_blkno, blksiz); - dp = (struct direct *)(bp->b_un.b_buf + dploc); - dp->d_reclen += size; - if (fix) + if (idesc->id_loc < blksiz && idesc->id_filesize > 0) { + if ((dc = dircheck(idesc, ndp)) == 0) { + size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); + idesc->id_loc += size; + idesc->id_filesize -= size; + if (idesc->id_fix == IGNORE) + return (0); + fix = dofix(idesc, "DIRECTORY CORRUPTED"); + bp = getdirblk(idesc->id_blkno, blksiz); + dp = (struct direct *)(bp->b_un.b_buf + dploc); + dp->d_reclen += size; + if (fix) + dirty(bp); + } else if (dc == 2) { + /* + * dircheck() cleared unused directory space. + * Mark the buffer as dirty to write it out. + */ dirty(bp); + } } return (dp); } @@ -201,6 +217,11 @@ dpok: /* * Verify that a directory entry is valid. * This is a superset of the checks made in the kernel. + * Also optionally clears padding and unused directory space. + * + * Returns 0 if the entry is bad, 1 if the entry is good and no changes + * were made, and 2 if the entry is good but modified to clear out padding + * and unused space and needs to be written back to disk. */ static int dircheck(struct inodesc *idesc, struct direct *dp) @@ -209,15 +230,39 @@ dircheck(struct inodesc *idesc, struct direct *dp) char *cp; u_char type; u_int8_t namlen; - int spaceleft; + int spaceleft, modified, unused; + modified = 0; spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); if (dp->d_reclen == 0 || dp->d_reclen > spaceleft || - (dp->d_reclen & 0x3) != 0) + (dp->d_reclen & (DIR_ROUNDUP - 1)) != 0) goto bad; - if (dp->d_ino == 0) - return (1); + if (dp->d_ino == 0) { + /* + * Special case of an unused directory entry. Normally + * the kernel would coalesce unused space with the previous + * entry by extending its d_reclen, but there are situations + * (e.g. fsck) where that doesn't occur. + * If we're clearing out directory cruft (-z flag), then make + * sure this entry gets fully cleared as well. + */ + if (zflag && fswritefd >= 0) { + if (dp->d_type != 0) { + dp->d_type = 0; + modified = 1; + } + if (dp->d_namlen != 0) { + dp->d_namlen = 0; + modified = 1; + } + if (dp->d_name[0] != '\0') { + dp->d_name[0] = '\0'; + modified = 1; + } + } + goto good; + } size = DIRSIZ(0, dp); namlen = dp->d_namlen; type = dp->d_type; @@ -231,7 +276,37 @@ dircheck(struct inodesc *idesc, struct direct *dp) goto bad; if (*cp != '\0') goto bad; + +good: + if (zflag && fswritefd >= 0) { + /* + * Clear unused directory entry space, including the d_name + * padding. + */ + /* First figure the number of pad bytes. */ + unused = roundup2(namlen + 1, DIR_ROUNDUP) - (namlen + 1); + + /* Add in the free space to the end of the record. */ + unused += dp->d_reclen - DIRSIZ(0, dp); + + /* + * Now clear out the unused space, keeping track if we actually + * changed anything. + */ + for (cp = &dp->d_name[namlen + 1]; unused > 0; unused--, cp++) { + if (*cp != '\0') { + *cp = '\0'; + modified = 1; + } + } + + if (modified) { + return 2; + } + } + return (1); + bad: if (debug) printf("Bad dir: ino %d reclen %d namlen %d type %d name %s\n", Modified: stable/12/sbin/fsck_ffs/fsck.h ============================================================================== --- stable/12/sbin/fsck_ffs/fsck.h Fri May 10 23:12:59 2019 (r347473) +++ stable/12/sbin/fsck_ffs/fsck.h Fri May 10 23:45:16 2019 (r347474) @@ -315,6 +315,7 @@ extern off_t bflag; /* location of alternate super b extern int debug; /* output debugging info */ extern int Eflag; /* delete empty data blocks */ extern int Zflag; /* zero empty data blocks */ +extern int zflag; /* zero unused directory space */ extern int inoopt; /* trim out unused inodes */ extern char ckclean; /* only do work if not cleanly unmounted */ extern int cvtlevel; /* convert to newer file system format */ Modified: stable/12/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/12/sbin/fsck_ffs/fsck_ffs.8 Fri May 10 23:12:59 2019 (r347473) +++ stable/12/sbin/fsck_ffs/fsck_ffs.8 Fri May 10 23:45:16 2019 (r347474) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd January 13, 2018 +.Dd May 3, 2019 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BCdEFfnpRrSyZ +.Op Fl BCdEFfnpRrSyZz .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -301,6 +301,9 @@ If both and .Fl Z are specified, blocks are first zeroed and then erased. +.It Fl z +Clear unused directory space. +The cleared space includes deleted file names and name padding. .El .Pp Inconsistencies checked are as follows: Modified: stable/12/sbin/fsck_ffs/globs.c ============================================================================== --- stable/12/sbin/fsck_ffs/globs.c Fri May 10 23:12:59 2019 (r347473) +++ stable/12/sbin/fsck_ffs/globs.c Fri May 10 23:45:16 2019 (r347474) @@ -85,6 +85,7 @@ off_t bflag; /* location of alternate super block */ int debug; /* output debugging info */ int Eflag; /* delete empty data blocks */ int Zflag; /* zero empty data blocks */ +int zflag; /* zero unused directory space */ int inoopt; /* trim out unused inodes */ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ Modified: stable/12/sbin/fsck_ffs/main.c ============================================================================== --- stable/12/sbin/fsck_ffs/main.c Fri May 10 23:12:59 2019 (r347473) +++ stable/12/sbin/fsck_ffs/main.c Fri May 10 23:45:16 2019 (r347474) @@ -89,7 +89,7 @@ main(int argc, char *argv[]) sync(); skipclean = 1; inoopt = 0; - while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npRrSyZ")) != -1) { + while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npRrSyZz")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -164,6 +164,10 @@ main(int argc, char *argv[]) case 'Z': Zflag++; + break; + + case 'z': + zflag++; break; default: Modified: stable/12/sys/ufs/ufs/dir.h ============================================================================== --- stable/12/sys/ufs/ufs/dir.h Fri May 10 23:12:59 2019 (r347473) +++ stable/12/sys/ufs/ufs/dir.h Fri May 10 23:45:16 2019 (r347474) @@ -108,13 +108,11 @@ struct direct { * The DIRSIZ macro gives the minimum record length which will hold * the directory entry. This requires the amount of space in struct direct * without the d_name field, plus enough space for the name with a terminating - * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary. - * - * + * null byte (dp->d_namlen + 1), rounded up to a 4 byte boundary. */ -#define DIRECTSIZ(namlen) \ - ((__offsetof(struct direct, d_name) + \ - ((namlen)+1)*sizeof(((struct direct *)0)->d_name[0]) + 3) & ~3) +#define DIR_ROUNDUP 4 /* Directory name roundup size */ +#define DIRECTSIZ(namlen) \ + (roundup2(__offsetof(struct direct, d_name) + (namlen) + 1, DIR_ROUNDUP)) #if (BYTE_ORDER == LITTLE_ENDIAN) #define DIRSIZ(oldfmt, dp) \ ((oldfmt) ? DIRECTSIZ((dp)->d_type) : DIRECTSIZ((dp)->d_namlen)) Modified: stable/12/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_lookup.c Fri May 10 23:12:59 2019 (r347473) +++ stable/12/sys/ufs/ufs/ufs_lookup.c Fri May 10 23:45:16 2019 (r347474) @@ -825,14 +825,21 @@ ufs_makedirentry(ip, cnp, newdirp) struct componentname *cnp; struct direct *newdirp; { + u_int namelen; -#ifdef INVARIANTS - if ((cnp->cn_flags & SAVENAME) == 0) - panic("ufs_makedirentry: missing name"); -#endif + namelen = (unsigned)cnp->cn_namelen; + KASSERT((cnp->cn_flags & SAVENAME) != 0, + ("ufs_makedirentry: missing name")); + KASSERT(namelen <= UFS_MAXNAMLEN, + ("ufs_makedirentry: name too long")); newdirp->d_ino = ip->i_number; - newdirp->d_namlen = cnp->cn_namelen; - bcopy(cnp->cn_nameptr, newdirp->d_name, (unsigned)cnp->cn_namelen + 1); + newdirp->d_namlen = namelen; + + /* Zero out after-name padding */ + *(u_int32_t *)(&newdirp->d_name[namelen & ~(DIR_ROUNDUP - 1)]) = 0; + + bcopy(cnp->cn_nameptr, newdirp->d_name, namelen); + if (ITOV(ip)->v_mount->mnt_maxsymlinklen > 0) newdirp->d_type = IFTODT(ip->i_mode); else { @@ -1211,16 +1218,21 @@ ufs_dirremove(dvp, ip, flags, isrmdir) if (ip && rep->d_ino != ip->i_number) panic("ufs_dirremove: ip %ju does not match dirent ino %ju\n", (uintmax_t)ip->i_number, (uintmax_t)rep->d_ino); - if (dp->i_count == 0) { + /* + * Zero out the file directory entry metadata to reduce disk + * scavenging disclosure. + */ + bzero(&rep->d_name[0], rep->d_namlen); + rep->d_namlen = 0; + rep->d_type = 0; + rep->d_ino = 0; + + if (dp->i_count != 0) { /* - * First entry in block: set d_ino to zero. - */ - ep->d_ino = 0; - } else { - /* * Collapse new free space into previous entry. */ ep->d_reclen += rep->d_reclen; + rep->d_reclen = 0; } #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) From owner-svn-src-all@freebsd.org Fri May 10 23:46:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A540158C50E; Fri, 10 May 2019 23:46:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31498685C3; Fri, 10 May 2019 23:46:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C945B752; Fri, 10 May 2019 23:46:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ANkhSw009281; Fri, 10 May 2019 23:46:43 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ANkgMi009273; Fri, 10 May 2019 23:46:42 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905102346.x4ANkgMi009273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 10 May 2019 23:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347475 - in stable/11: sbin/fsck_ffs sys/ufs/ufs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in stable/11: sbin/fsck_ffs sys/ufs/ufs X-SVN-Commit-Revision: 347475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31498685C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 23:46:44 -0000 Author: mckusick Date: Fri May 10 23:46:42 2019 New Revision: 347475 URL: https://svnweb.freebsd.org/changeset/base/347475 Log: MFC of 347064, 347066, and 347130 Avoid leaking kernel stack when creating directory names. Modified: stable/11/sbin/fsck_ffs/dir.c stable/11/sbin/fsck_ffs/fsck.h stable/11/sbin/fsck_ffs/fsck_ffs.8 stable/11/sbin/fsck_ffs/globs.c stable/11/sbin/fsck_ffs/main.c stable/11/sys/ufs/ufs/dir.h stable/11/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_ffs/dir.c ============================================================================== --- stable/11/sbin/fsck_ffs/dir.c Fri May 10 23:45:16 2019 (r347474) +++ stable/11/sbin/fsck_ffs/dir.c Fri May 10 23:46:42 2019 (r347475) @@ -145,14 +145,23 @@ fsck_readdir(struct inodesc *idesc) struct direct *dp, *ndp; struct bufarea *bp; long size, blksiz, fix, dploc; + int dc; blksiz = idesc->id_numfrags * sblock.fs_fsize; bp = getdirblk(idesc->id_blkno, blksiz); if (idesc->id_loc % DIRBLKSIZ == 0 && idesc->id_filesize > 0 && idesc->id_loc < blksiz) { dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (dircheck(idesc, dp)) + if ((dc = dircheck(idesc, dp)) > 0) { + if (dc == 2) { + /* + * dircheck() cleared unused directory space. + * Mark the buffer as dirty to write it out. + */ + dirty(bp); + } goto dpok; + } if (idesc->id_fix == IGNORE) return (0); fix = dofix(idesc, "DIRECTORY CORRUPTED"); @@ -179,19 +188,26 @@ dpok: if ((idesc->id_loc % DIRBLKSIZ) == 0) return (dp); ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (idesc->id_loc < blksiz && idesc->id_filesize > 0 && - dircheck(idesc, ndp) == 0) { - size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); - idesc->id_loc += size; - idesc->id_filesize -= size; - if (idesc->id_fix == IGNORE) - return (0); - fix = dofix(idesc, "DIRECTORY CORRUPTED"); - bp = getdirblk(idesc->id_blkno, blksiz); - dp = (struct direct *)(bp->b_un.b_buf + dploc); - dp->d_reclen += size; - if (fix) + if (idesc->id_loc < blksiz && idesc->id_filesize > 0) { + if ((dc = dircheck(idesc, ndp)) == 0) { + size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); + idesc->id_loc += size; + idesc->id_filesize -= size; + if (idesc->id_fix == IGNORE) + return (0); + fix = dofix(idesc, "DIRECTORY CORRUPTED"); + bp = getdirblk(idesc->id_blkno, blksiz); + dp = (struct direct *)(bp->b_un.b_buf + dploc); + dp->d_reclen += size; + if (fix) + dirty(bp); + } else if (dc == 2) { + /* + * dircheck() cleared unused directory space. + * Mark the buffer as dirty to write it out. + */ dirty(bp); + } } return (dp); } @@ -199,6 +215,11 @@ dpok: /* * Verify that a directory entry is valid. * This is a superset of the checks made in the kernel. + * Also optionally clears padding and unused directory space. + * + * Returns 0 if the entry is bad, 1 if the entry is good and no changes + * were made, and 2 if the entry is good but modified to clear out padding + * and unused space and needs to be written back to disk. */ static int dircheck(struct inodesc *idesc, struct direct *dp) @@ -207,15 +228,39 @@ dircheck(struct inodesc *idesc, struct direct *dp) char *cp; u_char type; u_int8_t namlen; - int spaceleft; + int spaceleft, modified, unused; + modified = 0; spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); if (dp->d_reclen == 0 || dp->d_reclen > spaceleft || - (dp->d_reclen & 0x3) != 0) + (dp->d_reclen & (DIR_ROUNDUP - 1)) != 0) goto bad; - if (dp->d_ino == 0) - return (1); + if (dp->d_ino == 0) { + /* + * Special case of an unused directory entry. Normally + * the kernel would coalesce unused space with the previous + * entry by extending its d_reclen, but there are situations + * (e.g. fsck) where that doesn't occur. + * If we're clearing out directory cruft (-z flag), then make + * sure this entry gets fully cleared as well. + */ + if (zflag && fswritefd >= 0) { + if (dp->d_type != 0) { + dp->d_type = 0; + modified = 1; + } + if (dp->d_namlen != 0) { + dp->d_namlen = 0; + modified = 1; + } + if (dp->d_name[0] != '\0') { + dp->d_name[0] = '\0'; + modified = 1; + } + } + goto good; + } size = DIRSIZ(0, dp); namlen = dp->d_namlen; type = dp->d_type; @@ -229,7 +274,37 @@ dircheck(struct inodesc *idesc, struct direct *dp) goto bad; if (*cp != '\0') goto bad; + +good: + if (zflag && fswritefd >= 0) { + /* + * Clear unused directory entry space, including the d_name + * padding. + */ + /* First figure the number of pad bytes. */ + unused = roundup2(namlen + 1, DIR_ROUNDUP) - (namlen + 1); + + /* Add in the free space to the end of the record. */ + unused += dp->d_reclen - DIRSIZ(0, dp); + + /* + * Now clear out the unused space, keeping track if we actually + * changed anything. + */ + for (cp = &dp->d_name[namlen + 1]; unused > 0; unused--, cp++) { + if (*cp != '\0') { + *cp = '\0'; + modified = 1; + } + } + + if (modified) { + return 2; + } + } + return (1); + bad: if (debug) printf("Bad dir: ino %d reclen %d namlen %d type %d name %s\n", Modified: stable/11/sbin/fsck_ffs/fsck.h ============================================================================== --- stable/11/sbin/fsck_ffs/fsck.h Fri May 10 23:45:16 2019 (r347474) +++ stable/11/sbin/fsck_ffs/fsck.h Fri May 10 23:46:42 2019 (r347475) @@ -313,6 +313,7 @@ extern ufs2_daddr_t bflag; /* location of alternate s extern int debug; /* output debugging info */ extern int Eflag; /* delete empty data blocks */ extern int Zflag; /* zero empty data blocks */ +extern int zflag; /* zero unused directory space */ extern int inoopt; /* trim out unused inodes */ extern char ckclean; /* only do work if not cleanly unmounted */ extern int cvtlevel; /* convert to newer file system format */ Modified: stable/11/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/11/sbin/fsck_ffs/fsck_ffs.8 Fri May 10 23:45:16 2019 (r347474) +++ stable/11/sbin/fsck_ffs/fsck_ffs.8 Fri May 10 23:46:42 2019 (r347475) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd January 13, 2018 +.Dd May 3, 2019 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BCdEFfnpRrSyZ +.Op Fl BCdEFfnpRrSyZz .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -301,6 +301,9 @@ If both and .Fl Z are specified, blocks are first zeroed and then erased. +.It Fl z +Clear unused directory space. +The cleared space includes deleted file names and name padding. .El .Pp Inconsistencies checked are as follows: Modified: stable/11/sbin/fsck_ffs/globs.c ============================================================================== --- stable/11/sbin/fsck_ffs/globs.c Fri May 10 23:45:16 2019 (r347474) +++ stable/11/sbin/fsck_ffs/globs.c Fri May 10 23:46:42 2019 (r347475) @@ -83,6 +83,7 @@ ufs2_daddr_t bflag; /* location of alternate super bl int debug; /* output debugging info */ int Eflag; /* delete empty data blocks */ int Zflag; /* zero empty data blocks */ +int zflag; /* zero unused directory space */ int inoopt; /* trim out unused inodes */ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ Modified: stable/11/sbin/fsck_ffs/main.c ============================================================================== --- stable/11/sbin/fsck_ffs/main.c Fri May 10 23:45:16 2019 (r347474) +++ stable/11/sbin/fsck_ffs/main.c Fri May 10 23:46:42 2019 (r347475) @@ -86,7 +86,7 @@ main(int argc, char *argv[]) sync(); skipclean = 1; inoopt = 0; - while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npRrSyZ")) != -1) { + while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npRrSyZz")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -161,6 +161,10 @@ main(int argc, char *argv[]) case 'Z': Zflag++; + break; + + case 'z': + zflag++; break; default: Modified: stable/11/sys/ufs/ufs/dir.h ============================================================================== --- stable/11/sys/ufs/ufs/dir.h Fri May 10 23:45:16 2019 (r347474) +++ stable/11/sys/ufs/ufs/dir.h Fri May 10 23:46:42 2019 (r347475) @@ -105,13 +105,11 @@ struct direct { * The DIRSIZ macro gives the minimum record length which will hold * the directory entry. This requires the amount of space in struct direct * without the d_name field, plus enough space for the name with a terminating - * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary. - * - * + * null byte (dp->d_namlen + 1), rounded up to a 4 byte boundary. */ -#define DIRECTSIZ(namlen) \ - ((__offsetof(struct direct, d_name) + \ - ((namlen)+1)*sizeof(((struct direct *)0)->d_name[0]) + 3) & ~3) +#define DIR_ROUNDUP 4 /* Directory name roundup size */ +#define DIRECTSIZ(namlen) \ + (roundup2(__offsetof(struct direct, d_name) + (namlen) + 1, DIR_ROUNDUP)) #if (BYTE_ORDER == LITTLE_ENDIAN) #define DIRSIZ(oldfmt, dp) \ ((oldfmt) ? DIRECTSIZ((dp)->d_type) : DIRECTSIZ((dp)->d_namlen)) Modified: stable/11/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_lookup.c Fri May 10 23:45:16 2019 (r347474) +++ stable/11/sys/ufs/ufs/ufs_lookup.c Fri May 10 23:46:42 2019 (r347475) @@ -823,14 +823,21 @@ ufs_makedirentry(ip, cnp, newdirp) struct componentname *cnp; struct direct *newdirp; { + u_int namelen; -#ifdef INVARIANTS - if ((cnp->cn_flags & SAVENAME) == 0) - panic("ufs_makedirentry: missing name"); -#endif + namelen = (unsigned)cnp->cn_namelen; + KASSERT((cnp->cn_flags & SAVENAME) != 0, + ("ufs_makedirentry: missing name")); + KASSERT(namelen <= MAXNAMLEN, + ("ufs_makedirentry: name too long")); newdirp->d_ino = ip->i_number; - newdirp->d_namlen = cnp->cn_namelen; - bcopy(cnp->cn_nameptr, newdirp->d_name, (unsigned)cnp->cn_namelen + 1); + newdirp->d_namlen = namelen; + + /* Zero out after-name padding */ + *(u_int32_t *)(&newdirp->d_name[namelen & ~(DIR_ROUNDUP - 1)]) = 0; + + bcopy(cnp->cn_nameptr, newdirp->d_name, namelen); + if (ITOV(ip)->v_mount->mnt_maxsymlinklen > 0) newdirp->d_type = IFTODT(ip->i_mode); else { @@ -1209,16 +1216,21 @@ ufs_dirremove(dvp, ip, flags, isrmdir) if (ip && rep->d_ino != ip->i_number) panic("ufs_dirremove: ip %ju does not match dirent ino %ju\n", (uintmax_t)ip->i_number, (uintmax_t)rep->d_ino); - if (dp->i_count == 0) { + /* + * Zero out the file directory entry metadata to reduce disk + * scavenging disclosure. + */ + bzero(&rep->d_name[0], rep->d_namlen); + rep->d_namlen = 0; + rep->d_type = 0; + rep->d_ino = 0; + + if (dp->i_count != 0) { /* - * First entry in block: set d_ino to zero. - */ - ep->d_ino = 0; - } else { - /* * Collapse new free space into previous entry. */ ep->d_reclen += rep->d_reclen; + rep->d_reclen = 0; } #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) From owner-svn-src-all@freebsd.org Fri May 10 23:52:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53988158C8B6; Fri, 10 May 2019 23:52:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE9FC69DBE; Fri, 10 May 2019 23:52:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA774B8DB; Fri, 10 May 2019 23:52:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ANqHt2013798; Fri, 10 May 2019 23:52:17 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ANqHGV013797; Fri, 10 May 2019 23:52:17 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905102352.x4ANqHGV013797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 10 May 2019 23:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347476 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 347476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EE9FC69DBE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2019 23:52:18 -0000 Author: rmacklem Date: Fri May 10 23:52:17 2019 New Revision: 347476 URL: https://svnweb.freebsd.org/changeset/base/347476 Log: Factor out some exportlist list operations into separate functions. This patch moves the code that removes and frees all exportlist elements out into a separate function called free_exports(). It does the same for the insertion of a new exportlist entry into a list. It also adds a second argument to ex_search() for the list to use. None of these changes have any semantic effect. They are being done to prepare the code for future patches that convert the single linked list for the exportlist to a hash table of lists and a patch that will do incremental changes of exports in the kernel. And it fixes the argument for SLIST_HEAD_INITIALIZER() to be a pointer, which doesn't really matter, since SLIST_HEAD_INITIALIZER() doesn't use the argument. MFC after: 1 month Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Fri May 10 23:46:42 2019 (r347475) +++ head/usr.sbin/mountd/mountd.c Fri May 10 23:52:17 2019 (r347476) @@ -128,6 +128,8 @@ struct exportlist { /* ex_flag bits */ #define EX_LINKED 0x1 +SLIST_HEAD(exportlisthead, exportlist); + struct netmsk { struct sockaddr_storage nt_net; struct sockaddr_storage nt_mask; @@ -189,13 +191,15 @@ static int do_mount(struct exportlist *, struct groupl struct xucred *, char *, int, struct statfs *); static int do_opt(char **, char **, struct exportlist *, struct grouplist *, int *, int *, struct xucred *); -static struct exportlist *ex_search(fsid_t *); +static struct exportlist *ex_search(fsid_t *, struct exportlisthead *); static struct exportlist *get_exp(void); static void free_dir(struct dirlist *); static void free_exp(struct exportlist *); static void free_grp(struct grouplist *); static void free_host(struct hostlist *); static void get_exportlist(void); +static void insert_exports(struct exportlist *, struct exportlisthead *); +static void free_exports(struct exportlisthead *); static int get_host(char *, struct grouplist *, struct grouplist *); static struct hostlist *get_ht(void); static int get_line(void); @@ -227,8 +231,8 @@ static int xdr_fhs(XDR *, caddr_t); static int xdr_mlist(XDR *, caddr_t); static void terminate(int); -static SLIST_HEAD(, exportlist) exphead = SLIST_HEAD_INITIALIZER(exphead); -static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(mlhead); +static struct exportlisthead exphead = SLIST_HEAD_INITIALIZER(&exphead); +static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(&mlhead); static struct grouplist *grphead; static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; @@ -1087,7 +1091,7 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) if (bad) ep = NULL; else - ep = ex_search(&fsb.f_fsid); + ep = ex_search(&fsb.f_fsid, &exphead); hostset = defset = 0; if (ep && (chk_host(ep->ex_defdir, saddr, &defset, &hostset, &numsecflavors, &secflavorsp) || @@ -1540,7 +1544,7 @@ get_exportlist_one(void) * See if this directory is already * in the list. */ - ep = ex_search(&fsb.f_fsid); + ep = ex_search(&fsb.f_fsid, &exphead); if (ep == (struct exportlist *)NULL) { ep = get_exp(); ep->ex_fs = fsb.f_fsid; @@ -1695,7 +1699,7 @@ get_exportlist_one(void) } dirhead = (struct dirlist *)NULL; if ((ep->ex_flag & EX_LINKED) == 0) { - SLIST_INSERT_HEAD(&exphead, ep, entries); + insert_exports(ep, &exphead); ep->ex_flag |= EX_LINKED; } @@ -1714,7 +1718,6 @@ nextline: static void get_exportlist(void) { - struct exportlist *ep, *ep2; struct grouplist *grp, *tgrp; struct export_args export; struct iovec *iov; @@ -1738,10 +1741,7 @@ get_exportlist(void) /* * First, get rid of the old list */ - SLIST_FOREACH_SAFE(ep, &exphead, entries, ep2) { - SLIST_REMOVE(&exphead, ep, exportlist, entries); - free_exp(ep); - } + free_exports(&exphead); grp = grphead; while (grp) { @@ -1869,6 +1869,31 @@ get_exportlist(void) } /* + * Insert an export entry in the appropriate list. + */ +static void +insert_exports(struct exportlist *ep, struct exportlisthead *exhp) +{ + + SLIST_INSERT_HEAD(exhp, ep, entries); +} + +/* + * Free up the exports lists passed in as arguments. + */ +static void +free_exports(struct exportlisthead *exhp) +{ + struct exportlist *ep, *ep2; + + SLIST_FOREACH_SAFE(ep, exhp, entries, ep2) { + SLIST_REMOVE(exhp, ep, exportlist, entries); + free_exp(ep); + } + SLIST_INIT(exhp); +} + +/* * Allocate an export list element */ static struct exportlist * @@ -1924,11 +1949,11 @@ getexp_err(struct exportlist *ep, struct grouplist *gr * Search the export list for a matching fs. */ static struct exportlist * -ex_search(fsid_t *fsid) +ex_search(fsid_t *fsid, struct exportlisthead *exhp) { struct exportlist *ep; - SLIST_FOREACH(ep, &exphead, entries) { + SLIST_FOREACH(ep, exhp, entries) { if (ep->ex_fs.val[0] == fsid->val[0] && ep->ex_fs.val[1] == fsid->val[1]) return (ep); From owner-svn-src-all@freebsd.org Sat May 11 02:13:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19118158F0DA; Sat, 11 May 2019 02:13:53 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B083D6E038; Sat, 11 May 2019 02:13:52 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C117D1BF; Sat, 11 May 2019 02:13:52 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4B2Dq4b088623; Sat, 11 May 2019 02:13:52 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4B2Dq9U088622; Sat, 11 May 2019 02:13:52 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905110213.x4B2Dq9U088622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 11 May 2019 02:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347477 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B083D6E038 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.919,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 02:13:53 -0000 Author: dougm Date: Sat May 11 02:13:52 2019 New Revision: 347477 URL: https://svnweb.freebsd.org/changeset/base/347477 Log: Revert r347469. Approved by: kib (mentor) Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Fri May 10 23:52:17 2019 (r347476) +++ head/sys/kern/subr_blist.c Sat May 11 02:13:52 2019 (r347477) @@ -192,41 +192,31 @@ bitrange(int n, int count) /* - * Find the first bit set in a u_daddr_t. + * Use binary search, or a faster method, to find the 1 bit in a u_daddr_t. + * Assumes that the argument has only one bit set. */ static inline int -generic_bitpos(u_daddr_t mask) +bitpos(u_daddr_t mask) { int hi, lo, mid; - lo = 0; - hi = BLIST_BMAP_RADIX; - while (lo + 1 < hi) { - mid = (lo + hi) >> 1; - if (mask & bitrange(0, mid)) - hi = mid; - else - lo = mid; - } - return (lo); -} - -static inline int -bitpos(u_daddr_t mask) -{ - - switch (sizeof(mask)) { + switch (sizeof(mask)) { #ifdef HAVE_INLINE_FFSLL - case sizeof(long long): - return (ffsll(mask) - 1); + case sizeof(long long): + return (ffsll(mask) - 1); #endif -#ifdef HAVE_INLINE_FFS - case sizeof(int): - return (ffs(mask) - 1); -#endif - default: - return (generic_bitpos(mask)); - } + default: + lo = 0; + hi = BLIST_BMAP_RADIX; + while (lo + 1 < hi) { + mid = (lo + hi) >> 1; + if ((mask >> mid) != 0) + lo = mid; + else + hi = mid; + } + return (lo); + } } /* @@ -542,8 +532,7 @@ blist_stats(blist_t bl, struct sbuf *s) struct gap_stats gstats; struct gap_stats *stats = &gstats; daddr_t i, nodes, radix; - u_daddr_t diff, mask; - int digit; + u_daddr_t bit, diff, mask; init_gap_stats(stats); nodes = 0; @@ -581,9 +570,9 @@ blist_stats(blist_t bl, struct sbuf *s) if (gap_stats_counting(stats)) diff ^= 1; while (diff != 0) { - digit = bitpos(diff); - update_gap_stats(stats, i + digit); - diff ^= bitrange(digit, 1); + bit = diff & -diff; + update_gap_stats(stats, i + bitpos(bit)); + diff ^= bit; } } nodes += radix_to_skip(radix); @@ -787,7 +776,7 @@ static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_t count, u_daddr_t radix) { daddr_t blk, i, r, skip; - u_daddr_t mask; + u_daddr_t bit, mask; bool scan_from_start; int digit; @@ -819,7 +808,8 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_ * Examine the nonempty subtree associated with each bit set in mask. */ do { - digit = bitpos(mask); + bit = mask & -mask; + digit = bitpos(bit); i = 1 + digit * skip; if (count <= scan[i].bm_bighint) { /* @@ -829,12 +819,12 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_ count, radix); if (r != SWAPBLK_NONE) { if (scan[i].bm_bitmap == 0) - scan->bm_bitmap ^= bitrange(digit, 1); + scan->bm_bitmap ^= bit; return (r); } } cursor = blk; - } while ((mask ^= bitrange(digit, 1)) != 0); + } while ((mask ^= bit) != 0); /* * We couldn't allocate count in this subtree. If the whole tree was @@ -1029,7 +1019,7 @@ static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab) { daddr_t skip; - u_daddr_t mask; + u_daddr_t bit, mask; int digit; if (radix == BLIST_BMAP_RADIX) { @@ -1061,10 +1051,11 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t mask = scan->bm_bitmap; /* Examine the nonempty subtree associated with each bit set in mask */ do { - digit = bitpos(mask); + bit = mask & -mask; + digit = bitpos(bit); blst_radix_print(&scan[1 + digit * skip], blk + digit * radix, radix, tab); - } while ((mask ^= bitrange(digit, 1)) != 0); + } while ((mask ^= bit) != 0); tab -= 4; printf( From owner-svn-src-all@freebsd.org Sat May 11 03:35:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A45C15908E1; Sat, 11 May 2019 03:35:14 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C58E2706FF; Sat, 11 May 2019 03:35:13 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C5E3DF5B; Sat, 11 May 2019 03:35:13 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4B3ZDtN031417; Sat, 11 May 2019 03:35:13 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4B3ZDru031416; Sat, 11 May 2019 03:35:13 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905110335.x4B3ZDru031416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 11 May 2019 03:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347478 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 347478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C58E2706FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.90)[-0.900,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 03:35:14 -0000 Author: asomers Date: Sat May 11 03:35:13 2019 New Revision: 347478 URL: https://svnweb.freebsd.org/changeset/base/347478 Log: MFC r345202: VOP_INACTIVE(9): clarify wording Reviewed by: kib, 0mp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19596 Modified: stable/11/share/man/man9/VOP_INACTIVE.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/VOP_INACTIVE.9 ============================================================================== --- stable/11/share/man/man9/VOP_INACTIVE.9 Sat May 11 02:13:52 2019 (r347477) +++ stable/11/share/man/man9/VOP_INACTIVE.9 Sat May 11 03:35:13 2019 (r347478) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 27, 2014 +.Dd March 15, 2019 .Dt VOP_INACTIVE 9 .Os .Sh NAME @@ -50,13 +50,16 @@ The vnode being reclaimed. .El .Pp .Fn VOP_INACTIVE -is called when the kernel is no longer using the vnode. +is usually called when the kernel is no longer using the vnode. +However, there is no guarantee that it will be called at all, for example if +the last reference was dropped while the vnode lock could not be upgraded +to exclusive without sleeping. This may be because the reference count reaches zero or it may be that the file system is being forcibly unmounted while there are open files. -It can be used to reclaim space for +It can be used to reclaim space on the last close of an .Sq open but deleted -files. +file. .Pp .Fn VOP_RECLAIM is called when a vnode is being reused for a different file system. From owner-svn-src-all@freebsd.org Sat May 11 03:37:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D89161590980; Sat, 11 May 2019 03:37:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C03370869; Sat, 11 May 2019 03:37:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EDF7DF64; Sat, 11 May 2019 03:37:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4B3biqw031592; Sat, 11 May 2019 03:37:44 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4B3bh94031591; Sat, 11 May 2019 03:37:43 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905110337.x4B3bh94031591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 11 May 2019 03:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347479 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 347479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C03370869 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.90)[-0.901,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 03:37:45 -0000 Author: asomers Date: Sat May 11 03:37:43 2019 New Revision: 347479 URL: https://svnweb.freebsd.org/changeset/base/347479 Log: MFC r345677: Add man page for VOP_FDATASYNC(9) Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19678 Modified: stable/11/share/man/man9/Makefile stable/11/share/man/man9/VOP_FSYNC.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/Makefile ============================================================================== --- stable/11/share/man/man9/Makefile Sat May 11 03:35:13 2019 (r347478) +++ stable/11/share/man/man9/Makefile Sat May 11 03:37:43 2019 (r347479) @@ -1997,6 +1997,7 @@ MLINKS+=VOP_ATTRIB.9 VOP_GETATTR.9 \ MLINKS+=VOP_CREATE.9 VOP_MKDIR.9 \ VOP_CREATE.9 VOP_MKNOD.9 \ VOP_CREATE.9 VOP_SYMLINK.9 +MLINKS+=VOP_FSYNC.9 VOP_FDATASYNC.9 MLINKS+=VOP_GETPAGES.9 VOP_PUTPAGES.9 MLINKS+=VOP_INACTIVE.9 VOP_RECLAIM.9 MLINKS+=VOP_LOCK.9 vn_lock.9 \ Modified: stable/11/share/man/man9/VOP_FSYNC.9 ============================================================================== --- stable/11/share/man/man9/VOP_FSYNC.9 Sat May 11 03:35:13 2019 (r347478) +++ stable/11/share/man/man9/VOP_FSYNC.9 Sat May 11 03:37:43 2019 (r347479) @@ -28,20 +28,27 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd March 22, 2019 .Dt VOP_FSYNC 9 .Os .Sh NAME +.Nm VOP_FDATASYNC , .Nm VOP_FSYNC .Nd flush file system buffers for a file .Sh SYNOPSIS .In sys/param.h .In sys/vnode.h .Ft int +.Fn VOP_FDATASYNC "struct vnode *vp" "struct thread *td" +.Ft int .Fn VOP_FSYNC "struct vnode *vp" "int waitfor" "struct thread *td" .Sh DESCRIPTION -This call flushes any dirty file system buffers for the file. -It is used to implement the +.Fn VOP_FSYNC +ensures that a file can be recovered to its current state following a crash. +That typically requires flushing the file's dirty buffers, its inode, and +possibly other filesystem metadata to persistent media. +.Fn VOP_FSYNC +is used to implement the .Xr sync 2 and .Xr fsync 2 @@ -65,8 +72,20 @@ Push data not written by file system syncer. .It Fa td The calling thread. .El +.Pp +.Fn VOP_FDATASYNC +is similar, but it does not require that all of the file's metadata be flushed. +It only requires that the file's data be recoverable after a crash. +That implies that the data itself must be flushed to disk, as well as some +metadata such as the file's size but not necessarily its attributes. +.Fn VOP_FDATASYNC +should always wait for I/O to complete, as if called with +.Dv MNT_WAIT . +.Fn VOP_FDATASYNC +is used to implement +.Xr fdatasync 2 . .Sh LOCKS -The file should be locked on entry. +The vnode should be exclusively locked on entry, and stays locked on return. .Sh RETURN VALUES Zero is returned if the call is successful, otherwise an appropriate error code is returned. From owner-svn-src-all@freebsd.org Sat May 11 03:38:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2599A1590A15; Sat, 11 May 2019 03:38:51 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0848709A8; Sat, 11 May 2019 03:38:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B51EBDF66; Sat, 11 May 2019 03:38:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4B3co5d031694; Sat, 11 May 2019 03:38:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4B3co0k031693; Sat, 11 May 2019 03:38:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905110338.x4B3co0k031693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 11 May 2019 03:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347480 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 347480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0848709A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.90)[-0.901,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 03:38:51 -0000 Author: asomers Date: Sat May 11 03:38:50 2019 New Revision: 347480 URL: https://svnweb.freebsd.org/changeset/base/347480 Log: MFC r346078: fix cache_lookup's documentation cache_lookup's documentation got dislocated by r324378. Relocate and expand it. Reviewed by: jhb, kib Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/kern/vfs_cache.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_cache.c ============================================================================== --- stable/11/sys/kern/vfs_cache.c Sat May 11 03:37:43 2019 (r347479) +++ stable/11/sys/kern/vfs_cache.c Sat May 11 03:38:50 2019 (r347480) @@ -143,7 +143,7 @@ struct namecache_ts { * Names found by directory scans are retained in a cache * for future reference. It is managed LRU, so frequently * used names will hang around. Cache is indexed by hash value - * obtained from (vp, name) where vp refers to the directory + * obtained from (dvp, name) where dvp refers to the directory * containing name. * * If it is a "negative" entry, (i.e. for a name that is known NOT to @@ -1121,23 +1121,6 @@ cache_lookup_dot(struct vnode *dvp, struct vnode **vpp return (-1); } -/* - * Lookup an entry in the cache - * - * Lookup is called with dvp pointing to the directory to search, - * cnp pointing to the name of the entry being sought. If the lookup - * succeeds, the vnode is returned in *vpp, and a status of -1 is - * returned. If the lookup determines that the name does not exist - * (negative caching), a status of ENOENT is returned. If the lookup - * fails, a status of zero is returned. If the directory vnode is - * recycled out from under us due to a forced unmount, a status of - * ENOENT is returned. - * - * vpp is locked and ref'd on return. If we're looking up DOTDOT, dvp is - * unlocked. If we're looking up . an extra ref is taken, but the lock is - * not recursively acquired. - */ - static __noinline int cache_lookup_nomakeentry(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp) @@ -1221,6 +1204,42 @@ out_no_entry: return (0); } +/** + * Lookup a name in the name cache + * + * # Arguments + * + * - dvp: Parent directory in which to search. + * - vpp: Return argument. Will contain desired vnode on cache hit. + * - cnp: Parameters of the name search. The most interesting bits of + * the cn_flags field have the following meanings: + * - MAKEENTRY: If clear, free an entry from the cache rather than look + * it up. + * - ISDOTDOT: Must be set if and only if cn_nameptr == ".." + * - tsp: Return storage for cache timestamp. On a successful (positive + * or negative) lookup, tsp will be filled with any timespec that + * was stored when this cache entry was created. However, it will + * be clear for "." entries. + * - ticks: Return storage for alternate cache timestamp. On a successful + * (positive or negative) lookup, it will contain the ticks value + * that was current when the cache entry was created, unless cnp + * was ".". + * + * # Returns + * + * - -1: A positive cache hit. vpp will contain the desired vnode. + * - ENOENT: A negative cache hit, or dvp was recycled out from under us due + * to a forced unmount. vpp will not be modified. If the entry + * is a whiteout, then the ISWHITEOUT flag will be set in + * cnp->cn_flags. + * - 0: A cache miss. vpp will not be modified. + * + * # Locking + * + * On a cache hit, vpp will be returned locked and ref'd. If we're looking up + * .., dvp is unlocked. If we're looking up . an extra ref is taken, but the + * lock is not recursively acquired. + */ int cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp) From owner-svn-src-all@freebsd.org Sat May 11 03:39:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEC011590AB7; Sat, 11 May 2019 03:39:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66C7B70AF6; Sat, 11 May 2019 03:39:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4416DDF69; Sat, 11 May 2019 03:39:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4B3dZwp031779; Sat, 11 May 2019 03:39:35 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4B3dZ32031778; Sat, 11 May 2019 03:39:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905110339.x4B3dZ32031778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 11 May 2019 03:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347481 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 347481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 66C7B70AF6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.90)[-0.900,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 03:39:35 -0000 Author: asomers Date: Sat May 11 03:39:34 2019 New Revision: 347481 URL: https://svnweb.freebsd.org/changeset/base/347481 Log: MFC r346750: [skip ci] fix typo in comment from r59840 Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/kern/vfs_bio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_bio.c ============================================================================== --- stable/11/sys/kern/vfs_bio.c Sat May 11 03:38:50 2019 (r347480) +++ stable/11/sys/kern/vfs_bio.c Sat May 11 03:39:34 2019 (r347481) @@ -4056,7 +4056,7 @@ bufwait(struct buf *bp) * read error occurred, or if the op was a write. B_CACHE is never * set if the buffer is invalid or otherwise uncacheable. * - * biodone does not mess with B_INVAL, allowing the I/O routine or the + * bufdone does not mess with B_INVAL, allowing the I/O routine or the * initiator to leave B_INVAL set to brelse the buffer out of existence * in the biodone routine. */ From owner-svn-src-all@freebsd.org Sat May 11 03:41:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CE121590C15; Sat, 11 May 2019 03:41:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2433E7106A; Sat, 11 May 2019 03:41:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F395DE0FD; Sat, 11 May 2019 03:41:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4B3fwpQ036692; Sat, 11 May 2019 03:41:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4B3fwNu036684; Sat, 11 May 2019 03:41:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905110341.x4B3fwNu036684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 11 May 2019 03:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347482 - stable/11/sys/fs/fuse X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/sys/fs/fuse X-SVN-Commit-Revision: 347482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2433E7106A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.90)[-0.900,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 03:41:59 -0000 Author: asomers Date: Sat May 11 03:41:58 2019 New Revision: 347482 URL: https://svnweb.freebsd.org/changeset/base/347482 Log: MFC r345986: fusefs: fix a panic on mount Don't page fault if the file descriptor provided with "-o fd" is invalid. This is a merge of r345419 from the projects/fuse2 branch. Reviewed by: ngie Tested by: Marek Zarychta Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19836 Modified: stable/11/sys/fs/fuse/fuse_vfsops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- stable/11/sys/fs/fuse/fuse_vfsops.c Sat May 11 03:39:34 2019 (r347481) +++ stable/11/sys/fs/fuse/fuse_vfsops.c Sat May 11 03:41:58 2019 (r347482) @@ -215,7 +215,7 @@ fuse_vfsop_mount(struct mount *mp) size_t len; struct cdev *fdev; - struct fuse_data *data; + struct fuse_data *data = NULL; struct thread *td; struct file *fp, *fptmp; char *fspec, *subtype; @@ -355,7 +355,7 @@ fuse_vfsop_mount(struct mount *mp) out: if (err) { FUSE_LOCK(); - if (data->mp == mp) { + if (data != NULL && data->mp == mp) { /* * Destroy device only if we acquired reference to * it From owner-svn-src-all@freebsd.org Sat May 11 04:18:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB8BB1591798; Sat, 11 May 2019 04:18:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A499724AE; Sat, 11 May 2019 04:18:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 262AEE6CE; Sat, 11 May 2019 04:18:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4B4I7ka053783; Sat, 11 May 2019 04:18:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4B4I71l053782; Sat, 11 May 2019 04:18:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905110418.x4B4I71l053782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 May 2019 04:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347483 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A499724AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.91)[-0.912,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 04:18:08 -0000 Author: kevans Date: Sat May 11 04:18:06 2019 New Revision: 347483 URL: https://svnweb.freebsd.org/changeset/base/347483 Log: tuntap: Improve style No functional change. tun_flags of the tuntap_driver was renamed to ident_flags to reflect the fact that it's a subset of the tun_flags that identifies a tuntap device. This maps more easily (visually) to the TUN_DRIVER_IDENT_MASK that masks off the bits of tun_flags that are applicable to tuntap driver ident. This is a purely cosmetic change. Modified: head/sys/net/if_tuntap.c Modified: head/sys/net/if_tuntap.c ============================================================================== --- head/sys/net/if_tuntap.c Sat May 11 03:41:58 2019 (r347482) +++ head/sys/net/if_tuntap.c Sat May 11 04:18:06 2019 (r347483) @@ -104,9 +104,9 @@ struct tuntap_driver; * static for the duration of a tunnel interface. */ struct tuntap_softc { - TAILQ_ENTRY(tuntap_softc) tun_list; - struct cdev *tun_dev; - u_short tun_flags; /* misc flags */ + TAILQ_ENTRY(tuntap_softc) tun_list; + struct cdev *tun_dev; + u_short tun_flags; /* misc flags */ #define TUN_OPEN 0x0001 #define TUN_INITED 0x0002 #define TUN_RCOLL 0x0004 @@ -120,20 +120,21 @@ struct tuntap_softc { #define TUN_L2 0x0400 #define TUN_VMNET 0x0800 -#define TUN_READY (TUN_OPEN | TUN_INITED) +#define TUN_DRIVER_IDENT_MASK (TUN_L2 | TUN_VMNET) +#define TUN_READY (TUN_OPEN | TUN_INITED) - pid_t tun_pid; /* owning pid */ - struct ifnet *tun_ifp; /* the interface */ - struct sigio *tun_sigio; /* information for async I/O */ - struct tuntap_driver *tun_drv; /* appropriate driver */ - struct selinfo tun_rsel; /* read select */ - struct mtx tun_mtx; /* protect mutable softc fields */ - struct cv tun_cv; /* protect against ref'd dev destroy */ - struct ether_addr tun_ether; /* remote address */ + pid_t tun_pid; /* owning pid */ + struct ifnet *tun_ifp; /* the interface */ + struct sigio *tun_sigio; /* async I/O info */ + struct tuntap_driver *tun_drv; /* appropriate driver */ + struct selinfo tun_rsel; /* read select */ + struct mtx tun_mtx; /* softc field mutex */ + struct cv tun_cv; /* for ref'd dev destroy */ + struct ether_addr tun_ether; /* remote address */ }; -#define TUN2IFP(sc) ((sc)->tun_ifp) +#define TUN2IFP(sc) ((sc)->tun_ifp) -#define TUNDEBUG if (tundebug) if_printf +#define TUNDEBUG if (tundebug) if_printf #define TUN_LOCK(tp) mtx_lock(&(tp)->tun_mtx) #define TUN_UNLOCK(tp) mtx_unlock(&(tp)->tun_mtx) @@ -153,8 +154,8 @@ static const char vmnetname[] = "vmnet"; static MALLOC_DEFINE(M_TUN, tunname, "Tunnel Interface"); static int tundebug = 0; static int tundclone = 1; -static int tap_allow_uopen = 0; /* allow user open() */ -static int tapuponopen = 0; /* IFF_UP on open() */ +static int tap_allow_uopen = 0; /* allow user open() */ +static int tapuponopen = 0; /* IFF_UP on open() */ static int tapdclone = 1; /* enable devfs cloning */ static TAILQ_HEAD(,tuntap_softc) tunhead = TAILQ_HEAD_INITIALIZER(tunhead); @@ -174,11 +175,11 @@ SYSCTL_INT(_net_link_tun, OID_AUTO, devfs_cloning, CTL static SYSCTL_NODE(_net_link, OID_AUTO, tap, CTLFLAG_RW, 0, "Ethernet tunnel software network interface"); SYSCTL_INT(_net_link_tap, OID_AUTO, user_open, CTLFLAG_RW, &tap_allow_uopen, 0, - "Allow user to open /dev/tap (based on node permissions)"); + "Allow user to open /dev/tap (based on node permissions)"); SYSCTL_INT(_net_link_tap, OID_AUTO, up_on_open, CTLFLAG_RW, &tapuponopen, 0, - "Bring interface up when /dev/tap is opened"); + "Bring interface up when /dev/tap is opened"); SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTLFLAG_RWTUN, &tapdclone, 0, - "Enable legacy devfs interface creation"); + "Enable legacy devfs interface creation"); SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tundebug, 0, ""); static int tuntap_name2info(const char *name, int *unit, int *flags); @@ -226,19 +227,17 @@ static struct filterops tun_write_filterops = { .f_event = tunkqwrite, }; -#define TUN_DRIVER_IDENT_MASK (TUN_L2 | TUN_VMNET) - static struct tuntap_driver { - int tun_flags; - struct unrhdr *unrhdr; struct cdevsw cdevsw; + int ident_flags; + struct unrhdr *unrhdr; struct clonedevs *clones; ifc_match_t *clone_match_fn; ifc_create_t *clone_create_fn; ifc_destroy_t *clone_destroy_fn; } tuntap_drivers[] = { { - .tun_flags = 0, + .ident_flags = 0, .cdevsw = { .d_version = D_VERSION, .d_flags = D_NEEDMINOR, @@ -256,7 +255,7 @@ static struct tuntap_driver { .clone_destroy_fn = tun_clone_destroy, }, { - .tun_flags = TUN_L2, + .ident_flags = TUN_L2, .cdevsw = { .d_version = D_VERSION, .d_flags = D_NEEDMINOR, @@ -274,7 +273,7 @@ static struct tuntap_driver { .clone_destroy_fn = tun_clone_destroy, }, { - .tun_flags = TUN_L2 | TUN_VMNET, + .ident_flags = TUN_L2 | TUN_VMNET, .cdevsw = { .d_version = D_VERSION, .d_flags = D_NEEDMINOR, @@ -294,7 +293,7 @@ static struct tuntap_driver { }; struct tuntap_driver_cloner { - SLIST_ENTRY(tuntap_driver_cloner) link; + SLIST_ENTRY(tuntap_driver_cloner) link; struct tuntap_driver *drv; struct if_clone *cloner; }; @@ -338,13 +337,13 @@ tuntap_name2info(const char *name, int *outunit, int * if (strcmp(name, drv->cdevsw.d_name) == 0) { found = true; unit = -1; - flags = drv->tun_flags; + flags = drv->ident_flags; break; } if (dev_stdclone(dname, NULL, drv->cdevsw.d_name, &unit) == 1) { found = true; - flags = drv->tun_flags; + flags = drv->ident_flags; break; } } @@ -376,7 +375,7 @@ tuntap_driver_from_flags(int tun_flags) KASSERT(drvc->drv != NULL, ("tuntap_driver_cloners entry not properly initialized")); drv = drvc->drv; - if ((tun_flags & TUN_DRIVER_IDENT_MASK) == drv->tun_flags) + if ((tun_flags & TUN_DRIVER_IDENT_MASK) == drv->ident_flags) return (drv); } @@ -779,7 +778,7 @@ tuncreate(struct cdev *dev, struct tuntap_driver *drv) sc = malloc(sizeof(*sc), M_TUN, M_WAITOK | M_ZERO); mtx_init(&sc->tun_mtx, "tun_mtx", NULL, MTX_DEF); cv_init(&sc->tun_cv, "tun_condvar"); - sc->tun_flags = drv->tun_flags; + sc->tun_flags = drv->ident_flags; sc->tun_dev = dev; sc->tun_drv = drv; mtx_lock(&tunmtx); From owner-svn-src-all@freebsd.org Sat May 11 04:48:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E45D81591D3A; Sat, 11 May 2019 04:48:25 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A9FE72F1F; Sat, 11 May 2019 04:48:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id PJvihlwmCGusjPJvjhQURI; Fri, 10 May 2019 22:48:17 -0600 X-Authority-Analysis: v=2.3 cv=fOdHIqSe c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=E5NmQfObTbMA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=VbAEleswHmL2TocY9FAA:9 a=CjuIK1q_8ugA:10 a=wboGf8yKFvQA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id F11273A5; Fri, 10 May 2019 21:48:12 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x4B4lqfq031568; Fri, 10 May 2019 21:47:52 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x4B4lqeh031565; Fri, 10 May 2019 22:47:52 -0600 (MDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201905110447.x4B4lqeh031565@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Doug Moore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347477 - head/sys/kern In-Reply-To: Message from Doug Moore of "Sat, 11 May 2019 02:13:52 -0000." <201905110213.x4B2Dq9U088622@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 10 May 2019 22:47:52 -0600 X-CMAE-Envelope: MS4wfOgaWjore5/ioBK1rjBHF+ZB+68LpolbQb0imWVc9n9DHGZG8elX/K+0j03ZzwfbVO88b2UShSLu6qRFRlK5PNWtPDqGY9fflCHG1tWlX2Ucw1fRC1xb 7uOo+TUa49D6Rzg4XWwD1r6U2H5fycIApO9M9Hg9gv+mXSpdRzRQM+beV4tvTkSVB30NTq2Qpg7ZYbZ4e/Yofku6+4LUB4dDWys/rFwlzM4QFm3OKhm2qN5o Kki+CEKg8rQ1v0T/vxd4NeTg2OQP9lc0qWxVqCsbSVNvF8UAqNdxiPZelIbbRT8h X-Rspamd-Queue-Id: 5A9FE72F1F X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.69 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.57)[-0.570,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-2.41)[ip: (-6.22), ipnet: 64.59.128.0/20(-3.24), asn: 6327(-2.48), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[138.136.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 04:48:26 -0000 In message <201905110213.x4B2Dq9U088622@repo.freebsd.org>, Doug Moore writes: > Author: dougm > Date: Sat May 11 02:13:52 2019 > New Revision: 347477 > URL: https://svnweb.freebsd.org/changeset/base/347477 > > Log: > Revert r347469. Why? > > Approved by: kib (mentor) > > Modified: > head/sys/kern/subr_blist.c > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat May 11 04:57:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 944A01591F78; Sat, 11 May 2019 04:57:39 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA8FA7330F; Sat, 11 May 2019 04:57:38 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: by mail-ot1-x335.google.com with SMTP id i8so7397889oth.10; Fri, 10 May 2019 21:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=yCeJVXVa7817pTPZrvnEqbBUgoWrmTnRpikvvkQXbvw=; b=Oo6IBh15LmXb+JXrUPZtoC/LehZXYEEExR287ZELKwAu4uf6AM5amdBqhFY7Zjm+qJ pceK7ybhIjgj0+CnG3JhNBUUz/RIPL0bbIuVS1jWjtEd2WkDEaNvHt4doCXqftFUPiFD zN3hzQcN7INmtrJx1qEUj0JdeuNUmX2GlP/jBeRmt2eh0MyZ63/du/cQRebOczyEwgaO NXASEP8FLmzzOAa65iGlJ5PwnopjsahWOM58Mgvjl6zZ/1IW53gU3ijCeTdY239YfOfB 9IzYdZYjBkB43XQ8lRiX5qT7ZhnP7D+Ir2SmvkKMBNk2MPDSw/EZLryy/X8Zt0ceY9/l INYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=yCeJVXVa7817pTPZrvnEqbBUgoWrmTnRpikvvkQXbvw=; b=FVKCGYk5cOHOYasee3ciWbxJYabNgSs4M6bkbIsQPf3WlSBYgwTKqasHe0sYZUkGwT /TL8Mju/FUrijQEbHS+SRdhFqMIcu3t+uV9/uzTXSyO1atJA4N6zy9UZgeNv0qkeXXnz FCALKzQQtNJKdF3TQvTY6uHg+sVMNkNMgeFsVuVBgscP7YPAliUVrpU4Vsbg4Tp1tYm7 PKqBz5KGfS2PKxZlIKXfR4Pom3hpvsHaIcPfR499Ezs8ykhwZHrs1pHBkK0gL/iVlYpv 7YPCVoSOYYGV0921eb/RTTJjf8UwI6x5yp9kHdbO1dRnIjbaA9y7A+00yiyEnTJ5clvJ 6TUA== X-Gm-Message-State: APjAAAUWfg8K+Q6qwAbDSteoH9OqMmy98M5Z1v4ZtabZpC73OxTXZeFp 9AuLIHA6aA3iTKyJQ62Loo0aDJi0vl+nlw== X-Google-Smtp-Source: APXvYqwelEXjnQvp9YLw5cdoGlAzoMc8yUshEvP0fS2gGW6xNqBADw3jFHTmGDgjBKO+hZEqAVE0Cw== X-Received: by 2002:a9d:7c85:: with SMTP id q5mr9519738otn.31.1557550657441; Fri, 10 May 2019 21:57:37 -0700 (PDT) Received: from 108-254-203-202.lightspeed.hstntx.sbcglobal.net (108-254-203-202.lightspeed.hstntx.sbcglobal.net. [108.254.203.202]) by smtp.gmail.com with ESMTPSA id w13sm2589026otl.26.2019.05.10.21.57.36 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 10 May 2019 21:57:36 -0700 (PDT) Subject: Re: svn commit: r347477 - head/sys/kern To: Cy Schubert , Doug Moore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905110447.x4B4lqeh031565@slippy.cwsent.com> From: Doug Moore Openpgp: preference=signencrypt Autocrypt: addr=unkadoug@gmail.com; keydata= mQENBFy53VQBCAD2UiGSouAAMcSIax5Sp9JtRSd9dYVuAmSraY7x5yOylq8yJ5IDvHZy5q3a FamaCHMpXxieiD/8yTnHIeHP4bg02oDD3ALs0hMAEz00pZlLdxeXRfDzAlMTqFF6USPjDUI8 J/WH+pciNT68bFVXFYVg+bgp4GIdi2Md8X8zQQnHY0xLyKE9FjVN1MlCk+62B6fFhMQIEvd5 RQdbGd+ljuoORD1ajljwP1waXKBfAN5RnIbAXppokgQvnwNRf1eZ7GnqSiwu0eaTHGBatPgr y2v5N19R5WxP2kiN95xdlJEwdUikAhWO1UncDxvXQoM1e68L/J85JSLLIgzuywKpBBtdABEB AAG0MERvdWcgTW9vcmUgKHd3dy5mcmVlYnNkLm9yZykgPGRvdWdtQGZyZWVic2Qub3JnPokB UgQTAQoAPBYhBHleNTGSVgOuQpfeg+iPIVPTudVuBQJcyljBAhsDBQkFo5qAAwsJCAUVCgkI CwUWAwIBAAIeAQIXgAAKCRDojyFT07nVbs4lB/49oHwi3YR7SQr43+59tBudmf3WdQ1SRi3G vJDufsrtsB7E9bIFXwFGvVDOMn/cfhNlzors3aM6UQr1N3TPqMAK4TaS12qGL3EvFQ0eVAF1 J+vhQCIjZtgFaCIjoPeQVbi2tVsHaCttBRJeHRIPruWlxngSGZ7eMfjlOY9Oupi809QjFO/3 7FHv+/Bw9HvzlUciY3wH6vLe4zE3Bhqz4lrQAAKey4XPwKwUgs7QK0qhHrlxy+mD0r8LYvwE +Y7WVu5bbDPbyWYZeI8rnCCKnoJ7VFxQd2/g3Jxc1alDg5LoHCssP7z8g9OG8GBXk1T5dRrA Vxlc8Rs3gSxg6b3+lt+CuQENBFy53VQBCADbHDoIQCMsyFFaNjzqZbrd8ntaMwpQ6hBL7Rnb LJSHa8jehZYyAdtWWbbttyVf66J3EAF6HyBXExw9fryuLU+yZfANI0D3cmmb51jCG6Bu8Nnk QTOf3N7cw1sYQSHH2PQlhWYc55Jbu/aJrwfVnEchLdbN8p2y4WXRLfhK32iOaQzMM2xHNk28 sXnAV5DRxQjvXY7IG7cT5Pfr2uAhXqPDDCZsMj9ghZ3aQyvr7q7jS1uzvSPsimOW4Hf9fJqi VxF2kMRH1hQNe1I4v79SaFtDXRSuYivEPV6epifWATwY66/U/jO55TqqDyFz/Bg+2CCpHyyZ GM9A+f86VxLEGc7hABEBAAGJATwEGAEIACYWIQR5XjUxklYDrkKX3oPojyFT07nVbgUCXLnd VAIbDAUJBaOagAAKCRDojyFT07nVbkhiB/0SVq6YcYwrz1j1lBUk7DCUPVALoNSiW4iNia52 7pWQdHGtsTVVCiEcB65qZo0DSrMsAvtGCRSzUebIQ6omDSDnWmbveXykr3vO0+pcRqsJPQKc ATRq2XjcBjZMKOD4A2XOS2t3hAM+oY4F9htQIY9gnvK6RdTtyafJonHpeeNkMC7KEwPGS6hz FU0lrfZxXQ1ipj0QOOgZ8ZomMXbSV5f8GwYSULMPOVmB9ak0ZCOoa451h0o3Hjcnrngw7ofF JFPbmPT2zbpXOm9PqshzTA10ngIETm2x4j5iVvCHEbOJCH8UQydNKrGFa3UBzqj1OoxAggqh CFx6S9PsRfm6+86cuQENBFy6y/MBCAC+ULdDmJZVs7GFnpBdKJnSnVIbX1dkGju1jkvg+7pA 82yX+0hZvIOh0x3Py8asbfqxFleVws59mGEAe5YpRyg+kn0fd14ethlIrsf0sG82b7QLyf9p xGuQBlhyHvgDgdeUGlz6kybVJ9e59ebtNYgjuEC/Glf/b55pmmkSXx5F/4l82Er7fhpiOg42 n7CLonP+AxLsR8L6AjCODedyKidSopcdH8dH6RTN9CmIYSPQq8vRiARrDLNvVQH4PQlv3s4C KqP6zSN3hMdLlLtvgd6UMdyuWKxRk0y0WhGa4bZ8oKPCo5Dr6o12OSEvx+Ue2QBQ67nVY5H6 SoCoopHHomeRABEBAAGJAtIEGAEKACYWIQR5XjUxklYDrkKX3oPojyFT07nVbgUCXLrL8wIb AgUJBaOagAGgCRDojyFT07nVbsDUIAQZAQoAfRYhBH6QdtAAogUD++RrUKO0e1Y/oUusBQJc usvzXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9wZW5wZ3AuZmlmdGhob3JzZW1h bi5uZXQ3RTkwNzZEMDAwQTIwNTAzRkJFNDZCNTBBM0I0N0I1NjNGQTE0QkFDAAoJEKO0e1Y/ oUusp/AH/0kmG5bylgh6Crg307jXoCQgZvtThaB9LGmf57ypUvnfrwt1n0Ex7cKcQnvSA+12 809K12QmR5D61AdU8HBaQdoLFj0rDi34raxgAY554+YiGuj9XagPEKMeb+iuvqvhetC6v7K8 eXqpaWIozIpFJCmElxGMSngAj/V6nOnm6XDSyfgaOCmnjOQRqe49uU+6R67gb7UB4J+XJHgP Wla91BTqsv3NLcwXINqP+iiHtgMLmrH1j0eNhxOk9+RLNf0YbZcGZHf7eWjcJbWcB13e0gF6 mR0RcQxClm89EVv2p+CPITpXTALrIb1/EX9O4bz9OuzdZk5FrWAUNHStBE6+McJz9Qf9Hs+Z vDizuv8NOX2YZeKRdBpWSsKRL32DkPrup6vMDVL1LIft3SJXLc+oWvy82fAm0HuGMXHq47Zc bvmHUJfnSrdhjHSB35R3BwzYZ4/lINDR90WgKw+NJNErmiIP3oPzlVNtLsQmAXXjAdysFuq6 VSW0TclJVIiBjLgnKvh0XzakzxdZ5pVpgCHzKggO+53lRhEkQIgLTRU0bVb/BQkqa8iGwUhB dGd4Sgy9sykO8/1C8ApYrsT51iG7956YWG14NOBuHXoBsdynCTAVYwSR7+7f3enNKzEpUKtg ALG/tpjXzp8gsOtBSlComvjQjZHfWe9+fLy2wJ98wi8q0n3xHA== Message-ID: Date: Fri, 10 May 2019 23:57:35 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <201905110447.x4B4lqeh031565@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Rspamd-Queue-Id: DA8FA7330F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 04:57:39 -0000 With mentor approval, I commit r347469.=C2=A0 I start getting email about= jenkins failure to build for several architectures on account of the _Generic() construct I introduced in that change. I whip up a patch to undo that part of r347469, and ask for mentor approval.=C2=A0 Meanwhile, mentor authorizes me in email to revert r34746= 9. I try apply applying the fix-patch, and get email that it was rejected for lack of reviewer.=C2=A0 In retrospect, it seems to have been committe= d anyway as r347472. Thinking that things are still broken, I do what my mentor pre-approved earlier and revert back to before r347469.=C2=A0 A patch to redo r347469,= without _Generic(), awaits mentor approval. I realize that breaking the build and then committing without mentor approval in my first week as committer isn't a good beginning.=C2=A0=C2=A0= Sorry about that. At least I have no social media presence, so there's that. Doug Moore On 5/10/19 11:47 PM, Cy Schubert wrote: > In message <201905110213.x4B2Dq9U088622@repo.freebsd.org>, Doug Moore=20 > writes: >> Author: dougm >> Date: Sat May 11 02:13:52 2019 >> New Revision: 347477 >> URL: https://svnweb.freebsd.org/changeset/base/347477 >> >> Log: >> Revert r347469. > Why? > >> =20 >> Approved by: kib (mentor) >> >> Modified: >> head/sys/kern/subr_blist.c >> > From owner-svn-src-all@freebsd.org Sat May 11 09:09:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2690E1596580; Sat, 11 May 2019 09:09:11 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7DAB817A3; Sat, 11 May 2019 09:09:10 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86D321972C; Sat, 11 May 2019 09:09:10 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4B99AS1006390; Sat, 11 May 2019 09:09:10 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4B99A5L006389; Sat, 11 May 2019 09:09:10 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905110909.x4B99A5L006389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 11 May 2019 09:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347484 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7DAB817A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 09:09:11 -0000 Author: dougm Date: Sat May 11 09:09:10 2019 New Revision: 347484 URL: https://svnweb.freebsd.org/changeset/base/347484 Log: When bitpos can't be implemented with an inline ffs* instruction, change the binary search so that it does not depend on a single bit only being set in the bitmask. Use bitpos more generally, and avoid some clearing of bits to accommodate its current behavior. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20237 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Sat May 11 04:18:06 2019 (r347483) +++ head/sys/kern/subr_blist.c Sat May 11 09:09:10 2019 (r347484) @@ -192,30 +192,40 @@ bitrange(int n, int count) /* - * Use binary search, or a faster method, to find the 1 bit in a u_daddr_t. - * Assumes that the argument has only one bit set. + * Find the first bit set in a u_daddr_t. */ static inline int -bitpos(u_daddr_t mask) +generic_bitpos(u_daddr_t mask) { int hi, lo, mid; + lo = 0; + hi = BLIST_BMAP_RADIX; + while (lo + 1 < hi) { + mid = (lo + hi) >> 1; + if (mask & bitrange(0, mid)) + hi = mid; + else + lo = mid; + } + return (lo); +} + +static inline int +bitpos(u_daddr_t mask) +{ + switch (sizeof(mask)) { #ifdef HAVE_INLINE_FFSLL case sizeof(long long): return (ffsll(mask) - 1); #endif +#ifdef HAVE_INLINE_FFS + case sizeof(int): + return (ffs(mask) - 1); +#endif default: - lo = 0; - hi = BLIST_BMAP_RADIX; - while (lo + 1 < hi) { - mid = (lo + hi) >> 1; - if ((mask >> mid) != 0) - lo = mid; - else - hi = mid; - } - return (lo); + return (generic_bitpos(mask)); } } @@ -532,7 +542,8 @@ blist_stats(blist_t bl, struct sbuf *s) struct gap_stats gstats; struct gap_stats *stats = &gstats; daddr_t i, nodes, radix; - u_daddr_t bit, diff, mask; + u_daddr_t diff, mask; + int digit; init_gap_stats(stats); nodes = 0; @@ -570,9 +581,9 @@ blist_stats(blist_t bl, struct sbuf *s) if (gap_stats_counting(stats)) diff ^= 1; while (diff != 0) { - bit = diff & -diff; - update_gap_stats(stats, i + bitpos(bit)); - diff ^= bit; + digit = bitpos(diff); + update_gap_stats(stats, i + digit); + diff ^= bitrange(digit, 1); } } nodes += radix_to_skip(radix); @@ -776,7 +787,7 @@ static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_t count, u_daddr_t radix) { daddr_t blk, i, r, skip; - u_daddr_t bit, mask; + u_daddr_t mask; bool scan_from_start; int digit; @@ -808,8 +819,7 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_ * Examine the nonempty subtree associated with each bit set in mask. */ do { - bit = mask & -mask; - digit = bitpos(bit); + digit = bitpos(mask); i = 1 + digit * skip; if (count <= scan[i].bm_bighint) { /* @@ -819,12 +829,12 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_ count, radix); if (r != SWAPBLK_NONE) { if (scan[i].bm_bitmap == 0) - scan->bm_bitmap ^= bit; + scan->bm_bitmap ^= bitrange(digit, 1); return (r); } } cursor = blk; - } while ((mask ^= bit) != 0); + } while ((mask ^= bitrange(digit, 1)) != 0); /* * We couldn't allocate count in this subtree. If the whole tree was @@ -1019,7 +1029,7 @@ static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab) { daddr_t skip; - u_daddr_t bit, mask; + u_daddr_t mask; int digit; if (radix == BLIST_BMAP_RADIX) { @@ -1051,11 +1061,10 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t mask = scan->bm_bitmap; /* Examine the nonempty subtree associated with each bit set in mask */ do { - bit = mask & -mask; - digit = bitpos(bit); + digit = bitpos(mask); blst_radix_print(&scan[1 + digit * skip], blk + digit * radix, radix, tab); - } while ((mask ^= bit) != 0); + } while ((mask ^= bitrange(digit, 1)) != 0); tab -= 4; printf( From owner-svn-src-all@freebsd.org Sat May 11 09:12:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 674D61596777; Sat, 11 May 2019 09:12:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC2E81BF7; Sat, 11 May 2019 09:12:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDD72198C1; Sat, 11 May 2019 09:12:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4B9CDom010612; Sat, 11 May 2019 09:12:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4B9CDMc010611; Sat, 11 May 2019 09:12:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905110912.x4B9CDMc010611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 11 May 2019 09:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347485 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 347485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0DC2E81BF7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 09:12:14 -0000 Author: kib Date: Sat May 11 09:12:13 2019 New Revision: 347485 URL: https://svnweb.freebsd.org/changeset/base/347485 Log: MFC r347133: arm64: Properly restore PAN when done with userspace access in casueword. Modified: stable/12/sys/arm64/arm64/support.S Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/support.S ============================================================================== --- stable/12/sys/arm64/arm64/support.S Sat May 11 09:09:10 2019 (r347484) +++ stable/12/sys/arm64/arm64/support.S Sat May 11 09:12:13 2019 (r347485) @@ -64,8 +64,8 @@ ENTRY(casueword32) b.ne 2f /* Not equal, exit */ stxr w5, w3, [x0] /* Store the new data */ cbnz w5, 1b /* Retry on failure */ - EXIT_USER_ACCESS(w6) -2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ +2: EXIT_USER_ACCESS(w6) + SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ str w4, [x2] /* Store the read data */ mov x0, #0 /* Success */ ret /* Return */ @@ -86,8 +86,8 @@ ENTRY(casueword) b.ne 2f /* Not equal, exit */ stxr w5, x3, [x0] /* Store the new data */ cbnz w5, 1b /* Retry on failure */ - EXIT_USER_ACCESS(w6) -2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ +2: EXIT_USER_ACCESS(w6) + SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ str x4, [x2] /* Store the read data */ mov x0, #0 /* Success */ ret /* Return */ From owner-svn-src-all@freebsd.org Sat May 11 09:57:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A8521596FF3; Sat, 11 May 2019 09:57:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5EA82F7A; Sat, 11 May 2019 09:57:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B05EF19FD5; Sat, 11 May 2019 09:56:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4B9ux1l032812; Sat, 11 May 2019 09:56:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4B9ux0r032811; Sat, 11 May 2019 09:56:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201905110956.x4B9ux0r032811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 May 2019 09:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347486 - in stable: 11/contrib/llvm/lib/Target/ARM 12/contrib/llvm/lib/Target/ARM X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm/lib/Target/ARM 12/contrib/llvm/lib/Target/ARM X-SVN-Commit-Revision: 347486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A5EA82F7A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 09:57:01 -0000 Author: dim Date: Sat May 11 09:56:59 2019 New Revision: 347486 URL: https://svnweb.freebsd.org/changeset/base/347486 Log: MFC r347243: Pull in r360099 from upstream llvm trunk (by Eli Friedman): [ARM] Glue register copies to tail calls. This generally follows what other targets do. I don't completely understand why the special case for tail calls existed in the first place; even when the code was committed in r105413, call lowering didn't work in the way described in the comments. Stack protector lowering breaks if the register copies are not glued to a tail call: we have to insert the stack protector check before the tail call, and we choose the location based on the assumption that all physical register dependencies of a tail call are adjacent to the tail call. (See FindSplitPointForStackProtector.) This is sort of fragile, but I don't see any reason to break that assumption. I'm guessing nobody has seen this before just because it's hard to convince the scheduler to actually schedule the code in a way that breaks; even without the glue, the only computation that could actually be scheduled after the register copies is the computation of the call address, and the scheduler usually prefers to schedule that before the copies anyway. Fixes https://bugs.llvm.org/show_bug.cgi?id=41417 Differential Revision: https://reviews.llvm.org/D60427 This should fix several instances of "Bad machine code: Using an undefined physical register", when compiling ports such as multimedia/vlc, audio/alsa-lib and devel/avro-c for armv6, with -fstack-protector-strong. Reported by: jbeich PR: 237074, 237783, 237784 Modified: stable/12/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp ============================================================================== --- stable/12/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Sat May 11 09:12:13 2019 (r347485) +++ stable/12/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Sat May 11 09:56:59 2019 (r347486) @@ -1984,32 +1984,10 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLower // Build a sequence of copy-to-reg nodes chained together with token chain // and flag operands which copy the outgoing args into the appropriate regs. SDValue InFlag; - // Tail call byval lowering might overwrite argument registers so in case of - // tail call optimization the copies to registers are lowered later. - if (!isTailCall) - for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) { - Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first, - RegsToPass[i].second, InFlag); - InFlag = Chain.getValue(1); - } - - // For tail calls lower the arguments to the 'real' stack slot. - if (isTailCall) { - // Force all the incoming stack arguments to be loaded from the stack - // before any new outgoing arguments are stored to the stack, because the - // outgoing stack slots may alias the incoming argument stack slots, and - // the alias isn't otherwise explicit. This is slightly more conservative - // than necessary, because it means that each store effectively depends - // on every argument instead of just those arguments it would clobber. - - // Do not flag preceding copytoreg stuff together with the following stuff. - InFlag = SDValue(); - for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) { - Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first, - RegsToPass[i].second, InFlag); - InFlag = Chain.getValue(1); - } - InFlag = SDValue(); + for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) { + Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first, + RegsToPass[i].second, InFlag); + InFlag = Chain.getValue(1); } // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every From owner-svn-src-all@freebsd.org Sat May 11 09:57:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CBBE1596FFC; Sat, 11 May 2019 09:57:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9CA282F7B; Sat, 11 May 2019 09:57:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F3DC19FD6; Sat, 11 May 2019 09:57:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4B9ux6F032818; Sat, 11 May 2019 09:56:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4B9ux2h032817; Sat, 11 May 2019 09:56:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201905110956.x4B9ux2h032817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 May 2019 09:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347486 - in stable: 11/contrib/llvm/lib/Target/ARM 12/contrib/llvm/lib/Target/ARM X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm/lib/Target/ARM 12/contrib/llvm/lib/Target/ARM X-SVN-Commit-Revision: 347486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9CA282F7B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 09:57:02 -0000 Author: dim Date: Sat May 11 09:56:59 2019 New Revision: 347486 URL: https://svnweb.freebsd.org/changeset/base/347486 Log: MFC r347243: Pull in r360099 from upstream llvm trunk (by Eli Friedman): [ARM] Glue register copies to tail calls. This generally follows what other targets do. I don't completely understand why the special case for tail calls existed in the first place; even when the code was committed in r105413, call lowering didn't work in the way described in the comments. Stack protector lowering breaks if the register copies are not glued to a tail call: we have to insert the stack protector check before the tail call, and we choose the location based on the assumption that all physical register dependencies of a tail call are adjacent to the tail call. (See FindSplitPointForStackProtector.) This is sort of fragile, but I don't see any reason to break that assumption. I'm guessing nobody has seen this before just because it's hard to convince the scheduler to actually schedule the code in a way that breaks; even without the glue, the only computation that could actually be scheduled after the register copies is the computation of the call address, and the scheduler usually prefers to schedule that before the copies anyway. Fixes https://bugs.llvm.org/show_bug.cgi?id=41417 Differential Revision: https://reviews.llvm.org/D60427 This should fix several instances of "Bad machine code: Using an undefined physical register", when compiling ports such as multimedia/vlc, audio/alsa-lib and devel/avro-c for armv6, with -fstack-protector-strong. Reported by: jbeich PR: 237074, 237783, 237784 Modified: stable/11/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Sat May 11 09:12:13 2019 (r347485) +++ stable/11/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Sat May 11 09:56:59 2019 (r347486) @@ -1984,32 +1984,10 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLower // Build a sequence of copy-to-reg nodes chained together with token chain // and flag operands which copy the outgoing args into the appropriate regs. SDValue InFlag; - // Tail call byval lowering might overwrite argument registers so in case of - // tail call optimization the copies to registers are lowered later. - if (!isTailCall) - for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) { - Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first, - RegsToPass[i].second, InFlag); - InFlag = Chain.getValue(1); - } - - // For tail calls lower the arguments to the 'real' stack slot. - if (isTailCall) { - // Force all the incoming stack arguments to be loaded from the stack - // before any new outgoing arguments are stored to the stack, because the - // outgoing stack slots may alias the incoming argument stack slots, and - // the alias isn't otherwise explicit. This is slightly more conservative - // than necessary, because it means that each store effectively depends - // on every argument instead of just those arguments it would clobber. - - // Do not flag preceding copytoreg stuff together with the following stuff. - InFlag = SDValue(); - for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) { - Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first, - RegsToPass[i].second, InFlag); - InFlag = Chain.getValue(1); - } - InFlag = SDValue(); + for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) { + Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first, + RegsToPass[i].second, InFlag); + InFlag = Chain.getValue(1); } // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every From owner-svn-src-all@freebsd.org Sat May 11 10:16:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B39BD15979B5; Sat, 11 May 2019 10:16:44 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD0F83C5C; Sat, 11 May 2019 10:16:44 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2451B1A319; Sat, 11 May 2019 10:16:44 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BAGh9k043253; Sat, 11 May 2019 10:16:43 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BAGheU043252; Sat, 11 May 2019 10:16:43 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905111016.x4BAGheU043252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 11 May 2019 10:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347487 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 347487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4CD0F83C5C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 10:16:44 -0000 Author: dougm Date: Sat May 11 10:16:43 2019 New Revision: 347487 URL: https://svnweb.freebsd.org/changeset/base/347487 Log: Callers of swp_pager_getswapspace get either as many blocks as they requested, or none, and in the latter case it is up to them to pick a smaller request to make - which they always do by halving the failed request. This change to swp_pager_getswapspace leaves the task of downsizing the request to the function and not its caller. It still does so by halving the original request. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20228 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sat May 11 09:56:59 2019 (r347486) +++ head/sys/vm/swap_pager.c Sat May 11 10:16:43 2019 (r347487) @@ -407,7 +407,7 @@ static int swapoff_one(struct swdevt *sp, struct ucred * Swap bitmap functions */ static void swp_pager_freeswapspace(daddr_t blk, daddr_t npages); -static daddr_t swp_pager_getswapspace(int npages); +static daddr_t swp_pager_getswapspace(int *npages, int limit); /* * Metadata functions @@ -708,9 +708,10 @@ swap_pager_dealloc(vm_object_t object) /* * SWP_PAGER_GETSWAPSPACE() - allocate raw swap space * - * Allocate swap for the requested number of pages. The starting - * swap block number (a page index) is returned or SWAPBLK_NONE - * if the allocation failed. + * Allocate swap for up to the requested number of pages, and at + * least a minimum number of pages. The starting swap block number + * (a page index) is returned or SWAPBLK_NONE if the allocation + * failed. * * Also has the side effect of advising that somebody made a mistake * when they configured swap and didn't configure enough. @@ -720,38 +721,46 @@ swap_pager_dealloc(vm_object_t object) * We allocate in round-robin fashion from the configured devices. */ static daddr_t -swp_pager_getswapspace(int npages) +swp_pager_getswapspace(int *io_npages, int limit) { daddr_t blk; struct swdevt *sp; - int i; + int npages; blk = SWAPBLK_NONE; + npages = *io_npages; mtx_lock(&sw_dev_mtx); sp = swdevhd; - for (i = 0; i < nswapdev; i++) { + while (!TAILQ_EMPTY(&swtailq)) { if (sp == NULL) sp = TAILQ_FIRST(&swtailq); - if (!(sp->sw_flags & SW_CLOSING)) { + if ((sp->sw_flags & SW_CLOSING) == 0) blk = blist_alloc(sp->sw_blist, npages); - if (blk != SWAPBLK_NONE) { - blk += sp->sw_first; - sp->sw_used += npages; - swap_pager_avail -= npages; - swp_sizecheck(); - swdevhd = TAILQ_NEXT(sp, sw_list); - goto done; - } - } + if (blk != SWAPBLK_NONE) + break; sp = TAILQ_NEXT(sp, sw_list); + if (swdevhd == sp) { + if (npages <= limit) + break; + npages >>= 1; + } } - if (swap_pager_full != 2) { - printf("swap_pager_getswapspace(%d): failed\n", npages); - swap_pager_full = 2; - swap_pager_almost_full = 1; + if (blk != SWAPBLK_NONE) { + *io_npages = npages; + blk += sp->sw_first; + sp->sw_used += npages; + swap_pager_avail -= npages; + swp_sizecheck(); + swdevhd = TAILQ_NEXT(sp, sw_list); + } else { + if (swap_pager_full != 2) { + printf("swp_pager_getswapspace(%d): failed\n", + *io_npages); + swap_pager_full = 2; + swap_pager_almost_full = 1; + } + swdevhd = NULL; } - swdevhd = NULL; -done: mtx_unlock(&sw_dev_mtx); return (blk); } @@ -886,35 +895,28 @@ swap_pager_freespace(vm_object_t object, vm_pindex_t s int swap_pager_reserve(vm_object_t object, vm_pindex_t start, vm_size_t size) { - int n = 0; - daddr_t blk = SWAPBLK_NONE; - vm_pindex_t beg = start; /* save start index */ - daddr_t addr, n_free, s_free; + daddr_t addr, blk, n_free, s_free; + int i, j, n; swp_pager_init_freerange(&s_free, &n_free); VM_OBJECT_WLOCK(object); - while (size) { - if (n == 0) { - n = BLIST_MAX_ALLOC; - while ((blk = swp_pager_getswapspace(n)) == SWAPBLK_NONE) { - n >>= 1; - if (n == 0) { - swp_pager_meta_free(object, beg, start - beg); - VM_OBJECT_WUNLOCK(object); - return (-1); - } - } + for (i = 0; i < size; i += n) { + n = min(BLIST_MAX_ALLOC, size - i); + blk = swp_pager_getswapspace(&n, 1); + if (blk == SWAPBLK_NONE) { + swp_pager_meta_free(object, start, i); + VM_OBJECT_WUNLOCK(object); + return (-1); } - addr = swp_pager_meta_build(object, start, blk); - if (addr != SWAPBLK_NONE) - swp_pager_update_freerange(&s_free, &n_free, addr); - --size; - ++start; - ++blk; - --n; + for (j = 0; j < n; ++j) { + addr = swp_pager_meta_build(object, + start + i + j, blk + j); + if (addr != SWAPBLK_NONE) + swp_pager_update_freerange(&s_free, &n_free, + addr); + } } swp_pager_freeswapspace(s_free, n_free); - swp_pager_meta_free(object, start, n); VM_OBJECT_WUNLOCK(object); return (0); } @@ -1384,18 +1386,8 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, n = min(BLIST_MAX_ALLOC, count - i); n = min(n, nsw_cluster_max); - /* - * Get biggest block of swap we can. If we fail, fall - * back and try to allocate a smaller block. Don't go - * overboard trying to allocate space if it would overly - * fragment swap. - */ - while ( - (blk = swp_pager_getswapspace(n)) == SWAPBLK_NONE && - n > 4 - ) { - n >>= 1; - } + /* Get a block of swap of size up to size n. */ + blk = swp_pager_getswapspace(&n, 4); if (blk == SWAPBLK_NONE) { for (j = 0; j < n; ++j) rtvals[i+j] = VM_PAGER_FAIL; From owner-svn-src-all@freebsd.org Sat May 11 10:52:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C40D9159835D; Sat, 11 May 2019 10:52:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 34F3484CF9; Sat, 11 May 2019 10:52:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 1B2D82ACDFF; Sat, 11 May 2019 20:52:46 +1000 (AEST) Date: Sat, 11 May 2019 20:52:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Doug Moore cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347484 - head/sys/kern In-Reply-To: <201905110909.x4B99A5L006389@repo.freebsd.org> Message-ID: <20190511202741.H1251@besplex.bde.org> References: <201905110909.x4B99A5L006389@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=nAMujBBYrrxrG9Oy4M0A:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 34F3484CF9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 10:52:56 -0000 On Sat, 11 May 2019, Doug Moore wrote: > Log: > When bitpos can't be implemented with an inline ffs* instruction, > change the binary search so that it does not depend on a single bit > only being set in the bitmask. Use bitpos more generally, and avoid > some clearing of bits to accommodate its current behavior. Inline ffs*() is badly implemented in general (it is mostly not implemented in the kernel). This makes it almost useless here, and (non-inline) ffs*() (not used here) often slower than direct methods. > Modified: head/sys/kern/subr_blist.c > ============================================================================== > --- head/sys/kern/subr_blist.c Sat May 11 04:18:06 2019 (r347483) > +++ head/sys/kern/subr_blist.c Sat May 11 09:09:10 2019 (r347484) > ... > +static inline int > +bitpos(u_daddr_t mask) > +{ > + > switch (sizeof(mask)) { > #ifdef HAVE_INLINE_FFSLL > case sizeof(long long): > return (ffsll(mask) - 1); > #endif This uses the long long abomination. Only amd64 has inline ffsll(). > +#ifdef HAVE_INLINE_FFS > + case sizeof(int): > + return (ffs(mask) - 1); > +#endif This is unreachable, since sizeof(int) is 4 on all supported arches, and sizeof(mask) is 8 on all arches. > default: > - lo = 0; > - hi = BLIST_BMAP_RADIX; > - while (lo + 1 < hi) { > - mid = (lo + hi) >> 1; > - if ((mask >> mid) != 0) > - lo = mid; > - else > - hi = mid; > - } > - return (lo); > + return (generic_bitpos(mask)); > } > } So the default cause is used except on amd64. I think the direct code for it is not as slow as the generic (libkern) ffs*(), except the generic ffs*() is simpler so the compiler might inline it internals to __builtin_ffs*(). Not that -ffreestanding prevents inlining extern ffs*(). Since 64/8 is 2 times 4 and sizeof(int) >= 4 in POSIX, it is trivial to implement ffs64() using 2 inline ffs()'s, and that is exactly what clang does on i386 to implement __builtin_ffsl(). Unfortunately, most arches also don't implement inline ffs(). Only amd64, i386 and sparc64 implement it. subr_blist.c is also complilable outside of the kernel. I don't like that. The kernel macros HAVE_INLINE_* don't exist outside of the kernel, but ffs*() would work better outside of the kernel if it is used blindly since inlining of it isn't prevented by -ffreestanding. Bruce From owner-svn-src-all@freebsd.org Sat May 11 13:37:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E9FF159D1B1; Sat, 11 May 2019 13:37:15 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14EBC89548; Sat, 11 May 2019 13:37:15 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id E99FF270011C; Sat, 11 May 2019 09:37:12 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu E99FF270011C DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1557581833; bh=XYUbn0nOP44CforZOd+hXJQz8deMnG506SxVvDM9++8=; h=Subject:To:From:Date:From; b=j+am2b8ovUmEfRHiqbEM6FVg6DWA+ZW6FQiLUNBX9g2bu54p+rp1vy6Rj5uy0bmrI q9enkRcxVc/aqFlE5bSaabKF+uQydcomyuwXbzz/3DL4/JPxrpUPM4CnnR7YQ/CVF4 6cN0IUXHf9/cUe/fnOHJztriTQoJLQGlt0WNoVuVTQgmPUdF4WP7Y0jdDWqGnlQZJo ROo0ekWIVzgOO3z+F0k7Bp2eueS+pgDUvN88FHvcKVW1+P2PLEBI2Gi3BGMNY7GN40 QPNnS1fpva5zd0q9BaDqJrQ5QshQ+IL2hr+ewaCaI2rNacMer4q5HC8XO/woOEvBnK GRPslhlby6wgQ== Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf To: Kristof Provost Cc: Slawa Olhovchenkov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905092238.x49McFCO015665@repo.freebsd.org> <20190510124458.GB65054@zxy.spb.ru> <0842eef5-5f1f-c25a-a470-a424c536f1ed@cs.duke.edu> <3884905F-0593-496D-8BAD-67C468C92AF2@FreeBSD.org> From: Andrew Gallatin Message-ID: <0c6911b6-6fa0-74cd-8999-c628bc3b2a9d@cs.duke.edu> Date: Sat, 11 May 2019 09:37:12 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <3884905F-0593-496D-8BAD-67C468C92AF2@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14EBC89548 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.82 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.82)[-0.821,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 13:37:15 -0000 On 2019-05-10 11:50, Kristof Provost wrote: > On 10 May 2019, at 8:31, Andrew Gallatin wrote: > > On 2019-05-10 08:44, Slawa Olhovchenkov wrote: > > pf have ifdef for IPSEC, but don't have support IPSEC_SUPPORT > (netpfil/pf/if_pfsync.c). > > Thanks for pointing this out. It seems like IPSEC_SUPPORT would work > for this. I've made a patch, and it compiles and the pf module loads. > However, I have no knowledge of how to test it. Is this something > that you use, and which you can test? > > I suspect this code has not actually been enabled for a long time. > gettdb() doesn’t actually appear to be defined anywhere, so I wouldn’t > expect it to ever compile. > > gettdb() does exist in OpenBSD, so my current guess is that this is just > an import artefact, and we should |#ifdef OPENBSD| it or something, or > just remove it completely. > > For completeness, and because I never shut up about this: to test pf > |kldload pfsync|, |cd /usr/tests/sys/netpfil/pf| and |sudo kyua test| > > There’s more information in the current edition of the FreeBSD journal. > > Regards, > Kristof > Thanks, you are correct. Including options_ipsec.h reveals that the code does not even compile (cannot find gettdb(), which does not appear to be defined anywhere in our tree). Given that it is dead code, I'd rather just not touch it. Drew From owner-svn-src-all@freebsd.org Sat May 11 14:22:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3D32159E07B; Sat, 11 May 2019 14:22:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65A808AA45; Sat, 11 May 2019 14:22:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53C6F1CCBA; Sat, 11 May 2019 14:22:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BEMM8q074843; Sat, 11 May 2019 14:22:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BEMMLM074842; Sat, 11 May 2019 14:22:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905111422.x4BEMMLM074842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 11 May 2019 14:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347488 - head/usr.sbin/ntp/ntpd X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 347488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65A808AA45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 14:22:23 -0000 Author: delphij Date: Sat May 11 14:22:21 2019 New Revision: 347488 URL: https://svnweb.freebsd.org/changeset/base/347488 Log: Update leap-seconds to leap-seconds.3757622400. As per https://datacenter.iers.org/data/latestVersion/16_BULLETIN_C16.txt: INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS) SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE SERVICE DE LA ROTATION TERRESTRE DE L'IERS OBSERVATOIRE DE PARIS 61, Av. de l'Observatoire 75014 PARIS (France) Tel. : +33 1 40 51 23 35 e-mail : services.iers@obspm.fr http://hpiers.obspm.fr/eop-pc Paris, 07 January 2019 Bulletin C 57 To authorities responsible for the measurement and distribution of time INFORMATION ON UTC - TAI NO leap second will be introduced at the end of June 2019. The difference between Coordinated Universal Time UTC and the International Atomic Time TAI is : from 2017 January 1, 0h UTC, until further notice : UTC-TAI = -37 s Leap seconds can be introduced in UTC at the end of the months of December or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every six months, either to announce a time step in UTC, or to confirm that there will be no time step at the next possible date. Christian BIZOUARD Director Earth Orientation Center of IERS Observatoire de Paris, France Requested by: rgrimes Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3757622400 MFC after: 3 days Modified: head/usr.sbin/ntp/ntpd/leap-seconds Modified: head/usr.sbin/ntp/ntpd/leap-seconds ============================================================================== --- head/usr.sbin/ntp/ntpd/leap-seconds Sat May 11 10:16:43 2019 (r347487) +++ head/usr.sbin/ntp/ntpd/leap-seconds Sat May 11 14:22:21 2019 (r347488) @@ -1,10 +1,10 @@ # # In the following text, the symbol '#' introduces -# a comment, which continues from that symbol until +# a comment, which continues from that symbol until # the end of the line. A plain comment line has a # whitespace character following the comment indicator. -# There are also special comment lines defined below. -# A special comment will always have a non-whitespace +# There are also special comment lines defined below. +# A special comment will always have a non-whitespace # character in column 2. # # A blank line should be ignored. @@ -15,22 +15,17 @@ # are transmitted by almost all time services. # # The first column shows an epoch as a number of seconds -# since 1 January 1900, 00:00:00 (1900.0 is also used to -# indicate the same epoch.) Both of these time stamp formats -# ignore the complexities of the time scales that were -# used before the current definition of UTC at the start -# of 1972. (See note 3 below.) -# The second column shows the number of seconds that -# must be added to UTC to compute TAI for any timestamp -# at or after that epoch. The value on each line is -# valid from the indicated initial instant until the -# epoch given on the next one or indefinitely into the -# future if there is no next line. +# since 1900.0 and the second column shows the number of +# seconds that must be added to UTC to compute TAI for +# any timestamp at or after that epoch. The value on +# each line is valid from the indicated initial instant +# until the epoch given on the next one or indefinitely +# into the future if there is no next line. # (The comment on each line shows the representation of -# the corresponding initial epoch in the usual +# the corresponding initial epoch in the usual # day-month-year format. The epoch always begins at # 00:00:00 UTC on the indicated day. See Note 5 below.) -# +# # Important notes: # # 1. Coordinated Universal Time (UTC) is often referred to @@ -38,7 +33,7 @@ # longer used, and the use of GMT to designate UTC is # discouraged. # -# 2. The UTC time scale is realized by many national +# 2. The UTC time scale is realized by many national # laboratories and timing centers. Each laboratory # identifies its realization with its name: Thus # UTC(NIST), UTC(USNO), etc. The differences among @@ -47,12 +42,12 @@ # and can be ignored for many purposes. These differences # are tabulated in Circular T, which is published monthly # by the International Bureau of Weights and Measures -# (BIPM). See www.bipm.org for more information. +# (BIPM). See www.bipm.fr for more information. # -# 3. The current definition of the relationship between UTC -# and TAI dates from 1 January 1972. A number of different -# time scales were in use before that epoch, and it can be -# quite difficult to compute precise timestamps and time +# 3. The current defintion of the relationship between UTC +# and TAI dates from 1 January 1972. A number of different +# time scales were in use before than epoch, and it can be +# quite difficult to compute precise timestamps and time # intervals in those "prehistoric" days. For more information, # consult: # @@ -63,34 +58,36 @@ # of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, # July, 1991. # -# 4. The decision to insert a leap second into UTC is currently -# the responsibility of the International Earth Rotation and -# Reference Systems Service. (The name was changed from the -# International Earth Rotation Service, but the acronym IERS -# is still used.) +# 4. The insertion of leap seconds into UTC is currently the +# responsibility of the International Earth Rotation Service, +# which is located at the Paris Observatory: # -# Leap seconds are announced by the IERS in its Bulletin C. +# Central Bureau of IERS +# 61, Avenue de l'Observatoire +# 75014 Paris, France. # -# See www.iers.org for more details. +# Leap seconds are announced by the IERS in its Bulletin C # -# Every national laboratory and timing center uses the -# data from the BIPM and the IERS to construct UTC(lab), -# their local realization of UTC. +# See hpiers.obspm.fr or www.iers.org for more details. # +# All national laboratories and timing centers use the +# data from the BIPM and the IERS to construct their +# local realizations of UTC. +# # Although the definition also includes the possibility -# of dropping seconds ("negative" leap seconds), this has -# never been done and is unlikely to be necessary in the +# of dropping seconds ("negative" leap seconds), this has +# never been done and is unlikely to be necessary in the # foreseeable future. # # 5. If your system keeps time as the number of seconds since # some epoch (e.g., NTP timestamps), then the algorithm for # assigning a UTC time stamp to an event that happens during a positive -# leap second is not well defined. The official name of that leap -# second is 23:59:60, but there is no way of representing that time -# in these systems. -# Many systems of this type effectively stop the system clock for -# one second during the leap second and use a time that is equivalent -# to 23:59:59 UTC twice. For these systems, the corresponding TAI +# leap second is not well defined. The official name of that leap +# second is 23:59:60, but there is no way of representing that time +# in these systems. +# Many systems of this type effectively stop the system clock for +# one second during the leap second and use a time that is equivalent +# to 23:59:59 UTC twice. For these systems, the corresponding TAI # timestamp would be obtained by advancing to the next entry in the # following table when the time equivalent to 23:59:59 UTC # is used for the second time. Thus the leap second which @@ -105,7 +102,7 @@ # # If your system realizes the leap second by repeating 00:00:00 UTC twice # (this is possible but not usual), then the advance to the next entry -# in the table must occur the second time that a time equivalent to +# in the table must occur the second time that a time equivlent to # 00:00:00 UTC is used. Thus, using the same example as above: # # ... @@ -115,94 +112,66 @@ # ... # # in both cases the use of timestamps based on TAI produces a smooth -# time scale with no discontinuity in the time interval. However, -# although the long-term behavior of the time scale is correct in both -# methods, the second method is technically not correct because it adds -# the extra second to the wrong day. +# time scale with no discontinuity in the time interval. # -# This complexity would not be needed for negative leap seconds (if they -# are ever used). The UTC time would skip 23:59:59 and advance from -# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by -# 1 second at the same instant. This is a much easier situation to deal -# with, since the difficulty of unambiguously representing the epoch +# This complexity would not be needed for negative leap seconds (if they +# are ever used). The UTC time would skip 23:59:59 and advance from +# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by +# 1 second at the same instant. This is a much easier situation to deal +# with, since the difficulty of unambiguously representing the epoch # during the leap second does not arise. # -# Some systems implement leap seconds by amortizing the leap second -# over the last few minutes of the day. The frequency of the local -# clock is decreased (or increased) to realize the positive (or -# negative) leap second. This method removes the time step described -# above. Although the long-term behavior of the time scale is correct -# in this case, this method introduces an error during the adjustment -# period both in time and in frequency with respect to the official -# definition of UTC. -# # Questions or comments to: -# Judah Levine -# Time and Frequency Division -# NIST -# Boulder, Colorado -# Judah.Levine@nist.gov +# Jeff Prillaman +# Time Service Department +# US Naval Observatory +# Washington, DC +# jeff.k.prillaman@navy.mil # -# Last Update of leap second values: 8 July 2016 +# Last Update of leap second values: 28 Jan 2019 # -# The following line shows this last update date in NTP timestamp +# The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to # the leap second data was added to the file. This line can -# be identified by the unique pair of characters in the first two +# be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3676924800 +#$ 3757622400 # -# The NTP timestamps are in units of seconds since the NTP epoch, -# which is 1 January 1900, 00:00:00. The Modified Julian Day number -# corresponding to the NTP time stamp, X, can be computed as -# -# X/86400 + 15020 -# -# where the first term converts seconds to days and the second -# term adds the MJD corresponding to the time origin defined above. -# The integer portion of the result is the integer MJD for that -# day, and any remainder is the time of day, expressed as the -# fraction of the day since 0 hours UTC. The conversion from day -# fraction to seconds or to hours, minutes, and seconds may involve -# rounding or truncation, depending on the method used in the -# computation. -# -# The data in this file will be updated periodically as new leap +# The data in this file will be updated periodically as new leap # seconds are announced. In addition to being entered on the line -# above, the update time (in NTP format) will be added to the basic +# above, the update time (in NTP format) will be added to the basic # file name leap-seconds to form the name leap-seconds.. -# In addition, the generic name leap-seconds.list will always point to +# In addition, the generic name leap-seconds.list will always point to # the most recent version of the file. # # This update procedure will be performed only when a new leap second -# is announced. +# is announced. # # The following entry specifies the expiration date of the data -# in this file in units of seconds since the origin at the instant -# 1 January 1900, 00:00:00. This expiration date will be changed -# at least twice per year whether or not a new leap second is -# announced. These semi-annual changes will be made no later -# than 1 June and 1 December of each year to indicate what -# action (if any) is to be taken on 30 June and 31 December, +# in this file in units of seconds since 1900.0. This expiration date +# will be changed at least twice per year whether or not a new leap +# second is announced. These semi-annual changes will be made no +# later than 1 June and 1 December of each year to indicate what +# action (if any) is to be taken on 30 June and 31 December, # respectively. (These are the customary effective dates for new # leap seconds.) This expiration date will be identified by a # unique pair of characters in columns 1 and 2 as shown below. -# In the unlikely event that a leap second is announced with an +# In the unlikely event that a leap second is announced with an # effective date other than 30 June or 31 December, then this # file will be edited to include that leap second as soon as it is # announced or at least one month before the effective date -# (whichever is later). -# If an announcement by the IERS specifies that no leap second is -# scheduled, then only the expiration date of the file will +# (whichever is later). +# If an announcement by the IERS specifies that no leap second is +# scheduled, then only the expiration date of the file will # be advanced to show that the information in the file is still -# current -- the update time stamp, the data and the name of the file +# current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C53 -# File expires on: 28 December 2017 +# Updated through IERS Bulletin C 57 +# File expires on: 1 Dec 2019 # -#@ 3723408000 +#@ 3784147200 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -236,15 +205,16 @@ # the following special comment contains the # hash value of the data in this file computed # use the secure hash algorithm as specified -# by FIPS 180-1. See the files in ~/pub/sha for +# by FIPS 180-1. See the files in ~/sha for # the details of how this hash value is # computed. Note that the hash computation # ignores comments and whitespace characters # in data lines. It includes the NTP values -# of both the last modification time and the +# of both the last modification time and the # expiration time of the file, but not the # white space on those lines. # the hash line is also ignored in the # computation. # -#h 62cf8c5d 8bbb6dcc c61e3b56 c308343 869bb80d +#h 630ac741 2fffdd6b 858a7d1d 31d4802f 6382e10c +# From owner-svn-src-all@freebsd.org Sat May 11 14:45:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A35DC159EF58 for ; Sat, 11 May 2019 14:45:23 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21A4C8B7B7 for ; Sat, 11 May 2019 14:45:22 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1557585913; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=bSquJz+7JfmvVY1X/4meL2iaqRCh6a6tM3RH0mcC0pXH3qCpVqHtDkEqYSG6TLl0aAqSnpI+GTB2c L4iG6xL2LkNPcK3CAseEaoNBWbrNKkbAgTnHCbZM1+RnN1I6UrbmbzJhZ7iEpwDNS9hLV9iAiDjCJo X5aK8dhZMyz3m0F+pIu4tqyxwaIC2iomF2FQaafOLcLm2MXDa2VryNsIiTZ30/j0JskUe0HtK1t2kA rG+cocGKVVtSN1pIAOiu3abwLN4t38A+EnfLXzFfkspB7Z/GUARO1OWR2/b80I5MIne6C7SZIZHsjT Sli2tjDQV+X8zp3i7ZsAQQLyxMmpsQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=fRGwvz4oLq743QGqvXY2PT8tDUouh0XN1g63/lmM4+U=; b=elGTjj7J5979rTzezAPghccLAuGF45GwzhI7/ECns/V3lhqpnJrT2lpzyySPAs5TUQxE66Lc9qXrr sPQ4ibMbmxSrVtT1/ILySVVXIzUT326DpI05JaXXtWYh8juD76bqm0l11qsTLlFckc8569I31OSWWw GvkwY/4wbg2qVPyviKg8Y5LqS+L1vI6j7zt1+ljRlc9LwYUj5Hx5BcUi0w427I+OH8D6GfrWGkq/Ft kZbTuBLXrvJKM8c7qbjxsyhCw0TsvAYllWjjPDcwaAgcLvTxYh9SyJt8/FdJ8QAdYJ5XS4hvv1/C8K tuFKa9L7Xl7aD080Lexl7EDF42KbmFA== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=fRGwvz4oLq743QGqvXY2PT8tDUouh0XN1g63/lmM4+U=; b=oxvm1UCJewkxYLcT+22asJyJPUoyt+meMHam/+iP2U9mbGktNl7ZUqIb6Vuhz/kOoQ0nXCCYl6I7l QRNfEiDpq0T7Ru6pktyPoJaVhc19RnErTPBV/lA0wIb6A+JBFZOTbfJV+iGHVeDsrcAqhTK4pmk2Xh bmmujqjPbm8KZt2pxyrj3dp3NEbOz+o3g5162rMTYLYeeTb4BT1AHoYa1vNlod/83ovtnpRKR1NLbL UAjVVg+dnUrVYA2ulhAHDvm/e6JX/NfB/tF3hHoio+fXm9Jc6KuBmd6Vz3Vw+mHx4YHK6/il7kREVy J3czjEz1qInGb3jtplpU4ujyc+bjkKQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: 5e6378b8-73fb-11e9-803c-31925da7267c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id 5e6378b8-73fb-11e9-803c-31925da7267c; Sat, 11 May 2019 14:45:10 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x4BEj6Bf054991; Sat, 11 May 2019 08:45:06 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <82d76aafd3c93bc2ad2d0e04a761e2628ff1e257.camel@freebsd.org> Subject: Re: svn commit: r347477 - head/sys/kern From: Ian Lepore To: Doug Moore , Cy Schubert , Doug Moore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 11 May 2019 08:45:06 -0600 In-Reply-To: References: <201905110447.x4B4lqeh031565@slippy.cwsent.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 21A4C8B7B7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 14:45:23 -0000 On Fri, 2019-05-10 at 23:57 -0500, Doug Moore wrote: > With mentor approval, I commit r347469. I start getting email about > jenkins failure to build for several architectures on account of the > _Generic() construct I introduced in that change. > > I whip up a patch to undo that part of r347469, and ask for mentor > approval. Meanwhile, mentor authorizes me in email to revert > r347469. > > I try apply applying the fix-patch, and get email that it was > rejected > for lack of reviewer. In retrospect, it seems to have been committed > anyway as r347472. > > Thinking that things are still broken, I do what my mentor pre- > approved > earlier and revert back to before r347469. A patch to redo r347469, > without _Generic(), awaits mentor approval. > > I realize that breaking the build and then committing without mentor > approval in my first week as committer isn't a good beginning. > Sorry > about that. > > At least I have no social media presence, so there's that. > > Doug Moore > > The important point is that the commit message should have said why. It doesn't have to be a whole novel, just something like "because _Generic() isn't supported on all platforms" would've been good. In general, for every commit, I ask myself "If someone 3 years from now is debugging a problem and they're looking at the changes that have happened to this code over time, will my commit message be helpful to that process?" Very often in that situation, what the person needs to know isn't "what changed" so much as "why did this change happen?" -- Ian > On 5/10/19 11:47 PM, Cy Schubert wrote: > > In message <201905110213.x4B2Dq9U088622@repo.freebsd.org>, Doug > > Moore > > writes: > > > Author: dougm > > > Date: Sat May 11 02:13:52 2019 > > > New Revision: 347477 > > > URL: https://svnweb.freebsd.org/changeset/base/347477 > > > > > > Log: > > > Revert r347469. > > > > Why? > > > > > > > > Approved by: kib (mentor) > > > > > > Modified: > > > head/sys/kern/subr_blist.c > > > > > > From owner-svn-src-all@freebsd.org Sat May 11 15:02:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82E61159F7B6; Sat, 11 May 2019 15:02:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2991D8C144; Sat, 11 May 2019 15:02:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC34A1D354; Sat, 11 May 2019 15:02:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BF2KOS095547; Sat, 11 May 2019 15:02:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BF2Kbh095546; Sat, 11 May 2019 15:02:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905111502.x4BF2Kbh095546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 11 May 2019 15:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347489 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 347489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2991D8C144 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 15:02:21 -0000 Author: manu Date: Sat May 11 15:02:20 2019 New Revision: 347489 URL: https://svnweb.freebsd.org/changeset/base/347489 Log: allwinner: clk: prediv_mux: Init the current parent Do not init the first parent but read the clock register to find it's current parent and init this one. Modified: head/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c Modified: head/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c Sat May 11 14:22:21 2019 (r347488) +++ head/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c Sat May 11 15:02:20 2019 (r347489) @@ -75,7 +75,19 @@ struct aw_clk_prediv_mux_sc { static int aw_clk_prediv_mux_init(struct clknode *clk, device_t dev) { - clknode_init_parent_idx(clk, 0); + struct aw_clk_prediv_mux_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + DEVICE_UNLOCK(clk); + + /* Init the current parent */ + val = (val & sc->mux_mask) >> sc->mux_shift; + clknode_init_parent_idx(clk, val); + return (0); } From owner-svn-src-all@freebsd.org Sat May 11 15:02:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BE41159F80B; Sat, 11 May 2019 15:02:56 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C85318C29C; Sat, 11 May 2019 15:02:55 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A308F1D369; Sat, 11 May 2019 15:02:55 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BF2tJg096419; Sat, 11 May 2019 15:02:55 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BF2toX096418; Sat, 11 May 2019 15:02:55 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905111502.x4BF2toX096418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 11 May 2019 15:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347490 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 347490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C85318C29C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 15:02:56 -0000 Author: manu Date: Sat May 11 15:02:55 2019 New Revision: 347490 URL: https://svnweb.freebsd.org/changeset/base/347490 Log: allwinner: clk: sun8i_r: Correct resets The i2c reset wasn't defined and some bits where wrong, correct them. Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Sat May 11 15:02:20 2019 (r347489) +++ head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Sat May 11 15:02:55 2019 (r347490) @@ -63,8 +63,9 @@ __FBSDID("$FreeBSD$"); static struct aw_ccung_reset ccu_sun8i_r_resets[] = { CCU_RESET(RST_APB0_IR, 0xb0, 1) CCU_RESET(RST_APB0_TIMER, 0xb0, 2) - CCU_RESET(RST_APB0_RSB, 0xb0, 4) - CCU_RESET(RST_APB0_UART, 0xb0, 6) + CCU_RESET(RST_APB0_RSB, 0xb0, 3) + CCU_RESET(RST_APB0_UART, 0xb0, 4) + CCU_RESET(RST_APB0_I2C, 0xb0, 6) }; static struct aw_ccung_gate ccu_sun8i_r_gates[] = { From owner-svn-src-all@freebsd.org Sat May 11 15:03:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A0FB159F89A; Sat, 11 May 2019 15:03:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4F228C3ED; Sat, 11 May 2019 15:03:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC2871D36A; Sat, 11 May 2019 15:03:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BF3ppA096498; Sat, 11 May 2019 15:03:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BF3pij096497; Sat, 11 May 2019 15:03:51 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905111503.x4BF3pij096497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 11 May 2019 15:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347491 - head/sys/dev/iicbus/twsi X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/iicbus/twsi X-SVN-Commit-Revision: 347491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E4F228C3ED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 15:03:52 -0000 Author: manu Date: Sat May 11 15:03:51 2019 New Revision: 347491 URL: https://svnweb.freebsd.org/changeset/base/347491 Log: twsi: Calculate the clock param based on the bus frequency Instead of precalculating the different speed, respect the bus frequency and calculate the clock register parameter based on it. If the platform didn't register the core clk, fallback on the precomputed values (This is likely do be the case on Marvell boards). Modified: head/sys/dev/iicbus/twsi/a10_twsi.c head/sys/dev/iicbus/twsi/twsi.c Modified: head/sys/dev/iicbus/twsi/a10_twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/a10_twsi.c Sat May 11 15:02:55 2019 (r347490) +++ head/sys/dev/iicbus/twsi/a10_twsi.c Sat May 11 15:03:51 2019 (r347491) @@ -87,9 +87,7 @@ static int a10_twsi_attach(device_t dev) { struct twsi_softc *sc; - clk_t clk; hwreset_t rst; - uint64_t freq; int error; sc = device_get_softc(dev); @@ -104,12 +102,12 @@ a10_twsi_attach(device_t dev) } /* Activate clock */ - error = clk_get_by_ofw_index(dev, 0, 0, &clk); + error = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_core); if (error != 0) { device_printf(dev, "could not find clock\n"); return (error); } - error = clk_enable(clk); + error = clk_enable(sc->clk_core); if (error != 0) { device_printf(dev, "could not enable clock\n"); return (error); @@ -122,31 +120,6 @@ a10_twsi_attach(device_t dev) sc->reg_status = TWI_STAT; sc->reg_baud_rate = TWI_CCR; sc->reg_soft_reset = TWI_SRST; - - /* Setup baud rate params */ - clk_get_freq(clk, &freq); - switch (freq) { - /* - * Formula is - * F0 = FINT / 2 ^ CLK_N - * F1 = F0 / (CLK_M + 1) - * - * Doc says that the output freq is F1/10 but my logic analyzer says otherwise - */ - case 48000000: - sc->baud_rate[IIC_SLOW].param = TWSI_BAUD_RATE_PARAM(11, 1); - sc->baud_rate[IIC_FAST].param = TWSI_BAUD_RATE_PARAM(11, 1); - sc->baud_rate[IIC_FASTEST].param = TWSI_BAUD_RATE_PARAM(2, 1); - break; - case 24000000: - sc->baud_rate[IIC_SLOW].param = TWSI_BAUD_RATE_PARAM(5, 2); - sc->baud_rate[IIC_FAST].param = TWSI_BAUD_RATE_PARAM(5, 2); - sc->baud_rate[IIC_FASTEST].param = TWSI_BAUD_RATE_PARAM(2, 2); - break; - default: - device_printf(dev, "Non supported frequency\n"); - return (ENXIO); - } sc->need_ack = true; return (twsi_attach(dev)); Modified: head/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/twsi.c Sat May 11 15:02:55 2019 (r347490) +++ head/sys/dev/iicbus/twsi/twsi.c Sat May 11 15:03:51 2019 (r347491) @@ -243,6 +243,43 @@ twsi_locked_start(device_t dev, struct twsi_softc *sc, return (IIC_NOERR); } +#ifdef EXT_RESOURCES +#define TWSI_BAUD_RATE_RAW(C,M,N) ((C)/((10*(M+1))<<(N))) +#define ABSSUB(a,b) (((a) > (b)) ? (a) - (b) : (b) - (a)) + +static int +twsi_calc_baud_rate(struct twsi_softc *sc, const u_int target, + int *param) +{ + uint64_t clk; + uint32_t cur, diff, diff0; + int m, n, m0, n0; + + /* Calculate baud rate. */ + diff0 = 0xffffffff; + + if (clk_get_freq(sc->clk_core, &clk) < 0) + return (-1); + + debugf(sc->dev, "Bus clock is at %lu\n", clk); + + for (n = 0; n < 8; n++) { + for (m = 0; m < 16; m++) { + cur = TWSI_BAUD_RATE_RAW(clk,m,n); + diff = ABSSUB(target, cur); + if (diff < diff0) { + m0 = m; + n0 = n; + diff0 = diff; + } + } + } + *param = TWSI_BAUD_RATE_PARAM(m0, n0); + + return (0); +} +#endif /* EXT_RESOURCES */ + /* * Only slave mode supported, disregard [old]addr */ @@ -251,24 +288,36 @@ twsi_reset(device_t dev, u_char speed, u_char addr, u_ { struct twsi_softc *sc; uint32_t param; - /* uint32_t val; */ +#ifdef EXT_RESOURCES + u_int busfreq; +#endif sc = device_get_softc(dev); - switch (speed) { - case IIC_SLOW: - case IIC_FAST: - param = sc->baud_rate[speed].param; - debugf(dev, "Using IIC_FAST mode with speed param=%x\n", param); - break; - case IIC_FASTEST: - case IIC_UNKNOWN: - default: - param = sc->baud_rate[IIC_FAST].param; - debugf(dev, "Using IIC_FASTEST/UNKNOWN mode with speed param=%x\n", param); - break; +#ifdef EXT_RESOURCES + busfreq = IICBUS_GET_FREQUENCY(sc->iicbus, speed); + + if (twsi_calc_baud_rate(sc, busfreq, ¶m) == -1) { +#endif + switch (speed) { + case IIC_SLOW: + case IIC_FAST: + param = sc->baud_rate[speed].param; + debugf(dev, "Using IIC_FAST mode with speed param=%x\n", param); + break; + case IIC_FASTEST: + case IIC_UNKNOWN: + default: + param = sc->baud_rate[IIC_FAST].param; + debugf(dev, "Using IIC_FASTEST/UNKNOWN mode with speed param=%x\n", param); + break; + } +#ifdef EXT_RESOURCES } +#endif + debugf(dev, "Using clock param=%x\n", param); + mtx_lock(&sc->mutex); TWSI_WRITE(sc, sc->reg_soft_reset, 0x0); TWSI_WRITE(sc, sc->reg_baud_rate, param); @@ -521,6 +570,7 @@ twsi_intr(void *arg) break; case TWSI_STATUS_ADDR_R_ACK: + debugf(sc->dev, "Ack received after transmitting the address\n"); sc->recv_bytes = 0; TWSI_WRITE(sc, sc->reg_control, sc->control_val); From owner-svn-src-all@freebsd.org Sat May 11 15:17:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00462159FBEF; Sat, 11 May 2019 15:17:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9ACAB8C8AC; Sat, 11 May 2019 15:17:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71CB31D51F; Sat, 11 May 2019 15:17:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BFHgsk002302; Sat, 11 May 2019 15:17:42 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BFHgcR002301; Sat, 11 May 2019 15:17:42 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905111517.x4BFHgcR002301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 11 May 2019 15:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347492 - head/lib/libc/powerpc64/string X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/lib/libc/powerpc64/string X-SVN-Commit-Revision: 347492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9ACAB8C8AC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 15:17:43 -0000 Author: jhibbits Date: Sat May 11 15:17:42 2019 New Revision: 347492 URL: https://svnweb.freebsd.org/changeset/base/347492 Log: revert r346588 for now The rewrite of strcmp in assembly uses an instruction added in PowerISA 2.05, making it SIGILL on CPUs older than the POWER6, such as the PPC970 in the PowerMac G5. Revert this until we get clang+lld, or retire the in-tree binutils in favor of newer binutils with IFUNC support, whichever comes first. Deleted: head/lib/libc/powerpc64/string/ From owner-svn-src-all@freebsd.org Sat May 11 15:21:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D99159FCC8 for ; Sat, 11 May 2019 15:21:01 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 838B28CB8F for ; Sat, 11 May 2019 15:21:00 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1557587089; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Ho5sxbkjeTPjobs+Qyzibe/PzCFYrkF99Ip1bOxq7sXpGF/2Kb+pil/9qSU+fXjZZ2v+X0DKXzWrU hpCQXtK94mAj6oMlfZQDnzz8ZNA/9FCKuTq8FpDfNgLcCMdmg/L73b5sIlAZx0wf5fnkq45abKDHp9 wqiBydV88TsIrQD39WEM7LldnLLPv5OVKBlMP+n4zZqtVLz8TKSsrKk9mj0ORkqIiXA8Qt42IhZnUU RpyxR6shhdmiRfKzhmhKVYUSYKHYqqK0APbKrI/P2lPlIOKDcw92lBfWJeLG7I32fhfB36ei9CEU4g Oy1dP0btR0pXSbiD+nquzfeigFv+DZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=nSSxZIQDw5I17MooDVq3/AFAtto3L7AYbgtTw7yawHk=; b=tmv5Zu5z1HRSwy/8frvzqvzKYLD1IQ1FuQTUTeqCAUWY8WjisvGB58GH9NUeOSMAyIB2HHdSPn4Od su5kzvnCy6r1VJcNkbHpJlzEoComqurDDNmb027KaKyW27euu74uhow3wZN1E2pEO3mcPMZRrog+fD yxgKTKAxOj/BD5jtUP+NZSEYOc0IsV7wHr+k0mGRAUsxKfSw8u0qlpMwUgfvZJkQhAd9nH8S4bW/tk inUyDywyGgVDMGZEMgfcdU6sz75T4wKF/lopYolqHW2IjYNzyEQ3us3yl6P8X6CFE6Vovv3uqz7hac O9SA7huA3LXuphCwH4JrtrHVStxP64A== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=nSSxZIQDw5I17MooDVq3/AFAtto3L7AYbgtTw7yawHk=; b=ftpUFUxf04d4ERcaxmnhyTJSSI93uwm87InEM30NVd9Y/HRbTKNVQsGyDP2Ffyqj+DM9FWEjs+l/q hI121Xz7k3YP6Sn/JnfOZBHqsaWGaM7pUnugoCipUn3bg4aI5yOm2pFxrEC93qzkj9gju2MgjWqRKr C4oyIJG6kVm9eQFIjKWn+QxXICoAr+tXC1PGZV5t12gTEFDlTZLF03Wy8ACkh0JhTjHYCb/QdMlC5Y VR1HQpzDpeDPducmjBzpeebP/RcXJvMi7iXKsvtODOKLIzFOL9QGcLK6fXJgb0RMov+zlEgVKYnlaY x7Q0/mIaDBOHkXGPlKwl+EM/Xt4+5ug== X-MHO-RoutePath: aGlwcGll X-MHO-User: 1d97674b-73fe-11e9-98b8-27c316fec7c4 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 1d97674b-73fe-11e9-98b8-27c316fec7c4; Sat, 11 May 2019 15:04:47 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x4BF4kE2055041; Sat, 11 May 2019 09:04:46 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r347488 - head/usr.sbin/ntp/ntpd From: Ian Lepore To: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 11 May 2019 09:04:46 -0600 In-Reply-To: <201905111422.x4BEMMLM074842@repo.freebsd.org> References: <201905111422.x4BEMMLM074842@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 838B28CB8F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 15:21:01 -0000 On Sat, 2019-05-11 at 14:22 +0000, Xin LI wrote: > Author: delphij > Date: Sat May 11 14:22:21 2019 > New Revision: 347488 > URL: https://svnweb.freebsd.org/changeset/base/347488 > > Log: > Update leap-seconds to leap-seconds.3757622400. > For future reference: it's a bit better to get this file from NIST [*] than from USNO. The USNO boilerplate is full of typos, and USNO incorrectly adjusts the "last update date" metadata every time they change the expiration date of the file. That's not correct... as the boilerplate itself states, that field is only supposed to be updated when new leap seconds are added to the file. [*] ftp://ftp.nist.gov/pub/time/leap-seconds.list -- Ian > As per > https://datacenter.iers.org/data/latestVersion/16_BULLETIN_C16.txt: > > INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE > (IERS) > > SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE > REFERENCE > > SERVICE DE LA ROTATION TERRESTRE DE L'IERS > OBSERVATOIRE DE PARIS > 61, Av. de l'Observatoire 75014 PARIS (France) > Tel. : +33 1 40 51 23 35 > e-mail : services.iers@obspm.fr > http://hpiers.obspm.fr/eop-pc > > Paris, 07 January > 2019 > > Bulletin C 57 > > To authorities > responsible > for the measurement > and > distribution of time > > INFORMATION ON UTC - TAI > > NO leap second will be introduced at the end of June 2019. > The difference between Coordinated Universal Time UTC and the > International Atomic Time TAI is : > > from 2017 January 1, 0h UTC, until further notice : UTC-TAI = > -37 s > > Leap seconds can be introduced in UTC at the end of the months of > December > +# a comment, which continues from that symbol until > six months, either to announce a time step in UTC, or to confirm > that there > will be no time step at the next possible date. > > Christian BIZOUARD > Director > Earth Orientation > Center of IERS > Observatoire de Paris, > France > > Requested by: rgrimes > Obtained from: > ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3757622400 > MFC after: 3 days > > Modified: > head/usr.sbin/ntp/ntpd/leap-seconds > > Modified: head/usr.sbin/ntp/ntpd/leap-seconds > ===================================================================== > ========= > --- head/usr.sbin/ntp/ntpd/leap-seconds Sat May 11 10:16:43 > 2019 (r347487) > +++ head/usr.sbin/ntp/ntpd/leap-seconds Sat May 11 14:22:21 > 2019 (r347488) > @@ -1,10 +1,10 @@ > # > # In the following text, the symbol '#' introduces > -# a comment, which continues from that symbol until > +# a comment, which continues from that symbol until > # the end of the line. A plain comment line has a > # whitespace character following the comment indicator. > -# There are also special comment lines defined below. > -# A special comment will always have a non-whitespace > +# There are also special comment lines defined below. > +# A special comment will always have a non-whitespace > # character in column 2. > # > # A blank line should be ignored. > @@ -15,22 +15,17 @@ > # are transmitted by almost all time services. > # > # The first column shows an epoch as a number of seconds > -# since 1 January 1900, 00:00:00 (1900.0 is also used to > -# indicate the same epoch.) Both of these time stamp formats > -# ignore the complexities of the time scales that were > -# used before the current definition of UTC at the start > -# of 1972. (See note 3 below.) > -# The second column shows the number of seconds that > -# must be added to UTC to compute TAI for any timestamp > -# at or after that epoch. The value on each line is > -# valid from the indicated initial instant until the > -# epoch given on the next one or indefinitely into the > -# future if there is no next line. > +# since 1900.0 and the second column shows the number of > +# seconds that must be added to UTC to compute TAI for > +# any timestamp at or after that epoch. The value on > +# each line is valid from the indicated initial instant > +# until the epoch given on the next one or indefinitely > +# into the future if there is no next line. > # (The comment on each line shows the representation of > -# the corresponding initial epoch in the usual > +# the corresponding initial epoch in the usual > # day-month-year format. The epoch always begins at > # 00:00:00 UTC on the indicated day. See Note 5 below.) > -# > +# > # Important notes: > # > # 1. Coordinated Universal Time (UTC) is often referred to > @@ -38,7 +33,7 @@ > # longer used, and the use of GMT to designate UTC is > # discouraged. > # > -# 2. The UTC time scale is realized by many national > +# 2. The UTC time scale is realized by many national > # laboratories and timing centers. Each laboratory > # identifies its realization with its name: Thus > # UTC(NIST), UTC(USNO), etc. The differences among > @@ -47,12 +42,12 @@ > # and can be ignored for many purposes. These differences > # are tabulated in Circular T, which is published monthly > # by the International Bureau of Weights and Measures > -# (BIPM). See www.bipm.org for more information. > +# (BIPM). See www.bipm.fr for more information. > # > -# 3. The current definition of the relationship between UTC > -# and TAI dates from 1 January 1972. A number of different > -# time scales were in use before that epoch, and it can be > -# quite difficult to compute precise timestamps and time > +# 3. The current defintion of the relationship between UTC > +# and TAI dates from 1 January 1972. A number of different > +# time scales were in use before than epoch, and it can be > +# quite difficult to compute precise timestamps and time > # intervals in those "prehistoric" days. For more information, > # consult: > # > @@ -63,34 +58,36 @@ > # of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, > # July, 1991. > # > -# 4. The decision to insert a leap second into UTC is currently > -# the responsibility of the International Earth Rotation and > -# Reference Systems Service. (The name was changed from the > -# International Earth Rotation Service, but the acronym IERS > -# is still used.) > +# 4. The insertion of leap seconds into UTC is currently the > +# responsibility of the International Earth Rotation Service, > +# which is located at the Paris Observatory: > # > -# Leap seconds are announced by the IERS in its Bulletin C. > +# Central Bureau of IERS > +# 61, Avenue de l'Observatoire > +# 75014 Paris, France. > # > -# See www.iers.org for more details. > +# Leap seconds are announced by the IERS in its Bulletin C > # > -# Every national laboratory and timing center uses the > -# data from the BIPM and the IERS to construct UTC(lab), > -# their local realization of UTC. > +# See hpiers.obspm.fr or www.iers.org for more details. > # > +# All national laboratories and timing centers use the > +# data from the BIPM and the IERS to construct their > +# local realizations of UTC. > +# > # Although the definition also includes the possibility > -# of dropping seconds ("negative" leap seconds), this has > -# never been done and is unlikely to be necessary in the > +# of dropping seconds ("negative" leap seconds), this has > +# never been done and is unlikely to be necessary in the > # foreseeable future. > # > # 5. If your system keeps time as the number of seconds since > # some epoch (e.g., NTP timestamps), then the algorithm for > # assigning a UTC time stamp to an event that happens during a > positive > -# leap second is not well defined. The official name of that leap > -# second is 23:59:60, but there is no way of representing that > time > -# in these systems. > -# Many systems of this type effectively stop the system clock for > -# one second during the leap second and use a time that is > equivalent > -# to 23:59:59 UTC twice. For these systems, the corresponding TAI > +# leap second is not well defined. The official name of that > leap > +# second is 23:59:60, but there is no way of representing that > time > +# in these systems. > +# Many systems of this type effectively stop the system clock > for > +# one second during the leap second and use a time that is > equivalent > +# to 23:59:59 UTC twice. For these systems, the corresponding > TAI > # timestamp would be obtained by advancing to the next entry in > the > # following table when the time equivalent to 23:59:59 UTC > # is used for the second time. Thus the leap second which > @@ -105,7 +102,7 @@ > # > # If your system realizes the leap second by repeating 00:00:00 > UTC twice > # (this is possible but not usual), then the advance to the next > entry > -# in the table must occur the second time that a time equivalent > to > +# in the table must occur the second time that a time equivlent > to > # 00:00:00 UTC is used. Thus, using the same example as above: > # > # ... > @@ -115,94 +112,66 @@ > # ... > # > # in both cases the use of timestamps based on TAI produces a > smooth > -# time scale with no discontinuity in the time interval. However, > -# although the long-term behavior of the time scale is correct in > both > -# methods, the second method is technically not correct because > it adds > -# the extra second to the wrong day. > +# time scale with no discontinuity in the time interval. > # > -# This complexity would not be needed for negative leap seconds > (if they > -# are ever used). The UTC time would skip 23:59:59 and advance > from > -# 23:59:58 to 00:00:00 in that case. The TAI offset would > decrease by > -# 1 second at the same instant. This is a much easier situation > to deal > -# with, since the difficulty of unambiguously representing the > epoch > +# This complexity would not be needed for negative leap seconds > (if they > +# are ever used). The UTC time would skip 23:59:59 and advance > from > +# 23:59:58 to 00:00:00 in that case. The TAI offset would > decrease by > +# 1 second at the same instant. This is a much easier situation > to deal > +# with, since the difficulty of unambiguously representing the > epoch > # during the leap second does not arise. > # > -# Some systems implement leap seconds by amortizing the leap > second > -# over the last few minutes of the day. The frequency of the > local > -# clock is decreased (or increased) to realize the positive (or > -# negative) leap second. This method removes the time step > described > -# above. Although the long-term behavior of the time scale is > correct > -# in this case, this method introduces an error during the > adjustment > -# period both in time and in frequency with respect to the > official > -# definition of UTC. > -# > # Questions or comments to: > -# Judah Levine > -# Time and Frequency Division > -# NIST > -# Boulder, Colorado > -# Judah.Levine@nist.gov > +# Jeff Prillaman > +# Time Service Department > +# US Naval Observatory > +# Washington, DC > +# jeff.k.prillaman@navy.mil > # > -# Last Update of leap second values: 8 July 2016 > +# Last Update of leap second values: 28 Jan 2019 > # > -# The following line shows this last update date in NTP timestamp > +# The following line shows this last update date in NTP > timestamp > # format. This is the date on which the most recent change to > # the leap second data was added to the file. This line can > -# be identified by the unique pair of characters in the first two > +# be identified by the unique pair of characters in the first > two > # columns as shown below. > # > -#$ 3676924800 > +#$ 3757622400 > # > -# The NTP timestamps are in units of seconds since the NTP epoch, > -# which is 1 January 1900, 00:00:00. The Modified Julian Day > number > -# corresponding to the NTP time stamp, X, can be computed as > -# > -# X/86400 + 15020 > -# > -# where the first term converts seconds to days and the second > -# term adds the MJD corresponding to the time origin defined > above. > -# The integer portion of the result is the integer MJD for that > -# day, and any remainder is the time of day, expressed as the > -# fraction of the day since 0 hours UTC. The conversion from day > -# fraction to seconds or to hours, minutes, and seconds may > involve > -# rounding or truncation, depending on the method used in the > -# computation. > -# > -# The data in this file will be updated periodically as new leap > +# The data in this file will be updated periodically as new leap > # seconds are announced. In addition to being entered on the line > -# above, the update time (in NTP format) will be added to the > basic > +# above, the update time (in NTP format) will be added to the > basic > # file name leap-seconds to form the name leap-seconds. TIME>. > -# In addition, the generic name leap-seconds.list will always > point to > +# In addition, the generic name leap-seconds.list will always > point to > # the most recent version of the file. > # > # This update procedure will be performed only when a new leap > second > -# is announced. > +# is announced. > # > # The following entry specifies the expiration date of the data > -# in this file in units of seconds since the origin at the > instant > -# 1 January 1900, 00:00:00. This expiration date will be changed > -# at least twice per year whether or not a new leap second is > -# announced. These semi-annual changes will be made no later > -# than 1 June and 1 December of each year to indicate what > -# action (if any) is to be taken on 30 June and 31 December, > +# in this file in units of seconds since 1900.0. This expiration > date > +# will be changed at least twice per year whether or not a new > leap > +# second is announced. These semi-annual changes will be made no > +# later than 1 June and 1 December of each year to indicate what > +# action (if any) is to be taken on 30 June and 31 December, > # respectively. (These are the customary effective dates for new > # leap seconds.) This expiration date will be identified by a > # unique pair of characters in columns 1 and 2 as shown below. > -# In the unlikely event that a leap second is announced with an > +# In the unlikely event that a leap second is announced with an > # effective date other than 30 June or 31 December, then this > # file will be edited to include that leap second as soon as it > is > # announced or at least one month before the effective date > -# (whichever is later). > -# If an announcement by the IERS specifies that no leap second is > -# scheduled, then only the expiration date of the file will > +# (whichever is later). > +# If an announcement by the IERS specifies that no leap second > is > +# scheduled, then only the expiration date of the file will > # be advanced to show that the information in the file is still > -# current -- the update time stamp, the data and the name of the > file > +# current -- the update time stamp, the data and the name of the > file > # will not change. > # > -# Updated through IERS Bulletin C53 > -# File expires on: 28 December 2017 > +# Updated through IERS Bulletin C 57 > +# File expires on: 1 Dec 2019 > # > -#@ 3723408000 > +#@ 3784147200 > # > 2272060800 10 # 1 Jan 1972 > 2287785600 11 # 1 Jul 1972 > @@ -236,15 +205,16 @@ > # the following special comment contains the > # hash value of the data in this file computed > # use the secure hash algorithm as specified > -# by FIPS 180-1. See the files in ~/pub/sha for > +# by FIPS 180-1. See the files in ~/sha for > # the details of how this hash value is > # computed. Note that the hash computation > # ignores comments and whitespace characters > # in data lines. It includes the NTP values > -# of both the last modification time and the > +# of both the last modification time and the > # expiration time of the file, but not the > # white space on those lines. > # the hash line is also ignored in the > # computation. > # > -#h 62cf8c5d 8bbb6dcc c61e3b56 c308343 869bb80d > +#h 630ac741 2fffdd6b 858a7d1d 31d4802f 6382e10c > +# > From owner-svn-src-all@freebsd.org Sat May 11 15:35:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7256515A03DF; Sat, 11 May 2019 15:35:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17DD28D344; Sat, 11 May 2019 15:35:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id 43E127614; Sat, 11 May 2019 15:35:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r347477 - head/sys/kern To: Doug Moore , Cy Schubert , Doug Moore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905110447.x4B4lqeh031565@slippy.cwsent.com> From: Pedro Giffuni Organization: FreeBSD Message-ID: <4dbd3d4b-3d6c-d0b0-e6a7-8c80997124dd@FreeBSD.org> Date: Sat, 11 May 2019 10:35:09 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 17DD28D344 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.960,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 15:35:10 -0000 Hi; On 10/05/2019 23:57, Doug Moore wrote: > With mentor approval, I commit r347469.  I start getting email about > jenkins failure to build for several architectures on account of the > _Generic() construct I introduced in that change. > > I whip up a patch to undo that part of r347469, and ask for mentor > approval.  Meanwhile, mentor authorizes me in email to revert r347469. > > I try apply applying the fix-patch, and get email that it was rejected > for lack of reviewer.  In retrospect, it seems to have been committed > anyway as r347472. > > Thinking that things are still broken, I do what my mentor pre-approved > earlier and revert back to before r347469.  A patch to redo r347469, > without _Generic(), awaits mentor approval. Ugh...  a rather elegant interaction ;) > I realize that breaking the build and then committing without mentor > approval in my first week as committer isn't a good beginning.   Sorry > about that. It's probably not official policy but I would think you don't need mentor approval to revert a change, assuming things return to the pre-commit state, especially if it broke the build. Pedro. From owner-svn-src-all@freebsd.org Sat May 11 16:15:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93B8115A1236; Sat, 11 May 2019 16:15:14 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35E9D8E477; Sat, 11 May 2019 16:15:14 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10F311DF0F; Sat, 11 May 2019 16:15:14 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BGFDXB032883; Sat, 11 May 2019 16:15:13 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BGFDIu032880; Sat, 11 May 2019 16:15:13 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905111615.x4BGFDIu032880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 11 May 2019 16:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347493 - in head/sys: kern sys vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: in head/sys: kern sys vm X-SVN-Commit-Revision: 347493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35E9D8E477 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 16:15:14 -0000 Author: dougm Date: Sat May 11 16:15:13 2019 New Revision: 347493 URL: https://svnweb.freebsd.org/changeset/base/347493 Log: A new parameter to blist_alloc specifies an upper bound on the size of the allocation request, so that the blocks allocated are from the next set of free blocks big enough to satisfy the minimum requirements of the request, and the number of blocks allocated are as many as possible, up to the specified maximum. The implementation of swp_pager_getswapspace uses this parameter to ask for a number of blocks between the new halved request size and the previous failed request size. Thus a request for 32 blocks may fail, but instead of getting only 16 blocks instead, the caller asks for 16 to 31 next, and might get 19 or 27, which is closer to what they originally wanted. I expect this to lead to bigger block allocations and less block fragmentation, at least in some cases. Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20001 Modified: head/sys/kern/subr_blist.c head/sys/sys/blist.h head/sys/vm/swap_pager.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Sat May 11 15:17:42 2019 (r347492) +++ head/sys/kern/subr_blist.c Sat May 11 16:15:13 2019 (r347493) @@ -130,9 +130,10 @@ __FBSDID("$FreeBSD$"); /* * static support functions */ -static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count); -static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_t count, - u_daddr_t radix); +static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, + int *count, int maxcount); +static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t cursor, int *count, + int maxcount, u_daddr_t radix); static void blst_leaf_free(blmeta_t *scan, daddr_t relblk, int count); static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, u_daddr_t radix); @@ -293,12 +294,14 @@ blist_destroy(blist_t bl) * not be allocated. */ daddr_t -blist_alloc(blist_t bl, daddr_t count) +blist_alloc(blist_t bl, int *count, int maxcount) { daddr_t blk, cursor; - KASSERT(count <= BLIST_MAX_ALLOC, - ("allocation too large: %d", (int)count)); + KASSERT(*count <= maxcount, + ("invalid parameters %d > %d", *count, maxcount)); + KASSERT(maxcount <= BLIST_MAX_ALLOC, + ("allocation too large: %d", maxcount)); /* * This loop iterates at most twice. An allocation failure in the @@ -306,19 +309,18 @@ blist_alloc(blist_t bl, daddr_t count) * non-zero. When the cursor is zero, an allocation failure will * stop further iterations. */ - cursor = bl->bl_cursor; - for (;;) { - blk = blst_meta_alloc(bl->bl_root, cursor, count, + for (cursor = bl->bl_cursor;; cursor = 0) { + blk = blst_meta_alloc(bl->bl_root, cursor, count, maxcount, bl->bl_radix); if (blk != SWAPBLK_NONE) { - bl->bl_avail -= count; - bl->bl_cursor = blk + count; + bl->bl_avail -= *count; + bl->bl_cursor = blk + *count; if (bl->bl_cursor == bl->bl_blocks) bl->bl_cursor = 0; return (blk); - } else if (cursor == 0) + } + if (cursor == 0) return (SWAPBLK_NONE); - cursor = 0; } } @@ -615,29 +617,34 @@ blist_stats(blist_t bl, struct sbuf *s) * common ancestor to mark any subtrees made completely empty. */ static int -blst_next_leaf_alloc(blmeta_t *scan, daddr_t blk, int count) +blst_next_leaf_alloc(blmeta_t *scan, daddr_t blk, int count, int maxcount) { blmeta_t *next; u_daddr_t radix; - int digit; + int avail, digit; next = scan + 1; blk += BLIST_BMAP_RADIX; radix = BLIST_BMAP_RADIX; - while ((digit = ((blk / radix) & BLIST_META_MASK)) == 0 && - (next->bm_bitmap & 1) == 1) { + while ((next->bm_bitmap & 1) == 1 && + (digit = ((blk / radix) & BLIST_META_MASK)) == 0) { next++; radix *= BLIST_META_RADIX; } - if (((next->bm_bitmap + 1) & ~((u_daddr_t)-1 << count)) != 0) { - /* - * The next leaf doesn't have enough free blocks at the - * beginning to complete the spanning allocation. - */ - return (ENOMEM); + if ((next->bm_bitmap & 1) != 1) + return (0); + avail = (~next->bm_bitmap != 0) ? + bitpos(~next->bm_bitmap) : BLIST_BMAP_RADIX; + if (avail < count) { + /* + * The next leaf doesn't have enough free blocks at the + * beginning to complete the spanning allocation. + */ + return (0); } + count = imin(avail, maxcount); /* Clear the first 'count' bits in the next leaf to allocate. */ - next->bm_bitmap &= (u_daddr_t)-1 << count; + next->bm_bitmap &= ~bitrange(0, count); /* * Update bitmaps of next-ancestors, up to least common ancestor. @@ -650,7 +657,7 @@ blst_next_leaf_alloc(blmeta_t *scan, daddr_t blk, int } next->bm_bitmap ^= 1; } - return (0); + return (count); } /* @@ -674,13 +681,13 @@ flip_hibits(u_daddr_t mask) * crosses a leaf boundary. */ static daddr_t -blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count) +blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int *count, int maxcount) { u_daddr_t cursor_mask, mask; int count1, hi, lo, num_shifts, range1, range_ext; range1 = 0; - count1 = count - 1; + count1 = *count - 1; num_shifts = fls(count1); mask = scan->bm_bitmap; while (flip_hibits(mask) != 0 && num_shifts > 0) { @@ -735,40 +742,50 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count /* * The least significant set bit in mask marks the start of the first - * available range of sufficient size. Clear all the bits but that one, - * and then find its position. + * available range of sufficient size. Find its position. */ - mask &= -mask; lo = bitpos(mask); - hi = lo + count; - if (hi > BLIST_BMAP_RADIX) { - /* - * An allocation within this leaf is impossible, so a successful - * allocation depends on the next leaf providing some of the blocks. - */ - if (blst_next_leaf_alloc(scan, blk, hi - BLIST_BMAP_RADIX) != 0) + /* + * Find how much space is available starting at that position. + */ + if (flip_hibits(mask) != 0) { + /* Count the 1 bits starting at position lo. */ + hi = bitpos(flip_hibits(mask)) + count1; + if (maxcount < hi - lo) + hi = lo + maxcount; + *count = hi - lo; + mask = bitrange(lo, *count); + } else if (maxcount <= BLIST_BMAP_RADIX - lo) { + /* All the blocks we can use are available here. */ + hi = lo + maxcount; + *count = maxcount; + mask = bitrange(lo, *count); + } else { + /* Check next leaf for some of the blocks we want or need. */ + count1 = *count - (BLIST_BMAP_RADIX - lo); + maxcount -= BLIST_BMAP_RADIX - lo; + hi = blst_next_leaf_alloc(scan, blk, count1, maxcount); + if (hi < count1) /* - * The hint cannot be updated, because the same - * allocation request could be satisfied later, by this - * leaf, if the state of the next leaf changes, and - * without any changes to this leaf. + * The next leaf cannot supply enough blocks to reach + * the minimum required allocation. The hint cannot be + * updated, because the same allocation request could + * be satisfied later, by this leaf, if the state of + * the next leaf changes, and without any changes to + * this leaf. */ return (SWAPBLK_NONE); + *count = BLIST_BMAP_RADIX - lo + hi; hi = BLIST_BMAP_RADIX; } - /* Set the bits of mask at position 'lo' and higher. */ - mask = -mask; if (hi == BLIST_BMAP_RADIX) { /* * Update bighint. There is no allocation bigger than range1 * available in this leaf after this allocation completes. */ scan->bm_bighint = range1; - } else { - /* Clear the bits of mask at position 'hi' and higher. */ - mask &= (u_daddr_t)-1 >> (BLIST_BMAP_RADIX - hi); } /* Clear the allocated bits from this leaf. */ scan->bm_bitmap &= ~mask; @@ -784,7 +801,8 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count * and we have a few optimizations strewn in as well. */ static daddr_t -blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_t count, u_daddr_t radix) +blst_meta_alloc(blmeta_t *scan, daddr_t cursor, int *count, + int maxcount, u_daddr_t radix) { daddr_t blk, i, r, skip; u_daddr_t mask; @@ -792,7 +810,7 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_ int digit; if (radix == BLIST_BMAP_RADIX) - return (blst_leaf_alloc(scan, cursor, count)); + return (blst_leaf_alloc(scan, cursor, count, maxcount)); blk = cursor & -radix; scan_from_start = (cursor == blk); radix /= BLIST_META_RADIX; @@ -821,12 +839,12 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_ do { digit = bitpos(mask); i = 1 + digit * skip; - if (count <= scan[i].bm_bighint) { + if (*count <= scan[i].bm_bighint) { /* * The allocation might fit beginning in the i'th subtree. */ r = blst_meta_alloc(&scan[i], cursor + digit * radix, - count, radix); + count, maxcount, radix); if (r != SWAPBLK_NONE) { if (scan[i].bm_bitmap == 0) scan->bm_bitmap ^= bitrange(digit, 1); @@ -842,7 +860,7 @@ blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_ */ if (scan_from_start && !(digit == BLIST_META_RADIX - 1 && scan[i].bm_bighint == BLIST_MAX_ALLOC)) - scan->bm_bighint = count - 1; + scan->bm_bighint = *count - 1; return (SWAPBLK_NONE); } @@ -1101,7 +1119,7 @@ main(int ac, char **av) for (;;) { char buf[1024]; long long da = 0; - long long count = 0; + int count = 0, maxcount = 0; printf("%lld/%lld/%lld> ", (long long)blist_avail(bl), (long long)size, (long long)bl->bl_radix); @@ -1110,7 +1128,7 @@ main(int ac, char **av) break; switch(buf[0]) { case 'r': - if (sscanf(buf + 1, "%lld", &count) == 1) { + if (sscanf(buf + 1, "%d", &count) == 1) { blist_resize(&bl, count, 1, M_WAITOK); } else { printf("?\n"); @@ -1126,22 +1144,23 @@ main(int ac, char **av) sbuf_delete(s); break; case 'a': - if (sscanf(buf + 1, "%lld", &count) == 1) { - daddr_t blk = blist_alloc(bl, count); - printf(" R=%08llx\n", (long long)blk); + if (sscanf(buf + 1, "%d%d", &count, &maxcount) == 2) { + daddr_t blk = blist_alloc(bl, &count, maxcount); + printf(" R=%08llx, c=%08d\n", + (long long)blk, count); } else { printf("?\n"); } break; case 'f': - if (sscanf(buf + 1, "%llx %lld", &da, &count) == 2) { + if (sscanf(buf + 1, "%llx %d", &da, &count) == 2) { blist_free(bl, da, count); } else { printf("?\n"); } break; case 'l': - if (sscanf(buf + 1, "%llx %lld", &da, &count) == 2) { + if (sscanf(buf + 1, "%llx %d", &da, &count) == 2) { printf(" n=%jd\n", (intmax_t)blist_fill(bl, da, count)); } else { @@ -1153,7 +1172,7 @@ main(int ac, char **av) puts( "p -print\n" "s -stats\n" - "a %d -allocate\n" + "a %d %d -allocate\n" "f %x %d -free\n" "l %x %d -fill\n" "r %d -resize\n" Modified: head/sys/sys/blist.h ============================================================================== --- head/sys/sys/blist.h Sat May 11 15:17:42 2019 (r347492) +++ head/sys/sys/blist.h Sat May 11 16:15:13 2019 (r347493) @@ -33,7 +33,7 @@ * Usage: * blist = blist_create(blocks, flags) * (void) blist_destroy(blist) - * blkno = blist_alloc(blist, count) + * blkno = blist_alloc(blist, &count, maxcount) * (void) blist_free(blist, blkno, count) * nblks = blist_fill(blist, blkno, count) * (void) blist_resize(&blist, count, freeextra, flags) @@ -92,7 +92,7 @@ typedef struct blist { struct sbuf; -daddr_t blist_alloc(blist_t blist, daddr_t count); +daddr_t blist_alloc(blist_t blist, int *count, int maxcount); daddr_t blist_avail(blist_t blist); blist_t blist_create(daddr_t blocks, int flags); void blist_destroy(blist_t blist); Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sat May 11 15:17:42 2019 (r347492) +++ head/sys/vm/swap_pager.c Sat May 11 16:15:13 2019 (r347493) @@ -725,23 +725,24 @@ swp_pager_getswapspace(int *io_npages, int limit) { daddr_t blk; struct swdevt *sp; - int npages; + int mpages, npages; blk = SWAPBLK_NONE; - npages = *io_npages; + npages = mpages = *io_npages; mtx_lock(&sw_dev_mtx); sp = swdevhd; while (!TAILQ_EMPTY(&swtailq)) { if (sp == NULL) sp = TAILQ_FIRST(&swtailq); if ((sp->sw_flags & SW_CLOSING) == 0) - blk = blist_alloc(sp->sw_blist, npages); + blk = blist_alloc(sp->sw_blist, &npages, mpages); if (blk != SWAPBLK_NONE) break; sp = TAILQ_NEXT(sp, sw_list); if (swdevhd == sp) { if (npages <= limit) break; + mpages = npages - 1; npages >>= 1; } } From owner-svn-src-all@freebsd.org Sat May 11 16:37:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F2D415A1835; Sat, 11 May 2019 16:37:16 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B8798EF07; Sat, 11 May 2019 16:37:15 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4BGbBsB032624; Sat, 11 May 2019 09:37:11 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4BGbAWj032623; Sat, 11 May 2019 09:37:10 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905111637.x4BGbAWj032623@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347488 - head/usr.sbin/ntp/ntpd In-Reply-To: To: Ian Lepore Date: Sat, 11 May 2019 09:37:10 -0700 (PDT) CC: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 5B8798EF07 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 16:37:16 -0000 > On Sat, 2019-05-11 at 14:22 +0000, Xin LI wrote: > > Author: delphij > > Date: Sat May 11 14:22:21 2019 > > New Revision: 347488 > > URL: https://svnweb.freebsd.org/changeset/base/347488 > > > > Log: > > Update leap-seconds to leap-seconds.3757622400. > > > > For future reference: it's a bit better to get this file from NIST [*] > than from USNO. The USNO boilerplate is full of typos, and USNO > incorrectly adjusts the "last update date" metadata every time they > change the expiration date of the file. That's not correct... as the > boilerplate itself states, that field is only supposed to be updated > when new leap seconds are added to the file. I would be very happy if that information would end up in the top of, or next to the leap-seconds file so that it was followed in the future, rather than being folk lore. Thanks, Rod > [*] ftp://ftp.nist.gov/pub/time/leap-seconds.list > > -- Ian > > > As per > > https://datacenter.iers.org/data/latestVersion/16_BULLETIN_C16.txt: > > > > INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE > > (IERS) > > > > SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE > > REFERENCE > > > > SERVICE DE LA ROTATION TERRESTRE DE L'IERS > > OBSERVATOIRE DE PARIS > > 61, Av. de l'Observatoire 75014 PARIS (France) > > Tel. : +33 1 40 51 23 35 > > e-mail : services.iers@obspm.fr > > http://hpiers.obspm.fr/eop-pc > > > > Paris, 07 January > > 2019 > > > > Bulletin C 57 > > > > To authorities > > responsible > > for the measurement > > and > > distribution of time > > > > INFORMATION ON UTC - TAI > > > > NO leap second will be introduced at the end of June 2019. > > The difference between Coordinated Universal Time UTC and the > > International Atomic Time TAI is : > > > > from 2017 January 1, 0h UTC, until further notice : UTC-TAI = > > -37 s > > > > Leap seconds can be introduced in UTC at the end of the months of > > December > > +# a comment, which continues from that symbol until > > six months, either to announce a time step in UTC, or to confirm > > that there > > will be no time step at the next possible date. > > > > Christian BIZOUARD > > Director > > Earth Orientation > > Center of IERS > > Observatoire de Paris, > > France > > > > Requested by: rgrimes > > Obtained from: > > ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3757622400 > > MFC after: 3 days > > > > Modified: > > head/usr.sbin/ntp/ntpd/leap-seconds > > > > Modified: head/usr.sbin/ntp/ntpd/leap-seconds > > ===================================================================== > > ========= > > --- head/usr.sbin/ntp/ntpd/leap-seconds Sat May 11 10:16:43 > > 2019 (r347487) > > +++ head/usr.sbin/ntp/ntpd/leap-seconds Sat May 11 14:22:21 > > 2019 (r347488) > > @@ -1,10 +1,10 @@ > > # > > # In the following text, the symbol '#' introduces > > -# a comment, which continues from that symbol until > > +# a comment, which continues from that symbol until > > # the end of the line. A plain comment line has a > > # whitespace character following the comment indicator. > > -# There are also special comment lines defined below. > > -# A special comment will always have a non-whitespace > > +# There are also special comment lines defined below. > > +# A special comment will always have a non-whitespace > > # character in column 2. > > # > > # A blank line should be ignored. > > @@ -15,22 +15,17 @@ > > # are transmitted by almost all time services. > > # > > # The first column shows an epoch as a number of seconds > > -# since 1 January 1900, 00:00:00 (1900.0 is also used to > > -# indicate the same epoch.) Both of these time stamp formats > > -# ignore the complexities of the time scales that were > > -# used before the current definition of UTC at the start > > -# of 1972. (See note 3 below.) > > -# The second column shows the number of seconds that > > -# must be added to UTC to compute TAI for any timestamp > > -# at or after that epoch. The value on each line is > > -# valid from the indicated initial instant until the > > -# epoch given on the next one or indefinitely into the > > -# future if there is no next line. > > +# since 1900.0 and the second column shows the number of > > +# seconds that must be added to UTC to compute TAI for > > +# any timestamp at or after that epoch. The value on > > +# each line is valid from the indicated initial instant > > +# until the epoch given on the next one or indefinitely > > +# into the future if there is no next line. > > # (The comment on each line shows the representation of > > -# the corresponding initial epoch in the usual > > +# the corresponding initial epoch in the usual > > # day-month-year format. The epoch always begins at > > # 00:00:00 UTC on the indicated day. See Note 5 below.) > > -# > > +# > > # Important notes: > > # > > # 1. Coordinated Universal Time (UTC) is often referred to > > @@ -38,7 +33,7 @@ > > # longer used, and the use of GMT to designate UTC is > > # discouraged. > > # > > -# 2. The UTC time scale is realized by many national > > +# 2. The UTC time scale is realized by many national > > # laboratories and timing centers. Each laboratory > > # identifies its realization with its name: Thus > > # UTC(NIST), UTC(USNO), etc. The differences among > > @@ -47,12 +42,12 @@ > > # and can be ignored for many purposes. These differences > > # are tabulated in Circular T, which is published monthly > > # by the International Bureau of Weights and Measures > > -# (BIPM). See www.bipm.org for more information. > > +# (BIPM). See www.bipm.fr for more information. > > # > > -# 3. The current definition of the relationship between UTC > > -# and TAI dates from 1 January 1972. A number of different > > -# time scales were in use before that epoch, and it can be > > -# quite difficult to compute precise timestamps and time > > +# 3. The current defintion of the relationship between UTC > > +# and TAI dates from 1 January 1972. A number of different > > +# time scales were in use before than epoch, and it can be > > +# quite difficult to compute precise timestamps and time > > # intervals in those "prehistoric" days. For more information, > > # consult: > > # > > @@ -63,34 +58,36 @@ > > # of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, > > # July, 1991. > > # > > -# 4. The decision to insert a leap second into UTC is currently > > -# the responsibility of the International Earth Rotation and > > -# Reference Systems Service. (The name was changed from the > > -# International Earth Rotation Service, but the acronym IERS > > -# is still used.) > > +# 4. The insertion of leap seconds into UTC is currently the > > +# responsibility of the International Earth Rotation Service, > > +# which is located at the Paris Observatory: > > # > > -# Leap seconds are announced by the IERS in its Bulletin C. > > +# Central Bureau of IERS > > +# 61, Avenue de l'Observatoire > > +# 75014 Paris, France. > > # > > -# See www.iers.org for more details. > > +# Leap seconds are announced by the IERS in its Bulletin C > > # > > -# Every national laboratory and timing center uses the > > -# data from the BIPM and the IERS to construct UTC(lab), > > -# their local realization of UTC. > > +# See hpiers.obspm.fr or www.iers.org for more details. > > # > > +# All national laboratories and timing centers use the > > +# data from the BIPM and the IERS to construct their > > +# local realizations of UTC. > > +# > > # Although the definition also includes the possibility > > -# of dropping seconds ("negative" leap seconds), this has > > -# never been done and is unlikely to be necessary in the > > +# of dropping seconds ("negative" leap seconds), this has > > +# never been done and is unlikely to be necessary in the > > # foreseeable future. > > # > > # 5. If your system keeps time as the number of seconds since > > # some epoch (e.g., NTP timestamps), then the algorithm for > > # assigning a UTC time stamp to an event that happens during a > > positive > > -# leap second is not well defined. The official name of that leap > > -# second is 23:59:60, but there is no way of representing that > > time > > -# in these systems. > > -# Many systems of this type effectively stop the system clock for > > -# one second during the leap second and use a time that is > > equivalent > > -# to 23:59:59 UTC twice. For these systems, the corresponding TAI > > +# leap second is not well defined. The official name of that > > leap > > +# second is 23:59:60, but there is no way of representing that > > time > > +# in these systems. > > +# Many systems of this type effectively stop the system clock > > for > > +# one second during the leap second and use a time that is > > equivalent > > +# to 23:59:59 UTC twice. For these systems, the corresponding > > TAI > > # timestamp would be obtained by advancing to the next entry in > > the > > # following table when the time equivalent to 23:59:59 UTC > > # is used for the second time. Thus the leap second which > > @@ -105,7 +102,7 @@ > > # > > # If your system realizes the leap second by repeating 00:00:00 > > UTC twice > > # (this is possible but not usual), then the advance to the next > > entry > > -# in the table must occur the second time that a time equivalent > > to > > +# in the table must occur the second time that a time equivlent > > to > > # 00:00:00 UTC is used. Thus, using the same example as above: > > # > > # ... > > @@ -115,94 +112,66 @@ > > # ... > > # > > # in both cases the use of timestamps based on TAI produces a > > smooth > > -# time scale with no discontinuity in the time interval. However, > > -# although the long-term behavior of the time scale is correct in > > both > > -# methods, the second method is technically not correct because > > it adds > > -# the extra second to the wrong day. > > +# time scale with no discontinuity in the time interval. > > # > > -# This complexity would not be needed for negative leap seconds > > (if they > > -# are ever used). The UTC time would skip 23:59:59 and advance > > from > > -# 23:59:58 to 00:00:00 in that case. The TAI offset would > > decrease by > > -# 1 second at the same instant. This is a much easier situation > > to deal > > -# with, since the difficulty of unambiguously representing the > > epoch > > +# This complexity would not be needed for negative leap seconds > > (if they > > +# are ever used). The UTC time would skip 23:59:59 and advance > > from > > +# 23:59:58 to 00:00:00 in that case. The TAI offset would > > decrease by > > +# 1 second at the same instant. This is a much easier situation > > to deal > > +# with, since the difficulty of unambiguously representing the > > epoch > > # during the leap second does not arise. > > # > > -# Some systems implement leap seconds by amortizing the leap > > second > > -# over the last few minutes of the day. The frequency of the > > local > > -# clock is decreased (or increased) to realize the positive (or > > -# negative) leap second. This method removes the time step > > described > > -# above. Although the long-term behavior of the time scale is > > correct > > -# in this case, this method introduces an error during the > > adjustment > > -# period both in time and in frequency with respect to the > > official > > -# definition of UTC. > > -# > > # Questions or comments to: > > -# Judah Levine > > -# Time and Frequency Division > > -# NIST > > -# Boulder, Colorado > > -# Judah.Levine@nist.gov > > +# Jeff Prillaman > > +# Time Service Department > > +# US Naval Observatory > > +# Washington, DC > > +# jeff.k.prillaman@navy.mil > > # > > -# Last Update of leap second values: 8 July 2016 > > +# Last Update of leap second values: 28 Jan 2019 > > # > > -# The following line shows this last update date in NTP timestamp > > +# The following line shows this last update date in NTP > > timestamp > > # format. This is the date on which the most recent change to > > # the leap second data was added to the file. This line can > > -# be identified by the unique pair of characters in the first two > > +# be identified by the unique pair of characters in the first > > two > > # columns as shown below. > > # > > -#$ 3676924800 > > +#$ 3757622400 > > # > > -# The NTP timestamps are in units of seconds since the NTP epoch, > > -# which is 1 January 1900, 00:00:00. The Modified Julian Day > > number > > -# corresponding to the NTP time stamp, X, can be computed as > > -# > > -# X/86400 + 15020 > > -# > > -# where the first term converts seconds to days and the second > > -# term adds the MJD corresponding to the time origin defined > > above. > > -# The integer portion of the result is the integer MJD for that > > -# day, and any remainder is the time of day, expressed as the > > -# fraction of the day since 0 hours UTC. The conversion from day > > -# fraction to seconds or to hours, minutes, and seconds may > > involve > > -# rounding or truncation, depending on the method used in the > > -# computation. > > -# > > -# The data in this file will be updated periodically as new leap > > +# The data in this file will be updated periodically as new leap > > # seconds are announced. In addition to being entered on the line > > -# above, the update time (in NTP format) will be added to the > > basic > > +# above, the update time (in NTP format) will be added to the > > basic > > # file name leap-seconds to form the name leap-seconds. > TIME>. > > -# In addition, the generic name leap-seconds.list will always > > point to > > +# In addition, the generic name leap-seconds.list will always > > point to > > # the most recent version of the file. > > # > > # This update procedure will be performed only when a new leap > > second > > -# is announced. > > +# is announced. > > # > > # The following entry specifies the expiration date of the data > > -# in this file in units of seconds since the origin at the > > instant > > -# 1 January 1900, 00:00:00. This expiration date will be changed > > -# at least twice per year whether or not a new leap second is > > -# announced. These semi-annual changes will be made no later > > -# than 1 June and 1 December of each year to indicate what > > -# action (if any) is to be taken on 30 June and 31 December, > > +# in this file in units of seconds since 1900.0. This expiration > > date > > +# will be changed at least twice per year whether or not a new > > leap > > +# second is announced. These semi-annual changes will be made no > > +# later than 1 June and 1 December of each year to indicate what > > +# action (if any) is to be taken on 30 June and 31 December, > > # respectively. (These are the customary effective dates for new > > # leap seconds.) This expiration date will be identified by a > > # unique pair of characters in columns 1 and 2 as shown below. > > -# In the unlikely event that a leap second is announced with an > > +# In the unlikely event that a leap second is announced with an > > # effective date other than 30 June or 31 December, then this > > # file will be edited to include that leap second as soon as it > > is > > # announced or at least one month before the effective date > > -# (whichever is later). > > -# If an announcement by the IERS specifies that no leap second is > > -# scheduled, then only the expiration date of the file will > > +# (whichever is later). > > +# If an announcement by the IERS specifies that no leap second > > is > > +# scheduled, then only the expiration date of the file will > > # be advanced to show that the information in the file is still > > -# current -- the update time stamp, the data and the name of the > > file > > +# current -- the update time stamp, the data and the name of the > > file > > # will not change. > > # > > -# Updated through IERS Bulletin C53 > > -# File expires on: 28 December 2017 > > +# Updated through IERS Bulletin C 57 > > +# File expires on: 1 Dec 2019 > > # > > -#@ 3723408000 > > +#@ 3784147200 > > # > > 2272060800 10 # 1 Jan 1972 > > 2287785600 11 # 1 Jul 1972 > > @@ -236,15 +205,16 @@ > > # the following special comment contains the > > # hash value of the data in this file computed > > # use the secure hash algorithm as specified > > -# by FIPS 180-1. See the files in ~/pub/sha for > > +# by FIPS 180-1. See the files in ~/sha for > > # the details of how this hash value is > > # computed. Note that the hash computation > > # ignores comments and whitespace characters > > # in data lines. It includes the NTP values > > -# of both the last modification time and the > > +# of both the last modification time and the > > # expiration time of the file, but not the > > # white space on those lines. > > # the hash line is also ignored in the > > # computation. > > # > > -#h 62cf8c5d 8bbb6dcc c61e3b56 c308343 869bb80d > > +#h 630ac741 2fffdd6b 858a7d1d 31d4802f 6382e10c > > +# > > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat May 11 16:40:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4943C15A18F0; Sat, 11 May 2019 16:40:37 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 858B28F08C; Sat, 11 May 2019 16:40:36 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4BGeYAk032642; Sat, 11 May 2019 09:40:34 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4BGeYk0032641; Sat, 11 May 2019 09:40:34 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905111640.x4BGeYk0032641@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347477 - head/sys/kern In-Reply-To: <4dbd3d4b-3d6c-d0b0-e6a7-8c80997124dd@FreeBSD.org> To: Pedro Giffuni Date: Sat, 11 May 2019 09:40:34 -0700 (PDT) CC: Doug Moore , Cy Schubert , Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 858B28F08C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 16:40:37 -0000 > Hi; > > On 10/05/2019 23:57, Doug Moore wrote: > > With mentor approval, I commit r347469.? I start getting email about > > jenkins failure to build for several architectures on account of the > > _Generic() construct I introduced in that change. > > > > I whip up a patch to undo that part of r347469, and ask for mentor > > approval.? Meanwhile, mentor authorizes me in email to revert r347469. > > > > I try apply applying the fix-patch, and get email that it was rejected > > for lack of reviewer.? In retrospect, it seems to have been committed > > anyway as r347472. > > > > Thinking that things are still broken, I do what my mentor pre-approved > > earlier and revert back to before r347469.? A patch to redo r347469, > > without _Generic(), awaits mentor approval. > > Ugh...? a rather elegant interaction ;) > > > I realize that breaking the build and then committing without mentor > > approval in my first week as committer isn't a good beginning.?? Sorry > > about that. > > It's probably not official policy but I would think you don't need > mentor approval to revert a change, assuming things return to the > pre-commit state, especially if it broke the build. Perhaps this also should be added to the committers guide of explaining what and when you need mentor approval, ie I would consider a revert of a commit that was approved to have mentor (implicit) type status. It should also document that mentors can grant mentee's implicit commit rights, like phk/bde have for all my MFC's, we (I asked, they granted) agreed that if I had approval to commit it to head I did not need to ask them for each merge to be approved. This one should probably be best a per mentor/mentee type agreement. > Pedro. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat May 11 17:42:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE21F15A30AD; Sat, 11 May 2019 17:42:20 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E265F6A48E; Sat, 11 May 2019 17:42:18 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id PW0dhG4FVldkPPW0fhNHLy; Sat, 11 May 2019 11:42:10 -0600 X-Authority-Analysis: v=2.3 cv=Ko4zJleN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=E5NmQfObTbMA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=VBeeP-sCmbIa2yhBcSAA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 10BFEBE6; Sat, 11 May 2019 10:42:07 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x4BHflBX008851; Sat, 11 May 2019 10:41:47 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x4BHflXP008848; Sat, 11 May 2019 11:41:47 -0600 (MDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201905111741.x4BHflXP008848@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Ian Lepore , Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347488 - head/usr.sbin/ntp/ntpd In-Reply-To: Message from "Rodney W. Grimes" of "Sat, 11 May 2019 09:37:10 -0700." <201905111637.x4BGbAWj032623@gndrsh.dnsmgr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 11 May 2019 11:41:47 -0600 X-CMAE-Envelope: MS4wfNiLVQBFj+t/haQ9+iok+zRViuVaIxjApJ/FvycqNNFx/bk2AQbuBMyqOWjAMCeQ8/IzBw/ixjcx675ziD578WLWyTClOVnl6/8t8QtTVg99jqq1DDE4 J3yNOF7fJTBoulD8fH/6hJP16nooTr7LyY1V3LAxYlRM1ydLKZYWtWin60XQsxoncLeXAlKN7gyoFGATRI5vO2xd3onT/sYLxRXkuvtY8CflR8qiSUYNdgs+ ODdpqGDvrsmex1wYK4gO2O1LtccLef6uHY0e2wCBGUZ4eMJce8KwuD8dyrVoJPF73x5DK3+qD4EsTH1xX85oZKg9bnpipMwB5tAV3OldErdqppmxt5H0cpf+ tj3GhTNW X-Rspamd-Queue-Id: E265F6A48E X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.12 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; REPLYTO_EQ_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.89)[-0.888,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; IP_SCORE(-2.52)[ip: (-6.80), ipnet: 64.59.128.0/20(-3.24), asn: 6327(-2.48), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[9.134.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 17:42:21 -0000 In message <201905111637.x4BGbAWj032623@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > > On Sat, 2019-05-11 at 14:22 +0000, Xin LI wrote: > > > Author: delphij > > > Date: Sat May 11 14:22:21 2019 > > > New Revision: 347488 > > > URL: https://svnweb.freebsd.org/changeset/base/347488 > > > > > > Log: > > > Update leap-seconds to leap-seconds.3757622400. > > > > > > > For future reference: it's a bit better to get this file from NIST [*] > > than from USNO. The USNO boilerplate is full of typos, and USNO > > incorrectly adjusts the "last update date" metadata every time they > > change the expiration date of the file. That's not correct... as the > > boilerplate itself states, that field is only supposed to be updated > > when new leap seconds are added to the file. > > I would be very happy if that information would end up in the > top of, or next to the leap-seconds file so that it was followed > in the future, rather than being folk lore. > > Thanks, > Rod Leap seconds hasn't been updated upstream since 2017. USNO updates the file when they last paid attention to the file by not updating it. NIST only updates the file when there is indeed an update, that being Ian's point. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat May 11 17:54:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F88115A3559; Sat, 11 May 2019 17:54:33 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EBE56AD07; Sat, 11 May 2019 17:54:32 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id PWCVhGCOHldkPPWCWhNIur; Sat, 11 May 2019 11:54:25 -0600 X-Authority-Analysis: v=2.3 cv=Ko4zJleN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=8nJEP1OIZ-IA:10 a=E5NmQfObTbMA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=UHKYGRcFH3URBF6ry7YA:9 a=wPNLvfGTeEIA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id B0E5FC24; Sat, 11 May 2019 10:54:22 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x4BHs3Xh009035; Sat, 11 May 2019 10:54:03 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x4BHrxUA009032; Sat, 11 May 2019 11:53:59 -0600 (MDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201905111753.x4BHrxUA009032@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Andrew Gallatin cc: Kristof Provost , Slawa Olhovchenkov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347410 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf sys/riscv/conf sys/sparc64/conf In-Reply-To: Message from Andrew Gallatin of "Sat, 11 May 2019 09:37:12 -0400." <0c6911b6-6fa0-74cd-8999-c628bc3b2a9d@cs.duke.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Sat, 11 May 2019 11:53:59 -0600 X-CMAE-Envelope: MS4wfIEw+CfyxnfeP1VXq7onBbTIUJ7xuRq/F83IiLJ54LjUP+G6s+SXyYIp8+YMUu/yZK+Wco2mWdyWGmOe+uEcVucRBYEz2arxXldEvzfEE5fkL49fQGj2 nwB++0oyQBttFS2YX0N0mlkJ1k2cgshXb/cVVS07a9zK6d/oCybFxQKLMzz9CS2zL/fAzmqbQKeI106v1uACPt5/tB0pvE8C93h6W4OFPsgcqzzk7E9T48Jr DCMR8hiuOq9GaXMNAa3175+/I7sqsealemBaBQJ3ULOcPi+/hKBhmIqa4sNog/x6Ywx8XFK/67snfUFQqaMXxdp3a1Fp+E7aXwdEwSjB/+4= X-Rspamd-Queue-Id: 3EBE56AD07 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[6]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.90)[-0.900,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.49)[ip: (-6.66), ipnet: 64.59.128.0/20(-3.23), asn: 6327(-2.48), country: CA(-0.09)]; RCVD_IN_DNSWL_LOW(-0.10)[12.134.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 17:54:33 -0000 In message <0c6911b6-6fa0-74cd-8999-c628bc3b2a9d@cs.duke.edu>, Andrew Gallatin writes: > On 2019-05-10 11:50, Kristof Provost wrote: > > On 10 May 2019, at 8:31, Andrew Gallatin wrote: > > > > On 2019-05-10 08:44, Slawa Olhovchenkov wrote: > > > > pf have ifdef for IPSEC, but don't have support IPSEC_SUPPORT > > (netpfil/pf/if_pfsync.c). > > > > Thanks for pointing this out. It seems like IPSEC_SUPPORT would work > > for this. I've made a patch, and it compiles and the pf module loads. > > However, I have no knowledge of how to test it. Is this something > > that you use, and which you can test? > > > > I suspect this code has not actually been enabled for a long time. > > gettdb() doesn’t actually appear to be defined anywhere, so I wouldn’t > > expect it to ever compile. > > > > gettdb() does exist in OpenBSD, so my current guess is that this is just > > an import artefact, and we should |#ifdef OPENBSD| it or something, or > > just remove it completely. > > > > For completeness, and because I never shut up about this: to test pf > > |kldload pfsync|, |cd /usr/tests/sys/netpfil/pf| and |sudo kyua test| > > > > There’s more information in the current edition of the FreeBSD journal. > > > > Regards, > > Kristof > > > > Thanks, you are correct. Including options_ipsec.h reveals that the > code does not even compile (cannot find gettdb(), which does not appear > to be defined anywhere in our tree). > > Given that it is dead code, I'd rather just not touch it. IP Filter zeros out the pointer to rcvif when IPSEC is compiled in. Looking at the upstream code, Darren checks for IPSEC only for BSD based kernels. Zeroing out the pointer only when IPSEC is compiled in, regardless whether the mbuf in question was touched by IPSEC or not seems a little sketchy to me. However I'm inclined to use IPSEC_SUPPORT for now until it can be established whether to keep or remove it. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat May 11 17:59:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE43A15A36DA; Sat, 11 May 2019 17:59:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6154A6AF8E; Sat, 11 May 2019 17:59:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B49D1EFC0; Sat, 11 May 2019 17:59:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BHxEMT088562; Sat, 11 May 2019 17:59:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BHxERX088561; Sat, 11 May 2019 17:59:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905111759.x4BHxERX088561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 11 May 2019 17:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347494 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 347494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6154A6AF8E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 17:59:14 -0000 Author: cy Date: Sat May 11 17:59:13 2019 New Revision: 347494 URL: https://svnweb.freebsd.org/changeset/base/347494 Log: Support the use of the ipsec kld. X-MFC with: r347410 Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat May 11 16:15:13 2019 (r347493) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat May 11 17:59:13 2019 (r347494) @@ -481,7 +481,7 @@ ipf_send_ip(fin, m) default : return EINVAL; } -#ifdef IPSEC +#ifdef IPSEC_SUPPORT m->m_pkthdr.rcvif = NULL; #endif From owner-svn-src-all@freebsd.org Sat May 11 18:25:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A37315A40F1; Sat, 11 May 2019 18:25:17 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C2EB6BF66; Sat, 11 May 2019 18:25:17 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E50081F4A0; Sat, 11 May 2019 18:25:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BIPGT0004762; Sat, 11 May 2019 18:25:16 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BIPFmV004756; Sat, 11 May 2019 18:25:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905111825.x4BIPFmV004756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 11 May 2019 18:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347495 - in stable/12/sys: conf powerpc/include powerpc/powernv powerpc/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in stable/12/sys: conf powerpc/include powerpc/powernv powerpc/powerpc X-SVN-Commit-Revision: 347495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C2EB6BF66 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 18:25:17 -0000 Author: jhibbits Date: Sat May 11 18:25:15 2019 New Revision: 347495 URL: https://svnweb.freebsd.org/changeset/base/347495 Log: MFC r345435: powernv: Add Hypervisor Maintenance Interrupt handler Attempting to build www/firefox on POWER9 resulted in a HMI exception being thrown, a fatal trap currently. This is typically caused by timer facility errors, but examination of the Hypervisor Maintenance Exception Register (HMER) yielded only that an exception had recovered, with no information of the actual exception cause. When an HMI occurs, OPAL_HANDLE_HMI or OPAL_HANDLE_HMI2 must be called to handle the exception at the firmware level. If the exception is handled, we can continue. This adds only the preliminary handler, enough to prevent package building from panicking. An enhancement in the future is to use the flags returned by OPAL_HANDLE_HMI2 to print more useful error messages, and log maintenance events. Added: stable/12/sys/powerpc/powernv/opal_hmi.c - copied unchanged from r345435, head/sys/powerpc/powernv/opal_hmi.c Modified: stable/12/sys/conf/files.powerpc stable/12/sys/powerpc/include/spr.h stable/12/sys/powerpc/include/trap.h stable/12/sys/powerpc/powernv/opal.h stable/12/sys/powerpc/powerpc/interrupt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/files.powerpc ============================================================================== --- stable/12/sys/conf/files.powerpc Sat May 11 17:59:13 2019 (r347494) +++ stable/12/sys/conf/files.powerpc Sat May 11 18:25:15 2019 (r347495) @@ -193,6 +193,7 @@ powerpc/powermac/vcoregpio.c optional powermac powerpc/powernv/opal.c optional powernv powerpc/powernv/opal_console.c optional powernv powerpc/powernv/opal_dev.c optional powernv +powerpc/powernv/opal_hmi.c optional powernv powerpc/powernv/opal_i2c.c optional iicbus fdt powernv powerpc/powernv/opal_i2cm.c optional iicbus fdt powernv powerpc/powernv/opal_pci.c optional powernv pci Modified: stable/12/sys/powerpc/include/spr.h ============================================================================== --- stable/12/sys/powerpc/include/spr.h Sat May 11 17:59:13 2019 (r347494) +++ stable/12/sys/powerpc/include/spr.h Sat May 11 18:25:15 2019 (r347495) @@ -242,6 +242,8 @@ #define LPCR_PECE_ME (1ULL << 12) /* Machine Check and Hypervisor */ /* Maintenance exceptions */ #define SPR_LPID 0x13f /* Logical Partitioning Control */ +#define SPR_HMER 0x150 /* Hypervisor Maintenance Exception Register */ +#define SPR_HMEER 0x151 /* Hypervisor Maintenance Exception Enable Register */ #define SPR_PTCR 0x1d0 /* Partition Table Control Register */ #define SPR_SPEFSCR 0x200 /* ..8 Signal Processing Engine FSCR. */ Modified: stable/12/sys/powerpc/include/trap.h ============================================================================== --- stable/12/sys/powerpc/include/trap.h Sat May 11 17:59:13 2019 (r347494) +++ stable/12/sys/powerpc/include/trap.h Sat May 11 18:25:15 2019 (r347495) @@ -150,6 +150,7 @@ #ifndef LOCORE struct trapframe; struct pcb; +extern int (*hmi_handler)(struct trapframe *); void trap(struct trapframe *); int ppc_instr_emulate(struct trapframe *, struct pcb *); #endif Modified: stable/12/sys/powerpc/powernv/opal.h ============================================================================== --- stable/12/sys/powerpc/powernv/opal.h Sat May 11 17:59:13 2019 (r347494) +++ stable/12/sys/powerpc/powernv/opal.h Sat May 11 18:25:15 2019 (r347495) @@ -71,8 +71,10 @@ int opal_call(uint64_t token, ...); #define OPAL_PCI_MAP_PE_DMA_WINDOW_REAL 45 #define OPAL_RETURN_CPU 69 #define OPAL_REINIT_CPUS 70 +#define OPAL_CHECK_TOKEN 80 #define OPAL_CHECK_ASYNC_COMPLETION 86 #define OPAL_SENSOR_READ 88 +#define OPAL_HANDLE_HMI 98 #define OPAL_IPMI_SEND 107 #define OPAL_IPMI_RECV 108 #define OPAL_I2C_REQUEST 109 @@ -85,6 +87,7 @@ int opal_call(uint64_t token, ...); #define OPAL_SENSOR_GROUP_CLEAR 156 #define OPAL_SENSOR_READ_U64 162 #define OPAL_SENSOR_GROUP_ENABLE 163 +#define OPAL_HANDLE_HMI2 166 /* For OPAL_PCI_SET_PE */ #define OPAL_UNMAP_PE 0 @@ -114,6 +117,15 @@ int opal_call(uint64_t token, ...); #define OPAL_BUSY_EVENT -12 #define OPAL_ASYNC_COMPLETION -15 #define OPAL_EMPTY -16 + +#define OPAL_TOKEN_ABSENT 0 +#define OPAL_TOKEN_PRESENT 1 + +#define OPAL_HMI_FLAGS_TB_RESYNC (1ull << 0) +#define OPAL_HMI_FLAGS_DEC_LOST (1ull << 1) +#define OPAL_HMI_FLAGS_HDEC_LOST (1ull << 2) +#define OPAL_HMI_FLAGS_TOD_TB_FAIL (1ull << 3) +#define OPAL_HMI_FLAGS_NEW_EVENT (1ull << 63) struct opal_msg { uint32_t msg_type; Copied: stable/12/sys/powerpc/powernv/opal_hmi.c (from r345435, head/sys/powerpc/powernv/opal_hmi.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/powerpc/powernv/opal_hmi.c Sat May 11 18:25:15 2019 (r347495, copy of r345435, head/sys/powerpc/powernv/opal_hmi.c) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2019 Justin Hibbits + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include "opal.h" + +static int +opal_hmi_handler2(struct trapframe *frame) +{ + int64_t flags; + int err; + + err = opal_call(OPAL_HANDLE_HMI2, vtophys(&flags)); + + /* XXX: At some point, handle the flags outvar. */ + if (err == OPAL_SUCCESS) { + mtspr(SPR_HMER, 0); + return (0); + } + + printf("HMI handler failed! OPAL error code: %d\n", err); + + return (-1); +} + +static int +opal_hmi_handler(struct trapframe *frame) +{ + int err; + + err = opal_call(OPAL_HANDLE_HMI); + + if (err == OPAL_SUCCESS) { + mtspr(SPR_HMER, 0); + return (0); + } + + printf("HMI handler failed! OPAL error code: %d\n", err); + + return (-1); +} + +static void +opal_setup_hmi(void *data) +{ + /* This only works for OPAL, so first make sure we have it. */ + if (opal_check() != 0) + return; + + if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI2) == OPAL_TOKEN_PRESENT) + hmi_handler = opal_hmi_handler2; + else if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI) == OPAL_TOKEN_PRESENT) + hmi_handler = opal_hmi_handler; + else { + printf("Warning: No OPAL HMI handler found.\n"); + return; + } + + if (bootverbose) + printf("Installed OPAL HMI handler.\n"); +} + +SYSINIT(opal_setup_hmi, SI_SUB_HYPERVISOR, SI_ORDER_ANY, opal_setup_hmi, NULL); Modified: stable/12/sys/powerpc/powerpc/interrupt.c ============================================================================== --- stable/12/sys/powerpc/powerpc/interrupt.c Sat May 11 17:59:13 2019 (r347494) +++ stable/12/sys/powerpc/powerpc/interrupt.c Sat May 11 18:25:15 2019 (r347495) @@ -32,6 +32,7 @@ */ #include "opt_hwpmc_hooks.h" +#include "opt_platform.h" #include /* RCS ID & Copyright macro defns */ @@ -68,6 +69,10 @@ #include "pic_if.h" +#ifdef POWERNV +int (*hmi_handler)(struct trapframe *); +#endif + /* * A very short dispatch, to try and maximise assembler code use * between all exception types. Maybe 'true' interrupts should go @@ -117,6 +122,13 @@ powerpc_interrupt(struct trapframe *framep) pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, framep); critical_exit(); break; +#endif + +#ifdef POWERNV + case EXC_HMI: + if (hmi_handler != 0 && hmi_handler(framep) == 0) + break; + /* If no handler, or failure to handle, just drop to trap. */ #endif default: From owner-svn-src-all@freebsd.org Sat May 11 18:31:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A2BC15A4321; Sat, 11 May 2019 18:31:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F6FA6C490; Sat, 11 May 2019 18:31:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D4C81F4D4; Sat, 11 May 2019 18:31:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BIV6Xl006797; Sat, 11 May 2019 18:31:06 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BIV6pi006793; Sat, 11 May 2019 18:31:06 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905111831.x4BIV6pi006793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 11 May 2019 18:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347496 - in stable/12/sys/powerpc: fpu include powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in stable/12/sys/powerpc: fpu include powerpc X-SVN-Commit-Revision: 347496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F6FA6C490 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 18:31:07 -0000 Author: jhibbits Date: Sat May 11 18:31:05 2019 New Revision: 347496 URL: https://svnweb.freebsd.org/changeset/base/347496 Log: MFC r345829, r345831 r345829: powerpc: Apply r178139 from sparc64 to powerpc's fpu_sqrt This fix was committed less than 2 months after the code was forked into the powerpc kernel. Though powerpc doesn't use quad-precision floating point, or need it for emulation, the changes do look like correctness fixes overall. This was found while trying to get fsqrt emulation working on e5500, which does have a real FPU, but lacks the fsqrt instruction. This is not the complete fix, the rest is to be committed separately. r345831: powerpc: Allow emulating optional FPU instructions on CPUs with an FPU The e5500 has an FPU, but lacks the optional fsqrt instruction. This instruction gets emulated in the kernel, but the emulation uses stale data, from the last switch out, and does not return the result of the operation immediately. Fix both of these conditions by saving and restoring the FPRs around the emulation point. Modified: stable/12/sys/powerpc/fpu/fpu_sqrt.c stable/12/sys/powerpc/include/trap.h stable/12/sys/powerpc/powerpc/exec_machdep.c stable/12/sys/powerpc/powerpc/trap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/fpu/fpu_sqrt.c ============================================================================== --- stable/12/sys/powerpc/fpu/fpu_sqrt.c Sat May 11 18:25:15 2019 (r347495) +++ stable/12/sys/powerpc/fpu/fpu_sqrt.c Sat May 11 18:31:05 2019 (r347496) @@ -353,7 +353,7 @@ fpu_sqrt(struct fpemu *fe) FPU_SUBC(d0, x0, t0); if ((int)d0 >= 0) { x0 = d0, x1 = d1, x2 = d2; - q |= bit; + q = bit; y1 |= 1; /* now t1, y1 are set in concrete */ } ODD_DOUBLE; @@ -385,12 +385,12 @@ fpu_sqrt(struct fpemu *fe) FPU_SUBCS(d2, x2, t2); FPU_SUBCS(d1, x1, t1); FPU_SUBC(d0, x0, t0); - ODD_DOUBLE; if ((int)d0 >= 0) { - x0 = d0, x1 = d1, x2 = d2; - q |= bit; + x0 = d0, x1 = d1, x2 = d2; x3 = d3; + q = bit; y2 |= 1; } + ODD_DOUBLE; while ((bit >>= 1) != 0) { EVEN_DOUBLE; t3 = y3 | bit; @@ -399,7 +399,7 @@ fpu_sqrt(struct fpemu *fe) FPU_SUBCS(d1, x1, t1); FPU_SUBC(d0, x0, t0); if ((int)d0 >= 0) { - x0 = d0, x1 = d1, x2 = d2; + x0 = d0, x1 = d1, x2 = d2; x3 = d3; q |= bit; y3 |= bit << 1; } Modified: stable/12/sys/powerpc/include/trap.h ============================================================================== --- stable/12/sys/powerpc/include/trap.h Sat May 11 18:25:15 2019 (r347495) +++ stable/12/sys/powerpc/include/trap.h Sat May 11 18:31:05 2019 (r347496) @@ -149,10 +149,10 @@ #ifndef LOCORE struct trapframe; -struct pcb; +struct thread; extern int (*hmi_handler)(struct trapframe *); void trap(struct trapframe *); -int ppc_instr_emulate(struct trapframe *, struct pcb *); +int ppc_instr_emulate(struct trapframe *, struct thread *); #endif #endif /* _POWERPC_TRAP_H_ */ Modified: stable/12/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- stable/12/sys/powerpc/powerpc/exec_machdep.c Sat May 11 18:25:15 2019 (r347495) +++ stable/12/sys/powerpc/powerpc/exec_machdep.c Sat May 11 18:31:05 2019 (r347496) @@ -1066,8 +1066,9 @@ emulate_mtspr(int spr, int reg, struct trapframe *fram #define XFX 0xFC0007FF int -ppc_instr_emulate(struct trapframe *frame, struct pcb *pcb) +ppc_instr_emulate(struct trapframe *frame, struct thread *td) { + struct pcb *pcb; uint32_t instr; int reg, sig; int rs, spr; @@ -1094,12 +1095,16 @@ ppc_instr_emulate(struct trapframe *frame, struct pcb return (0); } + pcb = td->td_pcb; #ifdef FPU_EMU if (!(pcb->pcb_flags & PCB_FPREGS)) { bzero(&pcb->pcb_fpu, sizeof(pcb->pcb_fpu)); pcb->pcb_flags |= PCB_FPREGS; - } + } else if (pcb->pcb_flags & PCB_FPU) + save_fpu(td); sig = fpu_emulate(frame, &pcb->pcb_fpu); + if ((sig == 0 || sig == SIGFPE) && pcb->pcb_flags & PCB_FPU) + enable_fpu(td); #endif return (sig); Modified: stable/12/sys/powerpc/powerpc/trap.c ============================================================================== --- stable/12/sys/powerpc/powerpc/trap.c Sat May 11 18:25:15 2019 (r347495) +++ stable/12/sys/powerpc/powerpc/trap.c Sat May 11 18:31:05 2019 (r347496) @@ -361,7 +361,7 @@ trap(struct trapframe *frame) sig = SIGTRAP; ucode = TRAP_BRKPT; } else { - sig = ppc_instr_emulate(frame, td->td_pcb); + sig = ppc_instr_emulate(frame, td); if (sig == SIGILL) { if (frame->srr1 & EXC_PGM_PRIV) ucode = ILL_PRVOPC; From owner-svn-src-all@freebsd.org Sat May 11 18:32:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F6E415A44F1; Sat, 11 May 2019 18:32:26 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E21586C6BC; Sat, 11 May 2019 18:32:24 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id PWnFhGWxGldkPPWnHhNOEG; Sat, 11 May 2019 12:32:23 -0600 X-Authority-Analysis: v=2.3 cv=Ko4zJleN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=E5NmQfObTbMA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=41QTrZrepE1UAMXdfFcA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id E05E4CD9; Sat, 11 May 2019 11:32:20 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x4BIW03P042562; Sat, 11 May 2019 11:32:00 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x4BIW0R9042050; Sat, 11 May 2019 12:32:00 -0600 (MDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201905111832.x4BIW0R9042050@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ian Lepore cc: Doug Moore , Cy Schubert , Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347477 - head/sys/kern In-Reply-To: Message from Ian Lepore of "Sat, 11 May 2019 08:45:06 -0600." <82d76aafd3c93bc2ad2d0e04a761e2628ff1e257.camel@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 11 May 2019 12:31:59 -0600 X-CMAE-Envelope: MS4wfJiIPvRQVBimgTsqrO+iv6qZhcdFfJQSqdD3Bivo+1k9hAy3Tg1YQIYVy3dkDs5kjVbMwfo8vLL7uJUDnOmk8+kOeUho1rGq5MfjbcDrY34uJ0XHJoV0 gEPitR2PFYYmj43+MPZu410oS2U8jWpMdla4TNQVUBwr/5nEVZ17O9BmP12NUVX966hQLuBMP04sazJ9Ff4lt1fF96pBgd39OzRKLfOIPqPXZgbpP+T/zI9M jBobiGnkI5jY0bVsMbahKqnIPW4QRX8/uAPUZzyn8i36qNNX2GuAbVMc0hTUz2SSYKaqEUA5te6PzuHkWgnIm9cVWVZyAN+uFqUCRqRsYsxpYEkfRYWmMyVV SvuInprt X-Rspamd-Queue-Id: E21586C6BC X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.09 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_XAW(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.90)[-0.895,0]; RCPT_COUNT_SEVEN(0.00)[7]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_LOW(-0.10)[12.134.59.64.list.dnswl.org : 127.0.5.1]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-2.48)[ip: (-6.63), ipnet: 64.59.128.0/20(-3.23), asn: 6327(-2.48), country: CA(-0.09)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 18:32:26 -0000 In message <82d76aafd3c93bc2ad2d0e04a761e2628ff1e257.camel@freebsd.org> , Ian Le pore writes: > On Fri, 2019-05-10 at 23:57 -0500, Doug Moore wrote: > > With mentor approval, I commit r347469. I start getting email about > > jenkins failure to build for several architectures on account of the > > _Generic() construct I introduced in that change. > > > > I whip up a patch to undo that part of r347469, and ask for mentor > > approval. Meanwhile, mentor authorizes me in email to revert > > r347469. > > > > I try apply applying the fix-patch, and get email that it was > > rejected > > for lack of reviewer. In retrospect, it seems to have been committed > > anyway as r347472. > > > > Thinking that things are still broken, I do what my mentor pre- > > approved > > earlier and revert back to before r347469. A patch to redo r347469, > > without _Generic(), awaits mentor approval. > > > > I realize that breaking the build and then committing without mentor > > approval in my first week as committer isn't a good beginning. > > Sorry > > about that. > > > > At least I have no social media presence, so there's that. > > > > Doug Moore > > > > > > The important point is that the commit message should have said why. > It doesn't have to be a whole novel, just something like "because > _Generic() isn't supported on all platforms" would've been good. > > In general, for every commit, I ask myself "If someone 3 years from now > is debugging a problem and they're looking at the changes that have > happened to this code over time, will my commit message be helpful to > that process?" Very often in that situation, what the person needs to > know isn't "what changed" so much as "why did this change happen?" I totally agree. I am that guy reviewing commits, not just FreeBSD commits but those of other open source projects and at $JOB as well. Sure, reading the code provides the complete story however when pressed for time one must prioritize what to look at first. Touching on another log message issue, some of the most time consuming are other open source project commits which say "pull request from ..." which make more than one alteration in the same commit. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat May 11 19:31:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79A0B15A5B21; Sat, 11 May 2019 19:31:55 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2130B6E9CD; Sat, 11 May 2019 19:31:55 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFB4D1FF09; Sat, 11 May 2019 19:31:54 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BJVsbE043017; Sat, 11 May 2019 19:31:54 GMT (envelope-from schweikh@FreeBSD.org) Received: (from schweikh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BJVsmp043016; Sat, 11 May 2019 19:31:54 GMT (envelope-from schweikh@FreeBSD.org) Message-Id: <201905111931.x4BJVsmp043016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: schweikh set sender to schweikh@FreeBSD.org using -f From: Jens Schweikhardt Date: Sat, 11 May 2019 19:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347497 - head X-SVN-Group: head X-SVN-Commit-Author: schweikh X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 347497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2130B6E9CD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 19:31:55 -0000 Author: schweikh Date: Sat May 11 19:31:54 2019 New Revision: 347497 URL: https://svnweb.freebsd.org/changeset/base/347497 Log: Correct a handful of typos. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat May 11 18:31:05 2019 (r347496) +++ head/UPDATING Sat May 11 19:31:54 2019 (r347497) @@ -92,7 +92,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: The fuse(4) module has been renamed to fusefs(4) for consistency with other filesystems. You should update any kld_load="fuse" entries in /etc/rc.conf, fuse_load="YES" entries in /boot/loader.conf, and - "options FUSE" enties in kernel config files. + "options FUSE" entries in kernel config files. 20190304: Clang, llvm, lld, lldb, compiler-rt and libc++ have been upgraded to @@ -156,7 +156,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: 20181211: Remove the timed and netdate programs from the base tree. Setting - the time with these deamons has been obsolete for over a decade. + the time with these daemons has been obsolete for over a decade. 20181126: On amd64, arm64 and armv7 (architectures that install LLVM's ld.lld @@ -219,7 +219,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: 20181009: OpenSSL has been updated to version 1.1.1. This update included - additional various API changes througout the base system. It is + additional various API changes throughout the base system. It is important to rebuild third-party software after upgrading. The value of __FreeBSD_version has been bumped accordingly. @@ -316,13 +316,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: 20180719: ARM64 now have efifb support, if you want to have serial console on your arm64 board when an screen is connected and the bootloader - setup a framebuffer for us to use, just add : + setup a frame buffer for us to use, just add : boot_serial=YES boot_multicons=YES in /boot/loader.conf For Raspberry Pi 3 (RPI) users, this is needed even if you don't have - an screen connected as the firmware will setup a framebuffer are that - u-boot will expose as an EFI framebuffer. + an screen connected as the firmware will setup a frame buffer are that + u-boot will expose as an EFI frame buffer. 20180719: New uid:gid added, ntpd:ntpd (123:123). Be sure to run mergemaster @@ -421,7 +421,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: 20180508: The nxge(4) driver has been removed. This driver was for PCI-X 10g - cards made by s2io/Neterion. The company was aquired by Exar and + cards made by s2io/Neterion. The company was acquired by Exar and no longer sells or supports Ethernet products. If you have device nxge in your kernel config file it must be removed. @@ -512,7 +512,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: 20180212: FreeBSD boot loader enhanced with Lua scripting. It's purely opt-in for now by building WITH_LOADER_LUA and WITHOUT_FORTH in /etc/src.conf. - Co-existance for the transition period will come shortly. Booting is a + Co-existence for the transition period will come shortly. Booting is a complex environment and test coverage for Lua-enabled loaders has been thin, so it would be prudent to assume it might not work and make provisions for backup boot methods. From owner-svn-src-all@freebsd.org Sat May 11 22:42:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D174B15A944D; Sat, 11 May 2019 22:41:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FEEA747A6; Sat, 11 May 2019 22:41:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DF4D21F8E; Sat, 11 May 2019 22:41:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4BMfxL3042557; Sat, 11 May 2019 22:41:59 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4BMfxOE042556; Sat, 11 May 2019 22:41:59 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905112241.x4BMfxOE042556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 11 May 2019 22:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347498 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 347498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6FEEA747A6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2019 22:42:00 -0000 Author: rmacklem Date: Sat May 11 22:41:58 2019 New Revision: 347498 URL: https://svnweb.freebsd.org/changeset/base/347498 Log: Factor code into two new functions in preparation for a future commit. Factor code into two functions. read_exportfile() a functon which reads the exports file(s) and calls get_exportlist_one() to process each of them. delete_export() a function which deletes the exports in the kernel for a file system. The contents of these functions is just the same code as was used to do the operations, moved into separate functions. As such, there is no semantic change. This is being done in preparation for a future commit that will add an option to do incremental changes of kernel exports upon receiving SIGHUP. MFC after: 1 month Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Sat May 11 19:31:54 2019 (r347497) +++ head/usr.sbin/mountd/mountd.c Sat May 11 22:41:58 2019 (r347498) @@ -200,6 +200,8 @@ static void free_host(struct hostlist *); static void get_exportlist(void); static void insert_exports(struct exportlist *, struct exportlisthead *); static void free_exports(struct exportlisthead *); +static void read_exportfile(void); +static void delete_export(struct iovec *, int, struct statfs *, char *); static int get_host(char *, struct grouplist *, struct grouplist *); static struct hostlist *get_ht(void); static int get_line(void); @@ -1721,12 +1723,10 @@ get_exportlist(void) struct grouplist *grp, *tgrp; struct export_args export; struct iovec *iov; - struct statfs *fsp, *mntbufp; - struct xvfsconf vfc; + struct statfs *mntbufp; char errmsg[255]; int num, i; int iovlen; - int done; struct nfsex_args eargs; if (suspend_nfsd != 0) @@ -1781,48 +1781,9 @@ get_exportlist(void) build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); } - for (i = 0; i < num; i++) { - fsp = &mntbufp[i]; - if (getvfsbyname(fsp->f_fstypename, &vfc) != 0) { - syslog(LOG_ERR, "getvfsbyname() failed for %s", - fsp->f_fstypename); - continue; - } + for (i = 0; i < num; i++) + delete_export(iov, iovlen, &mntbufp[i], errmsg); - /* - * We do not need to delete "export" flag from - * filesystems that do not have it set. - */ - if (!(fsp->f_flags & MNT_EXPORTED)) - continue; - /* - * Do not delete export for network filesystem by - * passing "export" arg to nmount(). - * It only makes sense to do this for local filesystems. - */ - if (vfc.vfc_flags & VFCF_NETWORK) - continue; - - iov[1].iov_base = fsp->f_fstypename; - iov[1].iov_len = strlen(fsp->f_fstypename) + 1; - iov[3].iov_base = fsp->f_mntonname; - iov[3].iov_len = strlen(fsp->f_mntonname) + 1; - iov[5].iov_base = fsp->f_mntfromname; - iov[5].iov_len = strlen(fsp->f_mntfromname) + 1; - errmsg[0] = '\0'; - - /* - * EXDEV is returned when path exists but is not a - * mount point. May happens if raced with unmount. - */ - if (nmount(iov, iovlen, fsp->f_flags) < 0 && - errno != ENOENT && errno != ENOTSUP && errno != EXDEV) { - syslog(LOG_ERR, - "can't delete exports for %s: %m %s", - fsp->f_mntonname, errmsg); - } - } - if (iov != NULL) { /* Free strings allocated by strdup() in getmntopts.c */ free(iov[0].iov_base); /* fstype */ @@ -1837,26 +1798,7 @@ get_exportlist(void) iovlen = 0; } - /* - * Read in the exports file and build the list, calling - * nmount() as we go along to push the export rules into the kernel. - */ - done = 0; - for (i = 0; exnames[i] != NULL; i++) { - if (debug) - warnx("reading exports from %s", exnames[i]); - if ((exp_file = fopen(exnames[i], "r")) == NULL) { - syslog(LOG_WARNING, "can't open %s", exnames[i]); - continue; - } - get_exportlist_one(); - fclose(exp_file); - done++; - } - if (done == 0) { - syslog(LOG_ERR, "can't open any exports file"); - exit(2); - } + read_exportfile(); /* * If there was no public fh, clear any previous one set. @@ -1891,6 +1833,84 @@ free_exports(struct exportlisthead *exhp) free_exp(ep); } SLIST_INIT(exhp); +} + +/* + * Read the exports file(s) and call get_exportlist_one() for each line. + */ +static void +read_exportfile(void) +{ + int done, i; + + /* + * Read in the exports file and build the list, calling + * nmount() as we go along to push the export rules into the kernel. + */ + done = 0; + for (i = 0; exnames[i] != NULL; i++) { + if (debug) + warnx("reading exports from %s", exnames[i]); + if ((exp_file = fopen(exnames[i], "r")) == NULL) { + syslog(LOG_WARNING, "can't open %s", exnames[i]); + continue; + } + get_exportlist_one(); + fclose(exp_file); + done++; + } + if (done == 0) { + syslog(LOG_ERR, "can't open any exports file"); + exit(2); + } +} + +/* + * Delete an exports entry. + */ +static void +delete_export(struct iovec *iov, int iovlen, struct statfs *fsp, char *errmsg) +{ + struct xvfsconf vfc; + + if (getvfsbyname(fsp->f_fstypename, &vfc) != 0) { + syslog(LOG_ERR, "getvfsbyname() failed for %s", + fsp->f_fstypename); + return; + } + + /* + * We do not need to delete "export" flag from + * filesystems that do not have it set. + */ + if (!(fsp->f_flags & MNT_EXPORTED)) + return; + /* + * Do not delete export for network filesystem by + * passing "export" arg to nmount(). + * It only makes sense to do this for local filesystems. + */ + if (vfc.vfc_flags & VFCF_NETWORK) + return; + + iov[1].iov_base = fsp->f_fstypename; + iov[1].iov_len = strlen(fsp->f_fstypename) + 1; + iov[3].iov_base = fsp->f_mntonname; + iov[3].iov_len = strlen(fsp->f_mntonname) + 1; + iov[5].iov_base = fsp->f_mntfromname; + iov[5].iov_len = strlen(fsp->f_mntfromname) + 1; + errmsg[0] = '\0'; + + /* + * EXDEV is returned when path exists but is not a + * mount point. May happens if raced with unmount. + */ + if (nmount(iov, iovlen, fsp->f_flags) < 0 && errno != ENOENT && + errno != ENOTSUP && errno != EXDEV) { + syslog(LOG_ERR, + "can't delete exports for %s: %m %s", + fsp->f_mntonname, errmsg); + } } /*