From owner-svn-src-stable@freebsd.org Sun Feb 23 03:13:40 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 230B3256E99; Sun, 23 Feb 2020 03:13:40 +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 48Q9JM6f83z4CDw; Sun, 23 Feb 2020 03:13:39 +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 D39DB6004; Sun, 23 Feb 2020 03:13:39 +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 01N3DdSK071790; Sun, 23 Feb 2020 03:13:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01N3DcAD071785; Sun, 23 Feb 2020 03:13:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002230313.01N3DcAD071785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 23 Feb 2020 03:13: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: r358255 - in stable: 11/usr.sbin/cron/cron 11/usr.sbin/cron/lib 12/usr.sbin/cron/cron 12/usr.sbin/cron/lib X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/cron/cron 11/usr.sbin/cron/lib 12/usr.sbin/cron/cron 12/usr.sbin/cron/lib X-SVN-Commit-Revision: 358255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2020 03:13:40 -0000 Author: kevans Date: Sun Feb 23 03:13:38 2020 New Revision: 358255 URL: https://svnweb.freebsd.org/changeset/base/358255 Log: MFC r357714-r357715: cron(8): rip out some legacy bits r357714: cron(8): convert vfork() usage to fork() vfork() is error-prone, and the usage here definitely grew to not be clearly OK given vfork-semantics; e.g. setusercontext(3) within the child. Rip out vfork() and the rest of the references to it. fork is heavier, but it's unclear that the difference will be all that obvious. Reported by: Andrew Gierth and sigsys@gmail.com r357715: cron(8): rip out do_univ This was an old Dynix hack, the function is a NOP on FreeBSD. We have no need to retain this; Dynix was discontinued long ago. Modified: stable/11/usr.sbin/cron/cron/compat.h stable/11/usr.sbin/cron/cron/do_command.c stable/11/usr.sbin/cron/cron/externs.h stable/11/usr.sbin/cron/cron/popen.c stable/11/usr.sbin/cron/lib/compat.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/cron/cron/compat.h stable/12/usr.sbin/cron/cron/do_command.c stable/12/usr.sbin/cron/cron/externs.h stable/12/usr.sbin/cron/cron/popen.c stable/12/usr.sbin/cron/lib/compat.c Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/cron/cron/compat.h ============================================================================== --- stable/11/usr.sbin/cron/cron/compat.h Sat Feb 22 23:36:10 2020 (r358254) +++ stable/11/usr.sbin/cron/cron/compat.h Sun Feb 23 03:13:38 2020 (r358255) @@ -76,10 +76,6 @@ /*****************************************************************/ -#if !defined(BSD) && !defined(HPUX) && !defined(CONVEX) && !defined(__linux) -# define NEED_VFORK -#endif - #if (!defined(BSD) || (BSD < 198902)) && !defined(__linux) && \ !defined(IRIX) && !defined(NeXT) && !defined(HPUX) # define NEED_STRCASECMP Modified: stable/11/usr.sbin/cron/cron/do_command.c ============================================================================== --- stable/11/usr.sbin/cron/cron/do_command.c Sat Feb 22 23:36:10 2020 (r358254) +++ stable/11/usr.sbin/cron/cron/do_command.c Sun Feb 23 03:13:38 2020 (r358255) @@ -38,8 +38,7 @@ static const char rcsid[] = #endif -static void child_process(entry *, user *), - do_univ(user *); +static void child_process(entry *, user *); static WAIT_T wait_on_child(PID_T, const char *); @@ -56,9 +55,6 @@ do_command(e, u) /* fork to become asynchronous -- parent process is done immediately, * and continues to run the normal cron code, which means return to * tick(). the child and grandchild don't leave this function, alive. - * - * vfork() is unsuitable, since we have much to do, and the parent - * needs to be able to run off and fork other processes. */ switch ((pid = fork())) { case -1: @@ -220,13 +216,13 @@ child_process(e, u) /* fork again, this time so we can exec the user's command. */ - switch (jobpid = vfork()) { + switch (jobpid = fork()) { case -1: - log_it("CRON",getpid(),"error","can't vfork"); + log_it("CRON",getpid(),"error","can't fork"); exit(ERROR_EXIT); /*NOTREACHED*/ case 0: - Debug(DPROC, ("[%d] grandchild process Vfork()'ed\n", + Debug(DPROC, ("[%d] grandchild process fork()'ed\n", getpid())) if (e->uid == ROOT_UID) @@ -279,12 +275,6 @@ child_process(e, u) close(stdin_pipe[READ_PIPE]); close(stdout_pipe[WRITE_PIPE]); - /* set our login universe. Do this in the grandchild - * so that the child can invoke /usr/lib/sendmail - * without surprises. - */ - do_univ(u); - # if defined(LOGIN_CAP) /* Set user's entire context, but skip the environment * as cron provides a separate interface for this @@ -311,24 +301,24 @@ child_process(e, u) if (setgid(e->gid) != 0) { log_it(usernm, getpid(), "error", "setgid failed"); - exit(ERROR_EXIT); + _exit(ERROR_EXIT); } # if defined(BSD) if (initgroups(usernm, e->gid) != 0) { log_it(usernm, getpid(), "error", "initgroups failed"); - exit(ERROR_EXIT); + _exit(ERROR_EXIT); } # endif if (setlogin(usernm) != 0) { log_it(usernm, getpid(), "error", "setlogin failed"); - exit(ERROR_EXIT); + _exit(ERROR_EXIT); } if (setuid(e->uid) != 0) { log_it(usernm, getpid(), "error", "setuid failed"); - exit(ERROR_EXIT); + _exit(ERROR_EXIT); } /* we aren't root after this..*/ #if defined(LOGIN_CAP) @@ -626,42 +616,4 @@ wait_on_child(PID_T childpid, const char *name) { Debug(DPROC, ("\n")) return waiter; -} - - -static void -do_univ(u) - user *u; -{ -#if defined(sequent) -/* Dynix (Sequent) hack to put the user associated with - * the passed user structure into the ATT universe if - * necessary. We have to dig the gecos info out of - * the user's password entry to see if the magic - * "universe(att)" string is present. - */ - - struct passwd *p; - char *s; - int i; - - p = getpwuid(u->uid); - (void) endpwent(); - - if (p == NULL) - return; - - s = p->pw_gecos; - - for (i = 0; i < 4; i++) - { - if ((s = strchr(s, ',')) == NULL) - return; - s++; - } - if (strcmp(s, "universe(att)")) - return; - - (void) universe(U_ATT); -#endif } Modified: stable/11/usr.sbin/cron/cron/externs.h ============================================================================== --- stable/11/usr.sbin/cron/cron/externs.h Sat Feb 22 23:36:10 2020 (r358254) +++ stable/11/usr.sbin/cron/cron/externs.h Sun Feb 23 03:13:38 2020 (r358255) @@ -141,7 +141,3 @@ extern int getdtablesize(void); #ifdef NEED_SETENV extern int setenv(char *, char *, int); #endif - -#ifdef NEED_VFORK -extern PID_T vfork(void); -#endif Modified: stable/11/usr.sbin/cron/cron/popen.c ============================================================================== --- stable/11/usr.sbin/cron/cron/popen.c Sat Feb 22 23:36:10 2020 (r358254) +++ stable/11/usr.sbin/cron/cron/popen.c Sun Feb 23 03:13:38 2020 (r358255) @@ -112,7 +112,7 @@ cron_popen(program, type, e, pidptr) #endif iop = NULL; - switch(pid = vfork()) { + switch(pid = fork()) { case -1: /* error */ (void)close(pdes[0]); (void)close(pdes[1]); Modified: stable/11/usr.sbin/cron/lib/compat.c ============================================================================== --- stable/11/usr.sbin/cron/lib/compat.c Sat Feb 22 23:36:10 2020 (r358254) +++ stable/11/usr.sbin/cron/lib/compat.c Sun Feb 23 03:13:38 2020 (r358255) @@ -35,18 +35,6 @@ static char rcsid[] = "$FreeBSD$"; #include -/* the code does not depend on any of vfork's - * side-effects; it just uses it as a quick - * fork-and-exec. - */ -#ifdef NEED_VFORK -PID_T -vfork() { - return (fork()); -} -#endif - - #ifdef NEED_STRDUP char * strdup(str) From owner-svn-src-stable@freebsd.org Sun Feb 23 03:13:41 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41754256E9F; Sun, 23 Feb 2020 03:13:41 +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 48Q9JP0SKgz4CHY; Sun, 23 Feb 2020 03:13:41 +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 028F56005; Sun, 23 Feb 2020 03:13:41 +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 01N3Detm071801; Sun, 23 Feb 2020 03:13:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01N3Dex8071796; Sun, 23 Feb 2020 03:13:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002230313.01N3Dex8071796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 23 Feb 2020 03:13: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: r358255 - in stable: 11/usr.sbin/cron/cron 11/usr.sbin/cron/lib 12/usr.sbin/cron/cron 12/usr.sbin/cron/lib X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/cron/cron 11/usr.sbin/cron/lib 12/usr.sbin/cron/cron 12/usr.sbin/cron/lib X-SVN-Commit-Revision: 358255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2020 03:13:41 -0000 Author: kevans Date: Sun Feb 23 03:13:38 2020 New Revision: 358255 URL: https://svnweb.freebsd.org/changeset/base/358255 Log: MFC r357714-r357715: cron(8): rip out some legacy bits r357714: cron(8): convert vfork() usage to fork() vfork() is error-prone, and the usage here definitely grew to not be clearly OK given vfork-semantics; e.g. setusercontext(3) within the child. Rip out vfork() and the rest of the references to it. fork is heavier, but it's unclear that the difference will be all that obvious. Reported by: Andrew Gierth and sigsys@gmail.com r357715: cron(8): rip out do_univ This was an old Dynix hack, the function is a NOP on FreeBSD. We have no need to retain this; Dynix was discontinued long ago. Modified: stable/12/usr.sbin/cron/cron/compat.h stable/12/usr.sbin/cron/cron/do_command.c stable/12/usr.sbin/cron/cron/externs.h stable/12/usr.sbin/cron/cron/popen.c stable/12/usr.sbin/cron/lib/compat.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/cron/cron/compat.h stable/11/usr.sbin/cron/cron/do_command.c stable/11/usr.sbin/cron/cron/externs.h stable/11/usr.sbin/cron/cron/popen.c stable/11/usr.sbin/cron/lib/compat.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/cron/cron/compat.h ============================================================================== --- stable/12/usr.sbin/cron/cron/compat.h Sat Feb 22 23:36:10 2020 (r358254) +++ stable/12/usr.sbin/cron/cron/compat.h Sun Feb 23 03:13:38 2020 (r358255) @@ -76,10 +76,6 @@ /*****************************************************************/ -#if !defined(BSD) && !defined(HPUX) && !defined(CONVEX) && !defined(__linux) -# define NEED_VFORK -#endif - #if (!defined(BSD) || (BSD < 198902)) && !defined(__linux) && \ !defined(IRIX) && !defined(NeXT) && !defined(HPUX) # define NEED_STRCASECMP Modified: stable/12/usr.sbin/cron/cron/do_command.c ============================================================================== --- stable/12/usr.sbin/cron/cron/do_command.c Sat Feb 22 23:36:10 2020 (r358254) +++ stable/12/usr.sbin/cron/cron/do_command.c Sun Feb 23 03:13:38 2020 (r358255) @@ -38,8 +38,7 @@ static const char rcsid[] = #endif -static void child_process(entry *, user *), - do_univ(user *); +static void child_process(entry *, user *); static WAIT_T wait_on_child(PID_T, const char *); @@ -56,9 +55,6 @@ do_command(e, u) /* fork to become asynchronous -- parent process is done immediately, * and continues to run the normal cron code, which means return to * tick(). the child and grandchild don't leave this function, alive. - * - * vfork() is unsuitable, since we have much to do, and the parent - * needs to be able to run off and fork other processes. */ switch ((pid = fork())) { case -1: @@ -220,13 +216,13 @@ child_process(e, u) /* fork again, this time so we can exec the user's command. */ - switch (jobpid = vfork()) { + switch (jobpid = fork()) { case -1: - log_it("CRON",getpid(),"error","can't vfork"); + log_it("CRON",getpid(),"error","can't fork"); exit(ERROR_EXIT); /*NOTREACHED*/ case 0: - Debug(DPROC, ("[%d] grandchild process Vfork()'ed\n", + Debug(DPROC, ("[%d] grandchild process fork()'ed\n", getpid())) if (e->uid == ROOT_UID) @@ -279,12 +275,6 @@ child_process(e, u) close(stdin_pipe[READ_PIPE]); close(stdout_pipe[WRITE_PIPE]); - /* set our login universe. Do this in the grandchild - * so that the child can invoke /usr/lib/sendmail - * without surprises. - */ - do_univ(u); - # if defined(LOGIN_CAP) /* Set user's entire context, but skip the environment * as cron provides a separate interface for this @@ -311,24 +301,24 @@ child_process(e, u) if (setgid(e->gid) != 0) { log_it(usernm, getpid(), "error", "setgid failed"); - exit(ERROR_EXIT); + _exit(ERROR_EXIT); } # if defined(BSD) if (initgroups(usernm, e->gid) != 0) { log_it(usernm, getpid(), "error", "initgroups failed"); - exit(ERROR_EXIT); + _exit(ERROR_EXIT); } # endif if (setlogin(usernm) != 0) { log_it(usernm, getpid(), "error", "setlogin failed"); - exit(ERROR_EXIT); + _exit(ERROR_EXIT); } if (setuid(e->uid) != 0) { log_it(usernm, getpid(), "error", "setuid failed"); - exit(ERROR_EXIT); + _exit(ERROR_EXIT); } /* we aren't root after this..*/ #if defined(LOGIN_CAP) @@ -626,42 +616,4 @@ wait_on_child(PID_T childpid, const char *name) { Debug(DPROC, ("\n")) return waiter; -} - - -static void -do_univ(u) - user *u; -{ -#if defined(sequent) -/* Dynix (Sequent) hack to put the user associated with - * the passed user structure into the ATT universe if - * necessary. We have to dig the gecos info out of - * the user's password entry to see if the magic - * "universe(att)" string is present. - */ - - struct passwd *p; - char *s; - int i; - - p = getpwuid(u->uid); - (void) endpwent(); - - if (p == NULL) - return; - - s = p->pw_gecos; - - for (i = 0; i < 4; i++) - { - if ((s = strchr(s, ',')) == NULL) - return; - s++; - } - if (strcmp(s, "universe(att)")) - return; - - (void) universe(U_ATT); -#endif } Modified: stable/12/usr.sbin/cron/cron/externs.h ============================================================================== --- stable/12/usr.sbin/cron/cron/externs.h Sat Feb 22 23:36:10 2020 (r358254) +++ stable/12/usr.sbin/cron/cron/externs.h Sun Feb 23 03:13:38 2020 (r358255) @@ -141,7 +141,3 @@ extern int getdtablesize(void); #ifdef NEED_SETENV extern int setenv(char *, char *, int); #endif - -#ifdef NEED_VFORK -extern PID_T vfork(void); -#endif Modified: stable/12/usr.sbin/cron/cron/popen.c ============================================================================== --- stable/12/usr.sbin/cron/cron/popen.c Sat Feb 22 23:36:10 2020 (r358254) +++ stable/12/usr.sbin/cron/cron/popen.c Sun Feb 23 03:13:38 2020 (r358255) @@ -112,7 +112,7 @@ cron_popen(program, type, e, pidptr) #endif iop = NULL; - switch(pid = vfork()) { + switch(pid = fork()) { case -1: /* error */ (void)close(pdes[0]); (void)close(pdes[1]); Modified: stable/12/usr.sbin/cron/lib/compat.c ============================================================================== --- stable/12/usr.sbin/cron/lib/compat.c Sat Feb 22 23:36:10 2020 (r358254) +++ stable/12/usr.sbin/cron/lib/compat.c Sun Feb 23 03:13:38 2020 (r358255) @@ -35,18 +35,6 @@ static char rcsid[] = "$FreeBSD$"; #include -/* the code does not depend on any of vfork's - * side-effects; it just uses it as a quick - * fork-and-exec. - */ -#ifdef NEED_VFORK -PID_T -vfork() { - return (fork()); -} -#endif - - #ifdef NEED_STRDUP char * strdup(str) From owner-svn-src-stable@freebsd.org Sun Feb 23 15:18:30 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09EBD23F6BE; Sun, 23 Feb 2020 15:18:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48QTNj16yyz4BnR; Sun, 23 Feb 2020 15:18:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEE66E611; Sun, 23 Feb 2020 15:18:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01NFIS3r006357; Sun, 23 Feb 2020 15:18:28 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01NFISn2006356; Sun, 23 Feb 2020 15:18:28 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202002231518.01NFISn2006356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 23 Feb 2020 15:18: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: r358259 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 358259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2020 15:18:30 -0000 Author: pfg Date: Sun Feb 23 15:18:28 2020 New Revision: 358259 URL: https://svnweb.freebsd.org/changeset/base/358259 Log: MFC r357414, r357415, r357417, r357423, r357424, r357587, r357655: ethernet: add some more Ethertypes. Add some types based on other BSDs and also add EtherCat, PROFINET, Powerlink and Sercos III which are IEC standards. There is a public list (CSV format) at: https://standards.ieee.org/products-services/regauth/ Spacing cleanups. No functional change. Modified: stable/11/sys/net/ethernet.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/ethernet.h ============================================================================== --- stable/11/sys/net/ethernet.h Sun Feb 23 03:32:16 2020 (r358258) +++ stable/11/sys/net/ethernet.h Sun Feb 23 15:18:28 2020 (r358259) @@ -6,7 +6,7 @@ */ #ifndef _NET_ETHERNET_H_ -#define _NET_ETHERNET_H_ +#define _NET_ETHERNET_H_ /* * Some basic Ethernet constants. @@ -95,6 +95,11 @@ struct ether_vlan_header { ((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & EVL_VLID_MASK)) /* + * Ethernet protocol types. + * + * A public list is available from the IEEE Registration Authority: + * https://standards.ieee.org/products-services/regauth/ + * * NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields. * However, there are some conflicts. */ @@ -263,7 +268,7 @@ struct ether_vlan_header { #define ETHERTYPE_AARP 0x80F3 /* AppleTalk AARP */ /* 0x80F4 - 0x80F5 Kinetics */ #define ETHERTYPE_APOLLO 0x80F7 /* Apollo Computer */ -#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging (XXX conflicts) */ +#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging (XXX conflicts) */ /* 0x80FF - 0x8101 Wellfleet Communications (XXX conflicts) */ #define ETHERTYPE_BOFL 0x8102 /* Wellfleet; BOFL (Breath OF Life) pkts [every 5-10 secs.] */ #define ETHERTYPE_WELLFLEET 0x8103 /* Wellfleet Communications */ @@ -336,15 +341,24 @@ struct ether_vlan_header { #define ETHERTYPE_SLOW 0x8809 /* 802.3ad link aggregation (LACP) */ #define ETHERTYPE_PPP 0x880B /* PPP (obsolete by PPPoE) */ #define ETHERTYPE_HITACHI 0x8820 /* Hitachi Cable (Optoelectronic Systems Laboratory) */ -#define ETHERTYPE_TEST 0x8822 /* Network Conformance Testing */ +#define ETHERTYPE_TEST 0x8822 /* Network Conformance Testing */ #define ETHERTYPE_MPLS 0x8847 /* MPLS Unicast */ #define ETHERTYPE_MPLS_MCAST 0x8848 /* MPLS Multicast */ #define ETHERTYPE_AXIS 0x8856 /* Axis Communications AB proprietary bootstrap/config */ #define ETHERTYPE_PPPOEDISC 0x8863 /* PPP Over Ethernet Discovery Stage */ #define ETHERTYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */ #define ETHERTYPE_LANPROBE 0x8888 /* HP LanProbe test? */ -#define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */ +#define ETHERTYPE_PAE 0x888E /* EAPOL PAE/802.1x */ +#define ETHERTYPE_PROFINET 0x8892 /* PROFINET RT Protocol */ +#define ETHERTYPE_AOE 0x88A2 /* ATA Protocol */ +#define ETHERTYPE_ETHERCAT 0x88A4 /* EtherCat Protocol */ #define ETHERTYPE_QINQ 0x88A8 /* 802.1ad VLAN stacking */ +#define ETHERTYPE_POWERLINK 0x88AB /* Ethernet Powerlink (EPL) */ +#define ETHERTYPE_LLDP 0x88CC /* Link Layer Discovery Protocol */ +#define ETHERTYPE_SERCOS 0x88CD /* SERCOS III Protocol */ +#define ETHERTYPE_MACSEC 0x88E5 /* 802.1AE MAC Security */ +#define ETHERTYPE_PBB 0x88E7 /* 802.1Q Provider Backbone Bridges */ +#define ETHERTYPE_FCOE 0x8906 /* Fibre Channel over Ethernet */ #define ETHERTYPE_LOOPBACK 0x9000 /* Loopback: used to test interfaces */ #define ETHERTYPE_LBACK ETHERTYPE_LOOPBACK /* DEC MOP loopback */ #define ETHERTYPE_XNSSM 0x9001 /* 3Com (Formerly Bridge Communications), XNS Systems Management */ @@ -375,7 +389,7 @@ struct ether_vlan_header { * ether_vlan_mtap. This function will re-insert VLAN tags for the duration * of the tap, so they show up properly for network analyzers. */ -#define ETHER_BPF_MTAP(_ifp, _m) do { \ +#define ETHER_BPF_MTAP(_ifp, _m) do { \ if (bpf_peers_present((_ifp)->if_bpf)) { \ M_ASSERTVALID(_m); \ if (((_m)->m_flags & M_VLANTAG) != 0) \ From owner-svn-src-stable@freebsd.org Mon Feb 24 02:11:55 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B00924F8B8; Mon, 24 Feb 2020 02:11:55 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Qltg0Qh5z4YRy; Mon, 24 Feb 2020 02:11:55 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06E161E132; Mon, 24 Feb 2020 02:11:55 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01O2Bsdo002041; Mon, 24 Feb 2020 02:11:54 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01O2BsRO002038; Mon, 24 Feb 2020 02:11:54 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202002240211.01O2BsRO002038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Mon, 24 Feb 2020 02:11:54 +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: r358267 - in stable/12: contrib/elftoolchain/elfdump contrib/elftoolchain/readelf sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: in stable/12: contrib/elftoolchain/elfdump contrib/elftoolchain/readelf sys/sys X-SVN-Commit-Revision: 358267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 02:11:55 -0000 Author: csjp Date: Mon Feb 24 02:11:54 2020 New Revision: 358267 URL: https://svnweb.freebsd.org/changeset/base/358267 Log: MFC r348776 Teach readelf about some OpenBSD ELF program headers Discussed with: emaste Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D20548 Modified: stable/12/contrib/elftoolchain/elfdump/elfdump.c stable/12/contrib/elftoolchain/readelf/readelf.c stable/12/sys/sys/elf_common.h Modified: stable/12/contrib/elftoolchain/elfdump/elfdump.c ============================================================================== --- stable/12/contrib/elftoolchain/elfdump/elfdump.c Sun Feb 23 23:39:55 2020 (r358266) +++ stable/12/contrib/elftoolchain/elfdump/elfdump.c Mon Feb 24 02:11:54 2020 (r358267) @@ -343,17 +343,20 @@ elf_phdr_type_str(unsigned int type) static char s_type[32]; switch (type) { - case PT_NULL: return "PT_NULL"; - case PT_LOAD: return "PT_LOAD"; - case PT_DYNAMIC: return "PT_DYNAMIC"; - case PT_INTERP: return "PT_INTERP"; - case PT_NOTE: return "PT_NOTE"; - case PT_SHLIB: return "PT_SHLIB"; - case PT_PHDR: return "PT_PHDR"; - case PT_TLS: return "PT_TLS"; - case PT_GNU_EH_FRAME: return "PT_GNU_EH_FRAME"; - case PT_GNU_STACK: return "PT_GNU_STACK"; - case PT_GNU_RELRO: return "PT_GNU_RELRO"; + case PT_NULL: return "PT_NULL"; + case PT_LOAD: return "PT_LOAD"; + case PT_DYNAMIC: return "PT_DYNAMIC"; + case PT_INTERP: return "PT_INTERP"; + case PT_NOTE: return "PT_NOTE"; + case PT_SHLIB: return "PT_SHLIB"; + case PT_PHDR: return "PT_PHDR"; + case PT_TLS: return "PT_TLS"; + case PT_GNU_EH_FRAME: return "PT_GNU_EH_FRAME"; + case PT_GNU_STACK: return "PT_GNU_STACK"; + case PT_GNU_RELRO: return "PT_GNU_RELRO"; + case PT_OPENBSD_RANDOMIZE: return "PT_OPENBSD_RANDOMIZE"; + case PT_OPENBSD_WXNEEDED: return "PT_OPENBSD_WXNEEDED"; + case PT_OPENBSD_BOOTDATA: return "PT_OPENBSD_BOOTDATA"; } snprintf(s_type, sizeof(s_type), "", type); return (s_type); Modified: stable/12/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- stable/12/contrib/elftoolchain/readelf/readelf.c Sun Feb 23 23:39:55 2020 (r358266) +++ stable/12/contrib/elftoolchain/readelf/readelf.c Mon Feb 24 02:11:54 2020 (r358267) @@ -670,6 +670,9 @@ phdr_type(unsigned int mach, unsigned int ptype) case PT_GNU_EH_FRAME: return "GNU_EH_FRAME"; case PT_GNU_STACK: return "GNU_STACK"; case PT_GNU_RELRO: return "GNU_RELRO"; + case PT_OPENBSD_RANDOMIZE: return "OPENBSD_RANDOMIZE"; + case PT_OPENBSD_WXNEEDED: return "OPENBSD_WXNEEDED"; + case PT_OPENBSD_BOOTDATA: return "OPENBSD_BOOTDATA"; default: if (ptype >= PT_LOOS && ptype <= PT_HIOS) snprintf(s_ptype, sizeof(s_ptype), "LOOS+%#x", Modified: stable/12/sys/sys/elf_common.h ============================================================================== --- stable/12/sys/sys/elf_common.h Sun Feb 23 23:39:55 2020 (r358266) +++ stable/12/sys/sys/elf_common.h Mon Feb 24 02:11:54 2020 (r358267) @@ -544,6 +544,10 @@ typedef struct { #define PT_ARM_EXIDX 0x70000001 /* ARM exception unwind tables. */ #define PT_HIPROC 0x7fffffff /* Last processor-specific type. */ +#define PT_OPENBSD_RANDOMIZE 0x65A3DBE6 /* OpenBSD random data segment */ +#define PT_OPENBSD_WXNEEDED 0x65A3DBE7 /* OpenBSD EXEC/WRITE pages needed */ +#define PT_OPENBSD_BOOTDATA 0x65A41BE6 /* OpenBSD section for boot args */ + /* Values for p_flags. */ #define PF_X 0x1 /* Executable. */ #define PF_W 0x2 /* Writable. */ From owner-svn-src-stable@freebsd.org Mon Feb 24 09:38:48 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4052925720B; Mon, 24 Feb 2020 09:38: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 48QxpH6MQJz41Mc; Mon, 24 Feb 2020 09:38: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 9DE6F233B7; Mon, 24 Feb 2020 09:38: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 01O9clLv073065; Mon, 24 Feb 2020 09:38:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01O9clNV073062; Mon, 24 Feb 2020 09:38:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002240938.01O9clNV073062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 24 Feb 2020 09:38:47 +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: r358271 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 358271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 09:38:48 -0000 Author: hselasky Date: Mon Feb 24 09:38:47 2020 New Revision: 358271 URL: https://svnweb.freebsd.org/changeset/base/358271 Log: MFC r357799: Make sure the so-called end of receive interrupts don't starve in iflib. When the receive ring cannot be filled with mbufs, due to lack of memory, no more interrupts may be generated to fill the receive ring later on. Make sure to have a watchdog, to try refilling the receive ring from time to time, hopefully when more mbufs are available. Differential Revision: https://reviews.freebsd.org/D23315 Reviewed by: gallatin@ Sponsored by: Mellanox Technologies Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Mon Feb 24 09:31:30 2020 (r358270) +++ stable/12/sys/net/iflib.c Mon Feb 24 09:38:47 2020 (r358271) @@ -131,6 +131,9 @@ __FBSDID("$FreeBSD$"); */ MALLOC_DEFINE(M_IFLIB, "iflib", "ifnet library"); +#define IFLIB_RXEOF_MORE (1U << 0) +#define IFLIB_RXEOF_EMPTY (2U << 0) + struct iflib_txq; typedef struct iflib_txq *iflib_txq_t; struct iflib_rxq; @@ -435,6 +438,7 @@ struct iflib_rxq { uint8_t ifr_fl_offset; struct lro_ctrl ifr_lc; struct grouptask ifr_task; + struct callout ifr_watchdog; struct iflib_filter_info ifr_filter_info; iflib_dma_info_t ifr_ifdi; @@ -1979,7 +1983,7 @@ _rxq_refill_cb(void *arg, bus_dma_segment_t *segs, int * (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 +static uint8_t _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int count) { struct if_rxd_update iru; @@ -2107,9 +2111,11 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ctx->isc_rxd_flush(ctx->ifc_softc, fl->ifl_rxq->ifr_id, fl->ifl_id, pidx); fl->ifl_fragidx = frag_idx; + + return (n == -1 ? 0 : IFLIB_RXEOF_EMPTY); } -static __inline void +static __inline uint8_t __iflib_fl_refill_lt(if_ctx_t ctx, iflib_fl_t fl, int max) { /* we avoid allowing pidx to catch up with cidx as it confuses ixl */ @@ -2122,7 +2128,8 @@ __iflib_fl_refill_lt(if_ctx_t ctx, iflib_fl_t fl, int MPASS(reclaimable == delta); if (reclaimable > 0) - _iflib_fl_refill(ctx, fl, min(max, reclaimable)); + return (_iflib_fl_refill(ctx, fl, min(max, reclaimable))); + return (0); } uint8_t @@ -2210,7 +2217,7 @@ iflib_fl_setup(iflib_fl_t fl) /* avoid pre-allocating zillions of clusters to an idle card * potentially speeding up attach */ - _iflib_fl_refill(ctx, fl, min(128, fl->ifl_size)); + (void) _iflib_fl_refill(ctx, fl, min(128, fl->ifl_size)); MPASS(min(128, fl->ifl_size) == fl->ifl_credits); if (min(128, fl->ifl_size) != fl->ifl_credits) return (ENOBUFS); @@ -2720,7 +2727,15 @@ iflib_get_ip_forwarding(struct lro_ctrl *lc __unused, } #endif -static bool +static void +_task_fn_rx_watchdog(void *context) +{ + iflib_rxq_t rxq = context; + + GROUPTASK_ENQUEUE(&rxq->ifr_task); +} + +static uint8_t iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) { if_t ifp; @@ -2734,6 +2749,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) iflib_fl_t fl; int lro_enabled; bool v4_forwarding, v6_forwarding, lro_possible; + uint8_t retval = 0; /* * XXX early demux data packets so that if_input processing only handles @@ -2752,9 +2768,9 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) cidxp = &rxq->ifr_fl[0].ifl_cidx; if ((avail = iflib_rxd_avail(ctx, rxq, *cidxp, budget)) == 0) { for (i = 0, fl = &rxq->ifr_fl[0]; i < sctx->isc_nfl; i++, fl++) - __iflib_fl_refill_lt(ctx, fl, budget + 8); + retval |= __iflib_fl_refill_lt(ctx, fl, budget + 8); DBG_COUNTER_INC(rx_unavail); - return (false); + return (retval); } for (budget_left = budget; budget_left > 0 && avail > 0;) { @@ -2808,7 +2824,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) } /* make sure that we can refill faster than drain */ for (i = 0, fl = &rxq->ifr_fl[0]; i < sctx->isc_nfl; i++, fl++) - __iflib_fl_refill_lt(ctx, fl, budget + 8); + retval |= __iflib_fl_refill_lt(ctx, fl, budget + 8); lro_enabled = (if_getcapenable(ifp) & IFCAP_LRO); if (lro_enabled) @@ -2867,15 +2883,15 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) #if defined(INET6) || defined(INET) tcp_lro_flush_all(&rxq->ifr_lc); #endif - if (avail) - return true; - return (iflib_rxd_avail(ctx, rxq, *cidxp, 1)); + if (avail != 0 || iflib_rxd_avail(ctx, rxq, *cidxp, 1) != 0) + retval |= IFLIB_RXEOF_MORE; + return (retval); err: STATE_LOCK(ctx); ctx->ifc_flags |= IFC_DO_RESET; iflib_admin_intr_deferred(ctx); STATE_UNLOCK(ctx); - return (false); + return (0); } #define TXD_NOTIFY_COUNT(txq) (((txq)->ift_size / (txq)->ift_update_freq)-1) @@ -3761,7 +3777,7 @@ _task_fn_rx(void *context) { iflib_rxq_t rxq = context; if_ctx_t ctx = rxq->ifr_ctx; - bool more; + uint8_t more; uint16_t budget; #ifdef IFLIB_DIAGNOSTICS @@ -3770,19 +3786,23 @@ _task_fn_rx(void *context) DBG_COUNTER_INC(task_fn_rxs); if (__predict_false(!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))) return; - more = true; #ifdef DEV_NETMAP if (if_getcapenable(ctx->ifc_ifp) & IFCAP_NETMAP) { u_int work = 0; if (netmap_rx_irq(ctx->ifc_ifp, rxq->ifr_id, &work)) { - more = false; + more = 0; + goto skip_rxeof; } } #endif budget = ctx->ifc_sysctl_rx_budget; if (budget == 0) budget = 16; /* XXX */ - if (more == false || (more = iflib_rxeof(rxq, budget)) == false) { + more = iflib_rxeof(rxq, budget); +#ifdef DEV_NETMAP +skip_rxeof: +#endif + if ((more & IFLIB_RXEOF_MORE) == 0) { if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); else @@ -3791,8 +3811,11 @@ _task_fn_rx(void *context) } if (__predict_false(!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))) return; - if (more) + + if (more & IFLIB_RXEOF_MORE) GROUPTASK_ENQUEUE(&rxq->ifr_task); + else if (more & IFLIB_RXEOF_EMPTY) + callout_reset_curcpu(&rxq->ifr_watchdog, 1, &_task_fn_rx_watchdog, rxq); } static void @@ -4973,6 +4996,7 @@ iflib_pseudo_deregister(if_ctx_t ctx) taskqgroup_detach(tqg, &txq->ift_task); } for (i = 0, rxq = ctx->ifc_rxqs; i < NRXQSETS(ctx); i++, rxq++) { + callout_drain(&rxq->ifr_watchdog); if (rxq->ifr_task.gt_uniq != NULL) taskqgroup_detach(tqg, &rxq->ifr_task); @@ -5472,6 +5496,7 @@ iflib_queues_alloc(if_ctx_t ctx) for (rxconf = i = 0; i < nrxqsets; i++, rxconf++, rxq++) { /* Set up some basics */ + callout_init(&rxq->ifr_watchdog, 1); if ((ifdip = malloc(sizeof(struct iflib_dma_info) * nrxqs, M_IFLIB, M_NOWAIT | M_ZERO)) == NULL) { From owner-svn-src-stable@freebsd.org Mon Feb 24 09:50:20 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B2C5257475; Mon, 24 Feb 2020 09:50: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 48Qy3c2WTMz4TrJ; Mon, 24 Feb 2020 09:50: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 4997C2359D; Mon, 24 Feb 2020 09:50:20 +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 01O9oKRu079675; Mon, 24 Feb 2020 09:50:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01O9oK19079674; Mon, 24 Feb 2020 09:50:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002240950.01O9oK19079674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 24 Feb 2020 09:50:20 +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: r358272 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 358272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 09:50:20 -0000 Author: hselasky Date: Mon Feb 24 09:50:19 2020 New Revision: 358272 URL: https://svnweb.freebsd.org/changeset/base/358272 Log: MFC r357799: Make sure the so-called end of receive interrupts don't starve in iflib. When the receive ring cannot be filled with mbufs, due to lack of memory, no more interrupts may be generated to fill the receive ring later on. Make sure to have a watchdog, to try refilling the receive ring from time to time, hopefully when more mbufs are available. Differential Revision: https://reviews.freebsd.org/D23315 Reviewed by: gallatin@ Sponsored by: Mellanox Technologies 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 Feb 24 09:38:47 2020 (r358271) +++ stable/11/sys/net/iflib.c Mon Feb 24 09:50:19 2020 (r358272) @@ -137,6 +137,9 @@ __FBSDID("$FreeBSD$"); */ static MALLOC_DEFINE(M_IFLIB, "iflib", "ifnet library"); +#define IFLIB_RXEOF_MORE (1U << 0) +#define IFLIB_RXEOF_EMPTY (2U << 0) + struct iflib_txq; typedef struct iflib_txq *iflib_txq_t; struct iflib_rxq; @@ -460,6 +463,7 @@ struct iflib_rxq { uint8_t ifr_txqid[IFLIB_MAX_TX_SHARED_INTR]; struct lro_ctrl ifr_lc; struct grouptask ifr_task; + struct callout ifr_watchdog; struct iflib_filter_info ifr_filter_info; iflib_dma_info_t ifr_ifdi; @@ -1806,7 +1810,7 @@ _rxq_refill_cb(void *arg, bus_dma_segment_t *segs, int * (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. */ -static void +static uint8_t _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int count) { struct mbuf *m; @@ -1945,9 +1949,11 @@ done: BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); ctx->isc_rxd_flush(ctx->ifc_softc, fl->ifl_rxq->ifr_id, fl->ifl_id, pidx); fl->ifl_fragidx = frag_idx; + + return (n == -1 ? 0 : IFLIB_RXEOF_EMPTY); } -static __inline void +static __inline uint8_t __iflib_fl_refill_lt(if_ctx_t ctx, iflib_fl_t fl, int max) { /* we avoid allowing pidx to catch up with cidx as it confuses ixl */ @@ -1960,7 +1966,8 @@ __iflib_fl_refill_lt(if_ctx_t ctx, iflib_fl_t fl, int MPASS(reclaimable == delta); if (reclaimable > 0) - _iflib_fl_refill(ctx, fl, min(max, reclaimable)); + return (_iflib_fl_refill(ctx, fl, min(max, reclaimable))); + return (0); } uint8_t @@ -2052,7 +2059,7 @@ iflib_fl_setup(iflib_fl_t fl) /* avoid pre-allocating zillions of clusters to an idle card * potentially speeding up attach */ - _iflib_fl_refill(ctx, fl, min(128, fl->ifl_size)); + (void) _iflib_fl_refill(ctx, fl, min(128, fl->ifl_size)); MPASS(min(128, fl->ifl_size) == fl->ifl_credits); if (min(128, fl->ifl_size) != fl->ifl_credits) return (ENOBUFS); @@ -2536,7 +2543,15 @@ iflib_get_ip_forwarding(struct lro_ctrl *lc __unused, } #endif -static bool +static void +_task_fn_rx_watchdog(void *context) +{ + iflib_rxq_t rxq = context; + + GROUPTASK_ENQUEUE(&rxq->ifr_task); +} + +static uint8_t iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) { if_ctx_t ctx = rxq->ifr_ctx; @@ -2551,6 +2566,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) int lro_enabled; bool lro_possible = false; bool v4_forwarding, v6_forwarding; + uint8_t retval = 0; /* * XXX early demux data packets so that if_input processing only handles @@ -2568,9 +2584,9 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) cidxp = &rxq->ifr_fl[0].ifl_cidx; if ((avail = iflib_rxd_avail(ctx, rxq, *cidxp, budget)) == 0) { for (i = 0, fl = &rxq->ifr_fl[0]; i < sctx->isc_nfl; i++, fl++) - __iflib_fl_refill_lt(ctx, fl, budget + 8); + retval |= __iflib_fl_refill_lt(ctx, fl, budget + 8); DBG_COUNTER_INC(rx_unavail); - return (false); + return (retval); } for (budget_left = budget; (budget_left > 0) && (avail > 0); budget_left--, avail--) { @@ -2624,7 +2640,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) } /* make sure that we can refill faster than drain */ for (i = 0, fl = &rxq->ifr_fl[0]; i < sctx->isc_nfl; i++, fl++) - __iflib_fl_refill_lt(ctx, fl, budget + 8); + retval |= __iflib_fl_refill_lt(ctx, fl, budget + 8); lro_enabled = (if_getcapenable(ifp) & IFCAP_LRO); if (lro_enabled) @@ -2683,15 +2699,15 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) #if defined(INET6) || defined(INET) tcp_lro_flush_all(&rxq->ifr_lc); #endif - if (avail) - return true; - return (iflib_rxd_avail(ctx, rxq, *cidxp, 1)); + if (avail != 0 || iflib_rxd_avail(ctx, rxq, *cidxp, 1) != 0) + retval |= IFLIB_RXEOF_MORE; + return (retval); err: STATE_LOCK(ctx); ctx->ifc_flags |= IFC_DO_RESET; iflib_admin_intr_deferred(ctx); STATE_UNLOCK(ctx); - return (false); + return (0); } #define TXD_NOTIFY_COUNT(txq) (((txq)->ift_size / (txq)->ift_update_freq)-1) @@ -3701,7 +3717,7 @@ _task_fn_rx(void *context) { iflib_rxq_t rxq = context; if_ctx_t ctx = rxq->ifr_ctx; - bool more; + uint8_t more; int rc; uint16_t budget; @@ -3711,19 +3727,23 @@ _task_fn_rx(void *context) DBG_COUNTER_INC(task_fn_rxs); if (__predict_false(!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))) return; - more = true; #ifdef DEV_NETMAP if (if_getcapenable(ctx->ifc_ifp) & IFCAP_NETMAP) { u_int work = 0; if (netmap_rx_irq(ctx->ifc_ifp, rxq->ifr_id, &work)) { - more = false; + more = 0; + goto skip_rxeof; } } #endif budget = ctx->ifc_sysctl_rx_budget; if (budget == 0) budget = 16; /* XXX */ - if (more == false || (more = iflib_rxeof(rxq, budget)) == false) { + more = iflib_rxeof(rxq, budget); +#ifdef DEV_NETMAP +skip_rxeof: +#endif + if ((more & IFLIB_RXEOF_MORE) == 0) { if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); else { @@ -3734,8 +3754,11 @@ _task_fn_rx(void *context) } if (__predict_false(!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))) return; - if (more) + + if (more & IFLIB_RXEOF_MORE) GROUPTASK_ENQUEUE(&rxq->ifr_task); + else if (more & IFLIB_RXEOF_EMPTY) + callout_reset_curcpu(&rxq->ifr_watchdog, 1, &_task_fn_rx_watchdog, rxq); } static void @@ -4539,6 +4562,7 @@ iflib_device_deregister(if_ctx_t ctx) taskqgroup_detach(tqg, &txq->ift_task); } for (i = 0, rxq = ctx->ifc_rxqs; i < NRXQSETS(ctx); i++, rxq++) { + callout_drain(&rxq->ifr_watchdog); if (rxq->ifr_task.gt_uniq != NULL) taskqgroup_detach(tqg, &rxq->ifr_task); @@ -4898,6 +4922,7 @@ iflib_queues_alloc(if_ctx_t ctx) for (rxconf = i = 0; i < nrxqsets; i++, rxconf++, rxq++) { /* Set up some basics */ + callout_init(&rxq->ifr_watchdog, 1); if ((ifdip = malloc(sizeof(struct iflib_dma_info) * nrxqs, M_IFLIB, M_WAITOK|M_ZERO)) == NULL) { device_printf(dev, "failed to allocate iflib_dma_info\n"); From owner-svn-src-stable@freebsd.org Mon Feb 24 09:57:48 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEAE12576D4; Mon, 24 Feb 2020 09:57: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 48QyDD2l1Fz3HWD; Mon, 24 Feb 2020 09:57: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 39E6923776; Mon, 24 Feb 2020 09:57: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 01O9vmlS085415; Mon, 24 Feb 2020 09:57:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01O9vlKj085406; Mon, 24 Feb 2020 09:57:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002240957.01O9vlKj085406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 24 Feb 2020 09:57:47 +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: r358273 - in stable/12/sys: net netinet netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: net netinet netinet6 X-SVN-Commit-Revision: 358273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 09:57:48 -0000 Author: hselasky Date: Mon Feb 24 09:57:47 2020 New Revision: 358273 URL: https://svnweb.freebsd.org/changeset/base/358273 Log: MFC r358013: Fix kernel panic while trying to read multicast stream. When VIMAGE is enabled make sure the "m_pkthdr.rcvif" pointer is set for all mbufs being input by the IGMP/MLD6 code. Else there will be a NULL-pointer dereference in the netisr code when trying to set the VNET based on the incoming mbuf. Add an assert to catch this when queueing mbufs on a netisr to make debugging of similar cases easier. Found by: Vladislav V. Prodan PR: 244002 Reviewed by: bz@ Sponsored by: Mellanox Technologies Modified: stable/12/sys/net/netisr.c stable/12/sys/netinet/igmp.c stable/12/sys/netinet6/mld6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/netisr.c ============================================================================== --- stable/12/sys/net/netisr.c Mon Feb 24 09:50:19 2020 (r358272) +++ stable/12/sys/net/netisr.c Mon Feb 24 09:57:47 2020 (r358273) @@ -1055,6 +1055,8 @@ netisr_queue_src(u_int proto, uintptr_t source, struct if (m != NULL) { KASSERT(!CPU_ABSENT(cpuid), ("%s: CPU %u absent", __func__, cpuid)); + VNET_ASSERT(m->m_pkthdr.rcvif != NULL, + ("%s:%d rcvif == NULL: m=%p", __func__, __LINE__, m)); error = netisr_queue_internal(proto, m, cpuid); } else error = ENOBUFS; Modified: stable/12/sys/netinet/igmp.c ============================================================================== --- stable/12/sys/netinet/igmp.c Mon Feb 24 09:50:19 2020 (r358272) +++ stable/12/sys/netinet/igmp.c Mon Feb 24 09:57:47 2020 (r358273) @@ -303,6 +303,7 @@ igmp_save_context(struct mbuf *m, struct ifnet *ifp) #ifdef VIMAGE m->m_pkthdr.PH_loc.ptr = ifp->if_vnet; #endif /* VIMAGE */ + m->m_pkthdr.rcvif = ifp; m->m_pkthdr.flowid = ifp->if_index; } Modified: stable/12/sys/netinet6/mld6.c ============================================================================== --- stable/12/sys/netinet6/mld6.c Mon Feb 24 09:50:19 2020 (r358272) +++ stable/12/sys/netinet6/mld6.c Mon Feb 24 09:57:47 2020 (r358273) @@ -283,6 +283,7 @@ mld_save_context(struct mbuf *m, struct ifnet *ifp) #ifdef VIMAGE m->m_pkthdr.PH_loc.ptr = ifp->if_vnet; #endif /* VIMAGE */ + m->m_pkthdr.rcvif = ifp; m->m_pkthdr.flowid = ifp->if_index; } From owner-svn-src-stable@freebsd.org Mon Feb 24 09:58:58 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBA6C257773; Mon, 24 Feb 2020 09:58:58 +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 48QyFZ4XWLz3Knc; Mon, 24 Feb 2020 09:58:58 +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 4A5102377F; Mon, 24 Feb 2020 09:58:58 +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 01O9wwXO085560; Mon, 24 Feb 2020 09:58:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01O9wvBp085557; Mon, 24 Feb 2020 09:58:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002240958.01O9wvBp085557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 24 Feb 2020 09:58:57 +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: r358274 - in stable/11/sys: net netinet netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: net netinet netinet6 X-SVN-Commit-Revision: 358274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 09:58:59 -0000 Author: hselasky Date: Mon Feb 24 09:58:57 2020 New Revision: 358274 URL: https://svnweb.freebsd.org/changeset/base/358274 Log: MFC r358013: Fix kernel panic while trying to read multicast stream. When VIMAGE is enabled make sure the "m_pkthdr.rcvif" pointer is set for all mbufs being input by the IGMP/MLD6 code. Else there will be a NULL-pointer dereference in the netisr code when trying to set the VNET based on the incoming mbuf. Add an assert to catch this when queueing mbufs on a netisr to make debugging of similar cases easier. Found by: Vladislav V. Prodan PR: 244002 Reviewed by: bz@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/net/netisr.c stable/11/sys/netinet/igmp.c stable/11/sys/netinet6/mld6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/netisr.c ============================================================================== --- stable/11/sys/net/netisr.c Mon Feb 24 09:57:47 2020 (r358273) +++ stable/11/sys/net/netisr.c Mon Feb 24 09:58:57 2020 (r358274) @@ -1053,6 +1053,8 @@ netisr_queue_src(u_int proto, uintptr_t source, struct if (m != NULL) { KASSERT(!CPU_ABSENT(cpuid), ("%s: CPU %u absent", __func__, cpuid)); + VNET_ASSERT(m->m_pkthdr.rcvif != NULL, + ("%s:%d rcvif == NULL: m=%p", __func__, __LINE__, m)); error = netisr_queue_internal(proto, m, cpuid); } else error = ENOBUFS; Modified: stable/11/sys/netinet/igmp.c ============================================================================== --- stable/11/sys/netinet/igmp.c Mon Feb 24 09:57:47 2020 (r358273) +++ stable/11/sys/netinet/igmp.c Mon Feb 24 09:58:57 2020 (r358274) @@ -301,6 +301,7 @@ igmp_save_context(struct mbuf *m, struct ifnet *ifp) #ifdef VIMAGE m->m_pkthdr.PH_loc.ptr = ifp->if_vnet; #endif /* VIMAGE */ + m->m_pkthdr.rcvif = ifp; m->m_pkthdr.flowid = ifp->if_index; } Modified: stable/11/sys/netinet6/mld6.c ============================================================================== --- stable/11/sys/netinet6/mld6.c Mon Feb 24 09:57:47 2020 (r358273) +++ stable/11/sys/netinet6/mld6.c Mon Feb 24 09:58:57 2020 (r358274) @@ -277,6 +277,7 @@ mld_save_context(struct mbuf *m, struct ifnet *ifp) #ifdef VIMAGE m->m_pkthdr.PH_loc.ptr = ifp->if_vnet; #endif /* VIMAGE */ + m->m_pkthdr.rcvif = ifp; m->m_pkthdr.flowid = ifp->if_index; } From owner-svn-src-stable@freebsd.org Mon Feb 24 10:41:38 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11C4B2589F8; Mon, 24 Feb 2020 10:41: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 48QzBn64dlz44Vh; Mon, 24 Feb 2020 10:41: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 8BAC824052; Mon, 24 Feb 2020 10:41: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 01OAfbF9013658; Mon, 24 Feb 2020 10:41:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01OAfbZb013657; Mon, 24 Feb 2020 10:41:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002241041.01OAfbZb013657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 24 Feb 2020 10:41:37 +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: r358281 - stable/12/sys/dev/mlx5/mlx5_ib X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 358281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 10:41:38 -0000 Author: hselasky Date: Mon Feb 24 10:41:36 2020 New Revision: 358281 URL: https://svnweb.freebsd.org/changeset/base/358281 Log: MFC r358220: Fix broken MLX5_IB_INDEX() macro in mlx5ib(4). The index should be computed as distance from arg[0] and not the beginning of struct mlx5_ib_congestion . While at it fix a use of zero length array to avoid depending on undefined compiler behaviour. Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib.h stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Mon Feb 24 10:41:22 2020 (r358280) +++ stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Mon Feb 24 10:41:36 2020 (r358281) @@ -650,9 +650,13 @@ struct mlx5_ib_congestion { struct sysctl_ctx_list ctx; struct sx lock; struct delayed_work dwork; - u64 arg [0]; - MLX5_IB_CONG_PARAMS(MLX5_IB_STATS_VAR) - MLX5_IB_CONG_STATS(MLX5_IB_STATS_VAR) + union { + u64 arg[1]; + struct { + MLX5_IB_CONG_PARAMS(MLX5_IB_STATS_VAR) + MLX5_IB_CONG_STATS(MLX5_IB_STATS_VAR) + }; + }; }; struct mlx5_ib_dev { Modified: stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c Mon Feb 24 10:41:22 2020 (r358280) +++ stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c Mon Feb 24 10:41:36 2020 (r358281) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2020, 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 @@ -37,7 +37,9 @@ static const char *mlx5_ib_cong_stats_desc[] = { MLX5_IB_CONG_STATS(MLX5_IB_STATS_DESC) }; -#define MLX5_IB_INDEX(field) (__offsetof(struct mlx5_ib_congestion, field) / sizeof(u64)) +#define MLX5_IB_INDEX(field) ( \ + (__offsetof(struct mlx5_ib_congestion, field) - \ + __offsetof(struct mlx5_ib_congestion, arg[0])) / sizeof(u64)) #define MLX5_IB_FLD_MAX(type, field) ((1ULL << __mlx5_bit_sz(type, field)) - 1ULL) #define MLX5_IB_SET_CLIPPED(type, ptr, field, var) do { \ /* rangecheck */ \ From owner-svn-src-stable@freebsd.org Mon Feb 24 10:42:38 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6129258AD0; Mon, 24 Feb 2020 10:42: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 48QzCy2tymz46g2; Mon, 24 Feb 2020 10:42: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 D13CA240AD; Mon, 24 Feb 2020 10:42: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 01OAgbrA016024; Mon, 24 Feb 2020 10:42:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01OAgbiL016022; Mon, 24 Feb 2020 10:42:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002241042.01OAgbiL016022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 24 Feb 2020 10:42: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: r358282 - stable/11/sys/dev/mlx5/mlx5_ib X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 358282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 10:42:38 -0000 Author: hselasky Date: Mon Feb 24 10:42:37 2020 New Revision: 358282 URL: https://svnweb.freebsd.org/changeset/base/358282 Log: MFC r358220: Fix broken MLX5_IB_INDEX() macro in mlx5ib(4). The index should be computed as distance from arg[0] and not the beginning of struct mlx5_ib_congestion . While at it fix a use of zero length array to avoid depending on undefined compiler behaviour. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib.h stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Mon Feb 24 10:41:36 2020 (r358281) +++ stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Mon Feb 24 10:42:37 2020 (r358282) @@ -650,9 +650,13 @@ struct mlx5_ib_congestion { struct sysctl_ctx_list ctx; struct sx lock; struct delayed_work dwork; - u64 arg [0]; - MLX5_IB_CONG_PARAMS(MLX5_IB_STATS_VAR) - MLX5_IB_CONG_STATS(MLX5_IB_STATS_VAR) + union { + u64 arg[1]; + struct { + MLX5_IB_CONG_PARAMS(MLX5_IB_STATS_VAR) + MLX5_IB_CONG_STATS(MLX5_IB_STATS_VAR) + }; + }; }; struct mlx5_ib_dev { Modified: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c Mon Feb 24 10:41:36 2020 (r358281) +++ stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c Mon Feb 24 10:42:37 2020 (r358282) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2020, 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 @@ -37,7 +37,9 @@ static const char *mlx5_ib_cong_stats_desc[] = { MLX5_IB_CONG_STATS(MLX5_IB_STATS_DESC) }; -#define MLX5_IB_INDEX(field) (__offsetof(struct mlx5_ib_congestion, field) / sizeof(u64)) +#define MLX5_IB_INDEX(field) ( \ + (__offsetof(struct mlx5_ib_congestion, field) - \ + __offsetof(struct mlx5_ib_congestion, arg[0])) / sizeof(u64)) #define MLX5_IB_FLD_MAX(type, field) ((1ULL << __mlx5_bit_sz(type, field)) - 1ULL) #define MLX5_IB_SET_CLIPPED(type, ptr, field, var) do { \ /* rangecheck */ \ From owner-svn-src-stable@freebsd.org Mon Feb 24 12:34:44 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B4E925BA28; Mon, 24 Feb 2020 12:34: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 48R1jH1jHYz3McW; Mon, 24 Feb 2020 12:34: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 0A1F82551F; Mon, 24 Feb 2020 12:34: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 01OCYgs9084072; Mon, 24 Feb 2020 12:34:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01OCYg97084071; Mon, 24 Feb 2020 12:34:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002241234.01OCYg97084071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 24 Feb 2020 12:34:42 +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: r358287 - 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: 358287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 12:34:44 -0000 Author: kib Date: Mon Feb 24 12:34:42 2020 New Revision: 358287 URL: https://svnweb.freebsd.org/changeset/base/358287 Log: MFC r358225: print_svm_info: decode a CPUID 0x8000000a.edx bit 20. Modified: stable/12/sys/x86/x86/identcpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/x86/identcpu.c ============================================================================== --- stable/12/sys/x86/x86/identcpu.c Mon Feb 24 10:51:26 2020 (r358286) +++ stable/12/sys/x86/x86/identcpu.c Mon Feb 24 12:34:42 2020 (r358287) @@ -2272,7 +2272,7 @@ print_svm_info(void) "\022" "\023" "\024" - "\025" + "\025GuesSpecCtl" /* Guest Spec_ctl */ "\026" "\027" "\030" From owner-svn-src-stable@freebsd.org Mon Feb 24 12:35:59 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2CB725BAA5; Mon, 24 Feb 2020 12:35:59 +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 48R1kl26kmz3Q8B; Mon, 24 Feb 2020 12:35:59 +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 427E825520; Mon, 24 Feb 2020 12:35:59 +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 01OCZxZr084202; Mon, 24 Feb 2020 12:35:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01OCZxb6084201; Mon, 24 Feb 2020 12:35:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002241235.01OCZxb6084201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 24 Feb 2020 12:35: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: r358288 - 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: 358288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 12:35:59 -0000 Author: kib Date: Mon Feb 24 12:35:58 2020 New Revision: 358288 URL: https://svnweb.freebsd.org/changeset/base/358288 Log: MFC r358226: x86/identcpu.c whitespace cleanup. Modified: stable/12/sys/x86/x86/identcpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/x86/identcpu.c ============================================================================== --- stable/12/sys/x86/x86/identcpu.c Mon Feb 24 12:34:42 2020 (r358287) +++ stable/12/sys/x86/x86/identcpu.c Mon Feb 24 12:35:58 2020 (r358288) @@ -276,7 +276,7 @@ printcpuinfo(void) switch (cpu_id & 0xf00) { case 0x400: strcat(cpu_model, "i486 "); - /* Check the particular flavor of 486 */ + /* Check the particular flavor of 486 */ switch (cpu_id & 0xf0) { case 0x00: case 0x10: @@ -304,32 +304,32 @@ printcpuinfo(void) } break; case 0x500: - /* Check the particular flavor of 586 */ - strcat(cpu_model, "Pentium"); - switch (cpu_id & 0xf0) { + /* Check the particular flavor of 586 */ + strcat(cpu_model, "Pentium"); + switch (cpu_id & 0xf0) { case 0x00: - strcat(cpu_model, " A-step"); + strcat(cpu_model, " A-step"); break; case 0x10: - strcat(cpu_model, "/P5"); + strcat(cpu_model, "/P5"); break; case 0x20: - strcat(cpu_model, "/P54C"); + strcat(cpu_model, "/P54C"); break; case 0x30: - strcat(cpu_model, "/P24T"); + strcat(cpu_model, "/P24T"); break; case 0x40: - strcat(cpu_model, "/P55C"); + strcat(cpu_model, "/P55C"); break; case 0x70: - strcat(cpu_model, "/P54C"); + strcat(cpu_model, "/P54C"); break; case 0x80: - strcat(cpu_model, "/P55C (quarter-micron)"); + strcat(cpu_model, "/P55C (quarter-micron)"); break; default: - /* nothing */ + /* nothing */ break; } #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -342,18 +342,18 @@ printcpuinfo(void) #endif break; case 0x600: - /* Check the particular flavor of 686 */ - switch (cpu_id & 0xf0) { + /* Check the particular flavor of 686 */ + switch (cpu_id & 0xf0) { case 0x00: - strcat(cpu_model, "Pentium Pro A-step"); + strcat(cpu_model, "Pentium Pro A-step"); break; case 0x10: - strcat(cpu_model, "Pentium Pro"); + strcat(cpu_model, "Pentium Pro"); break; case 0x30: case 0x50: case 0x60: - strcat(cpu_model, + strcat(cpu_model, "Pentium II/Pentium II Xeon/Celeron"); cpu = CPU_PII; break; @@ -361,12 +361,12 @@ printcpuinfo(void) case 0x80: case 0xa0: case 0xb0: - strcat(cpu_model, + strcat(cpu_model, "Pentium III/Pentium III Xeon/Celeron"); cpu = CPU_PIII; break; default: - strcat(cpu_model, "Unknown 80686"); + strcat(cpu_model, "Unknown 80686"); break; } break; @@ -1347,7 +1347,7 @@ identify_hypervisor(void) if (regs[0] == 0 && regs[1] == 0x4b4d564b && regs[2] == 0x564b4d56 && regs[3] == 0x0000004d) regs[0] = 0x40000001; - + if (regs[0] >= 0x40000000) { hv_high = regs[0]; ((u_int *)&hv_vendor)[0] = regs[1]; @@ -1374,7 +1374,7 @@ identify_hypervisor(void) if (strncmp(p, "VMware-", 7) == 0 || strncmp(p, "VMW", 3) == 0) { vmware_hvcall(VMW_HVCMD_GETVERSION, regs); if (regs[1] == VMW_HVMAGIC) { - vm_guest = VM_GUEST_VMWARE; + vm_guest = VM_GUEST_VMWARE; freeenv(p); return; } @@ -2228,23 +2228,23 @@ print_svm_info(void) comma = 0; if (features & (1 << 0)) { printf("%sNP", comma ? "," : ""); - comma = 1; + comma = 1; } if (features & (1 << 3)) { printf("%sNRIP", comma ? "," : ""); - comma = 1; + comma = 1; } if (features & (1 << 5)) { printf("%sVClean", comma ? "," : ""); - comma = 1; + comma = 1; } if (features & (1 << 6)) { printf("%sAFlush", comma ? "," : ""); - comma = 1; + comma = 1; } if (features & (1 << 7)) { printf("%sDAssist", comma ? "," : ""); - comma = 1; + comma = 1; } printf("%sNAsids=%d", comma ? "," : "", regs[1]); return; @@ -2262,7 +2262,7 @@ print_svm_info(void) "\010DecodeAssist" /* Decode assist */ "\011" "\012" - "\013PauseFilter" /* PAUSE intercept filter */ + "\013PauseFilter" /* PAUSE intercept filter */ "\014EncryptedMcodePatch" "\015PauseFilterThreshold" /* PAUSE filter threshold */ "\016AVIC" /* virtual interrupt controller */ @@ -2284,7 +2284,7 @@ print_svm_info(void) "\036" "\037" "\040" - ); + ); printf("\nRevision=%d, ASIDs=%d", regs[0] & 0xff, regs[1]); } From owner-svn-src-stable@freebsd.org Tue Feb 25 00:36:17 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D30F1249CE2; Tue, 25 Feb 2020 00:36:17 +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 48RKjs4Fz7z3Q25; Tue, 25 Feb 2020 00:36:17 +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 874306082; Tue, 25 Feb 2020 00:36:17 +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 01P0aHgp023281; Tue, 25 Feb 2020 00:36:17 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01P0aHNT023280; Tue, 25 Feb 2020 00:36:17 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202002250036.01P0aHNT023280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 25 Feb 2020 00:36: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: r358302 - stable/12/release/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: stable/12/release/tools X-SVN-Commit-Revision: 358302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2020 00:36:18 -0000 Author: cperciva Date: Tue Feb 25 00:36:16 2020 New Revision: 358302 URL: https://svnweb.freebsd.org/changeset/base/358302 Log: MFC r357749: Remove /qemu from EC2 ARM AMIs. Modified: stable/12/release/tools/ec2.conf Directory Properties: stable/12/ (props changed) Modified: stable/12/release/tools/ec2.conf ============================================================================== --- stable/12/release/tools/ec2.conf Mon Feb 24 21:07:30 2020 (r358301) +++ stable/12/release/tools/ec2.conf Tue Feb 25 00:36:16 2020 (r358302) @@ -116,6 +116,9 @@ vm_extra_pre_umount() { # * firstboot_pkgs (install packages) touch ${DESTDIR}/firstboot + if ! [ -z "${QEMUSTATIC}" ]; then + rm -f ${DESTDIR}/${EMULATOR} + fi rm -f ${DESTDIR}/etc/resolv.conf return 0 From owner-svn-src-stable@freebsd.org Tue Feb 25 00:37:14 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28872249D76; Tue, 25 Feb 2020 00:37:14 +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 48RKkx5Qy4z3ww9; Tue, 25 Feb 2020 00:37:13 +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 8D7EA6083; Tue, 25 Feb 2020 00:37:13 +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 01P0bDjR023384; Tue, 25 Feb 2020 00:37:13 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01P0bDXj023383; Tue, 25 Feb 2020 00:37:13 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202002250037.01P0bDXj023383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 25 Feb 2020 00:37: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: r358303 - stable/12/release/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: stable/12/release/tools X-SVN-Commit-Revision: 358303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2020 00:37:14 -0000 Author: cperciva Date: Tue Feb 25 00:37:13 2020 New Revision: 358303 URL: https://svnweb.freebsd.org/changeset/base/358303 Log: MFC r357750: Mount /dev while deinstalling pkg inside EC2 AMIs. Modified: stable/12/release/tools/ec2.conf Directory Properties: stable/12/ (props changed) Modified: stable/12/release/tools/ec2.conf ============================================================================== --- stable/12/release/tools/ec2.conf Tue Feb 25 00:36:16 2020 (r358302) +++ stable/12/release/tools/ec2.conf Tue Feb 25 00:37:13 2020 (r358303) @@ -40,8 +40,10 @@ vm_extra_pre_umount() { # catalogue and install or update pkg when the instance first # launches, so these files would just be replaced anyway; removing # them from the image allows it to boot faster. + mount -t devfs devfs ${DESTDIR}/dev chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \ /usr/sbin/pkg delete -f -y pkg + umount ${DESTDIR}/dev rm ${DESTDIR}/var/db/pkg/repo-*.sqlite # The size of the EC2 root disk can be configured at instance launch From owner-svn-src-stable@freebsd.org Tue Feb 25 15:52:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A2BB25EC77; Tue, 25 Feb 2020 15:52:37 +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 48Rk383jqvz4BT0; Tue, 25 Feb 2020 15:52:36 +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 1BFAA18F26; Tue, 25 Feb 2020 15:52:36 +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 01PFqZQu075468; Tue, 25 Feb 2020 15:52:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01PFqZXa075466; Tue, 25 Feb 2020 15:52:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202002251552.01PFqZXa075466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 25 Feb 2020 15:52: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: r358312 - in stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 358312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2020 15:52:37 -0000 Author: mav Date: Tue Feb 25 15:52:35 2020 New Revision: 358312 URL: https://svnweb.freebsd.org/changeset/base/358312 Log: MFC r349381: Avoid extra taskq_dispatch() calls by DMU. DMU sync code calls taskq_dispatch() for each sublist of os_dirty_dnodes and os_synced_dnodes. Since the number of sublists by default is equal to number of CPUs, it will dispatch equal, potentially large, number of tasks, waking up many CPUs to handle them, even if only one or few of sublists actually have any work to do. This change adds check for empty sublists to avoid this. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Feb 25 15:03:41 2020 (r358311) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Feb 25 15:52:35 2020 (r358312) @@ -1353,6 +1353,8 @@ dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx zio_t *zio; list_t *list; dbuf_dirty_record_t *dr; + int num_sublists; + multilist_t *ml; blkptr_t *blkptr_copy = kmem_alloc(sizeof (*os->os_rootbp), KM_SLEEP); *blkptr_copy = *os->os_rootbp; @@ -1421,10 +1423,13 @@ dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx } } - for (int i = 0; - i < multilist_get_num_sublists(os->os_dirty_dnodes[txgoff]); i++) { + ml = os->os_dirty_dnodes[txgoff]; + num_sublists = multilist_get_num_sublists(ml); + for (int i = 0; i < num_sublists; i++) { + if (multilist_sublist_is_empty_idx(ml, i)) + continue; sync_dnodes_arg_t *sda = kmem_alloc(sizeof (*sda), KM_SLEEP); - sda->sda_list = os->os_dirty_dnodes[txgoff]; + sda->sda_list = ml; sda->sda_sublist_idx = i; sda->sda_tx = tx; (void) taskq_dispatch(dmu_objset_pool(os)->dp_sync_taskq, @@ -1640,6 +1645,8 @@ userquota_updates_task(void *arg) void dmu_objset_do_userquota_updates(objset_t *os, dmu_tx_t *tx) { + int num_sublists; + if (!dmu_objset_userused_enabled(os)) return; @@ -1653,8 +1660,10 @@ dmu_objset_do_userquota_updates(objset_t *os, dmu_tx_t DMU_OT_USERGROUP_USED, DMU_OT_NONE, 0, tx)); } - for (int i = 0; - i < multilist_get_num_sublists(os->os_synced_dnodes); i++) { + num_sublists = multilist_get_num_sublists(os->os_synced_dnodes); + for (int i = 0; i < num_sublists; i++) { + if (multilist_sublist_is_empty_idx(os->os_synced_dnodes, i)) + continue; userquota_updates_arg_t *uua = kmem_alloc(sizeof (*uua), KM_SLEEP); uua->uua_os = os; Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c Tue Feb 25 15:03:41 2020 (r358311) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c Tue Feb 25 15:52:35 2020 (r358312) @@ -360,6 +360,28 @@ multilist_sublist_remove(multilist_sublist_t *mls, voi list_remove(&mls->mls_list, obj); } +int +multilist_sublist_is_empty(multilist_sublist_t *mls) +{ + ASSERT(MUTEX_HELD(&mls->mls_lock)); + return (list_is_empty(&mls->mls_list)); +} + +int +multilist_sublist_is_empty_idx(multilist_t *ml, unsigned int sublist_idx) +{ + multilist_sublist_t *mls; + int empty; + + ASSERT3U(sublist_idx, <, ml->ml_num_sublists); + mls = &ml->ml_sublists[sublist_idx]; + ASSERT(!MUTEX_HELD(&mls->mls_lock)); + mutex_enter(&mls->mls_lock); + empty = list_is_empty(&mls->mls_list); + mutex_exit(&mls->mls_lock); + return (empty); +} + void * multilist_sublist_head(multilist_sublist_t *mls) { Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Tue Feb 25 15:03:41 2020 (r358311) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Tue Feb 25 15:52:35 2020 (r358312) @@ -89,6 +89,8 @@ void multilist_sublist_insert_head(multilist_sublist_t void multilist_sublist_insert_tail(multilist_sublist_t *, void *); void multilist_sublist_move_forward(multilist_sublist_t *mls, void *obj); void multilist_sublist_remove(multilist_sublist_t *, void *); +int multilist_sublist_is_empty(multilist_sublist_t *); +int multilist_sublist_is_empty_idx(multilist_t *, unsigned int); void *multilist_sublist_head(multilist_sublist_t *); void *multilist_sublist_tail(multilist_sublist_t *); From owner-svn-src-stable@freebsd.org Tue Feb 25 15:53:18 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94F9525ED31; Tue, 25 Feb 2020 15:53: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 48Rk3y3VLqz4D09; Tue, 25 Feb 2020 15:53:18 +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 5C7DE18F2A; Tue, 25 Feb 2020 15:53:18 +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 01PFrIMD075681; Tue, 25 Feb 2020 15:53:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01PFrHbl075678; Tue, 25 Feb 2020 15:53:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202002251553.01PFrHbl075678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 25 Feb 2020 15:53: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: r358313 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 358313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2020 15:53:18 -0000 Author: mav Date: Tue Feb 25 15:53:17 2020 New Revision: 358313 URL: https://svnweb.freebsd.org/changeset/base/358313 Log: MFC r349381: Avoid extra taskq_dispatch() calls by DMU. DMU sync code calls taskq_dispatch() for each sublist of os_dirty_dnodes and os_synced_dnodes. Since the number of sublists by default is equal to number of CPUs, it will dispatch equal, potentially large, number of tasks, waking up many CPUs to handle them, even if only one or few of sublists actually have any work to do. This change adds check for empty sublists to avoid this. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Feb 25 15:52:35 2020 (r358312) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue Feb 25 15:53:17 2020 (r358313) @@ -1294,6 +1294,8 @@ dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx zio_t *zio; list_t *list; dbuf_dirty_record_t *dr; + int num_sublists; + multilist_t *ml; blkptr_t *blkptr_copy = kmem_alloc(sizeof (*os->os_rootbp), KM_SLEEP); *blkptr_copy = *os->os_rootbp; @@ -1362,10 +1364,13 @@ dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx } } - for (int i = 0; - i < multilist_get_num_sublists(os->os_dirty_dnodes[txgoff]); i++) { + ml = os->os_dirty_dnodes[txgoff]; + num_sublists = multilist_get_num_sublists(ml); + for (int i = 0; i < num_sublists; i++) { + if (multilist_sublist_is_empty_idx(ml, i)) + continue; sync_dnodes_arg_t *sda = kmem_alloc(sizeof (*sda), KM_SLEEP); - sda->sda_list = os->os_dirty_dnodes[txgoff]; + sda->sda_list = ml; sda->sda_sublist_idx = i; sda->sda_tx = tx; (void) taskq_dispatch(dmu_objset_pool(os)->dp_sync_taskq, @@ -1579,6 +1584,8 @@ userquota_updates_task(void *arg) void dmu_objset_do_userquota_updates(objset_t *os, dmu_tx_t *tx) { + int num_sublists; + if (!dmu_objset_userused_enabled(os)) return; @@ -1592,8 +1599,10 @@ dmu_objset_do_userquota_updates(objset_t *os, dmu_tx_t DMU_OT_USERGROUP_USED, DMU_OT_NONE, 0, tx)); } - for (int i = 0; - i < multilist_get_num_sublists(os->os_synced_dnodes); i++) { + num_sublists = multilist_get_num_sublists(os->os_synced_dnodes); + for (int i = 0; i < num_sublists; i++) { + if (multilist_sublist_is_empty_idx(os->os_synced_dnodes, i)) + continue; userquota_updates_arg_t *uua = kmem_alloc(sizeof (*uua), KM_SLEEP); uua->uua_os = os; Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c Tue Feb 25 15:52:35 2020 (r358312) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/multilist.c Tue Feb 25 15:53:17 2020 (r358313) @@ -360,6 +360,28 @@ multilist_sublist_remove(multilist_sublist_t *mls, voi list_remove(&mls->mls_list, obj); } +int +multilist_sublist_is_empty(multilist_sublist_t *mls) +{ + ASSERT(MUTEX_HELD(&mls->mls_lock)); + return (list_is_empty(&mls->mls_list)); +} + +int +multilist_sublist_is_empty_idx(multilist_t *ml, unsigned int sublist_idx) +{ + multilist_sublist_t *mls; + int empty; + + ASSERT3U(sublist_idx, <, ml->ml_num_sublists); + mls = &ml->ml_sublists[sublist_idx]; + ASSERT(!MUTEX_HELD(&mls->mls_lock)); + mutex_enter(&mls->mls_lock); + empty = list_is_empty(&mls->mls_list); + mutex_exit(&mls->mls_lock); + return (empty); +} + void * multilist_sublist_head(multilist_sublist_t *mls) { Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Tue Feb 25 15:52:35 2020 (r358312) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/multilist.h Tue Feb 25 15:53:17 2020 (r358313) @@ -90,6 +90,8 @@ void multilist_sublist_insert_head(multilist_sublist_t void multilist_sublist_insert_tail(multilist_sublist_t *, void *); void multilist_sublist_move_forward(multilist_sublist_t *mls, void *obj); void multilist_sublist_remove(multilist_sublist_t *, void *); +int multilist_sublist_is_empty(multilist_sublist_t *); +int multilist_sublist_is_empty_idx(multilist_t *, unsigned int); void *multilist_sublist_head(multilist_sublist_t *); void *multilist_sublist_tail(multilist_sublist_t *); From owner-svn-src-stable@freebsd.org Tue Feb 25 21:02:53 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 260B12402E0; Tue, 25 Feb 2020 21:02:53 +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 48Rrx90HQ4z3K69; Tue, 25 Feb 2020 21:02:53 +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 04A851CA3D; Tue, 25 Feb 2020 21:02:53 +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 01PL2q8t065269; Tue, 25 Feb 2020 21:02:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01PL2qa9065268; Tue, 25 Feb 2020 21:02:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202002252102.01PL2qa9065268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 25 Feb 2020 21:02:52 +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: r358321 - in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Commit-Revision: 358321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2020 21:02:53 -0000 Author: cy Date: Tue Feb 25 21:02:52 2020 New Revision: 358321 URL: https://svnweb.freebsd.org/changeset/base/358321 Log: MFC r358064: As with ipf(8), give ippool(8) the ability to load IP pools from multiple files. This allows for loading, during the same invocation of ippool, of multiple sources of input using multiple tools to concurrently maintain the files such as fail2ban, macro preprocessors, and manually. Modified: stable/11/contrib/ipfilter/man/ippool.8 stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/ipfilter/man/ippool.8 stable/12/contrib/ipfilter/tools/ippool.c Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/11/contrib/ipfilter/man/ippool.8 Tue Feb 25 19:29:05 2020 (r358320) +++ stable/11/contrib/ipfilter/man/ippool.8 Tue Feb 25 21:02:52 2020 (r358321) @@ -12,7 +12,7 @@ ippool \- user interface to the IPFilter pools -A [-dnv] [-m ] [-o ] [-S ] -t .br .B ippool --f [-dnuv] +-f [-dnuv] [-f ] [-t ] Modified: stable/11/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/11/contrib/ipfilter/tools/ippool.c Tue Feb 25 19:29:05 2020 (r358320) +++ stable/11/contrib/ipfilter/tools/ippool.c Tue Feb 25 21:02:52 2020 (r358321) @@ -377,12 +377,16 @@ loadpoolfile(argc, argv, infile) { int c; - while ((c = getopt(argc, argv, "dnuv")) != -1) + while ((c = getopt(argc, argv, "dnuvf:")) != -1) switch (c) { case 'd' : opts |= OPT_DEBUG; ippool_yydebug++; + break; + case 'f' : + if (loadpoolfile(argc, argv, optarg) != 0) + return(-1); break; case 'n' : opts |= OPT_DONOTHING|OPT_DONTOPEN; From owner-svn-src-stable@freebsd.org Tue Feb 25 21:02:53 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFE1E2402ED; Tue, 25 Feb 2020 21:02:53 +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 48Rrx949jGz3K6P; Tue, 25 Feb 2020 21:02:53 +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 8A2141CA3E; Tue, 25 Feb 2020 21:02:53 +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 01PL2r7L065276; Tue, 25 Feb 2020 21:02:53 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01PL2rg6065275; Tue, 25 Feb 2020 21:02:53 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202002252102.01PL2rg6065275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 25 Feb 2020 21:02: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: r358321 - in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/man 11/contrib/ipfilter/tools 12/contrib/ipfilter/man 12/contrib/ipfilter/tools X-SVN-Commit-Revision: 358321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2020 21:02:53 -0000 Author: cy Date: Tue Feb 25 21:02:52 2020 New Revision: 358321 URL: https://svnweb.freebsd.org/changeset/base/358321 Log: MFC r358064: As with ipf(8), give ippool(8) the ability to load IP pools from multiple files. This allows for loading, during the same invocation of ippool, of multiple sources of input using multiple tools to concurrently maintain the files such as fail2ban, macro preprocessors, and manually. Modified: stable/12/contrib/ipfilter/man/ippool.8 stable/12/contrib/ipfilter/tools/ippool.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/man/ippool.8 stable/11/contrib/ipfilter/tools/ippool.c Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/12/contrib/ipfilter/man/ippool.8 Tue Feb 25 19:29:05 2020 (r358320) +++ stable/12/contrib/ipfilter/man/ippool.8 Tue Feb 25 21:02:52 2020 (r358321) @@ -12,7 +12,7 @@ ippool \- user interface to the IPFilter pools -A [-dnv] [-m ] [-o ] [-S ] -t .br .B ippool --f [-dnuv] +-f [-dnuv] [-f ] [-t ] Modified: stable/12/contrib/ipfilter/tools/ippool.c ============================================================================== --- stable/12/contrib/ipfilter/tools/ippool.c Tue Feb 25 19:29:05 2020 (r358320) +++ stable/12/contrib/ipfilter/tools/ippool.c Tue Feb 25 21:02:52 2020 (r358321) @@ -381,12 +381,16 @@ loadpoolfile(argc, argv, infile) { int c; - while ((c = getopt(argc, argv, "dnuv")) != -1) + while ((c = getopt(argc, argv, "dnuvf:")) != -1) switch (c) { case 'd' : opts |= OPT_DEBUG; ippool_yydebug++; + break; + case 'f' : + if (loadpoolfile(argc, argv, optarg) != 0) + return(-1); break; case 'n' : opts |= OPT_DONOTHING|OPT_DONTOPEN; From owner-svn-src-stable@freebsd.org Wed Feb 26 13:23:55 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 068AD258408; Wed, 26 Feb 2020 13:23:54 +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 48SGj62mfwz3Lpx; Wed, 26 Feb 2020 13:23:54 +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 A372927FCD; Wed, 26 Feb 2020 13:23:53 +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 01QDNr4P051532; Wed, 26 Feb 2020 13:23:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01QDNrRA051531; Wed, 26 Feb 2020 13:23:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002261323.01QDNrRA051531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 26 Feb 2020 13:23: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: r358331 - stable/12/sys/mips/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/mips/conf X-SVN-Commit-Revision: 358331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2020 13:23:55 -0000 Author: kevans Date: Wed Feb 26 13:23:52 2020 New Revision: 358331 URL: https://svnweb.freebsd.org/changeset/base/358331 Log: MFC r347515: Catch up with r347241 (if_tuntap rename). Modified: stable/12/sys/mips/conf/std.AR_MIPS_BASE Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/mips/conf/std.AR_MIPS_BASE ============================================================================== --- stable/12/sys/mips/conf/std.AR_MIPS_BASE Wed Feb 26 13:22:23 2020 (r358330) +++ stable/12/sys/mips/conf/std.AR_MIPS_BASE Wed Feb 26 13:23:52 2020 (r358331) @@ -21,8 +21,8 @@ options SCSI_NO_OP_STRINGS # .. And no sysctl strings options NO_SYSCTL_DESCR -makeoptions MODULES_OVERRIDE+="gpio ar71xx if_gif if_vlan if_gre if_tap" -makeoptions MODULES_OVERRIDE+="if_tun if_bridge bridgestp usb" +makeoptions MODULES_OVERRIDE+="gpio ar71xx if_gif if_vlan if_gre if_tuntap" +makeoptions MODULES_OVERRIDE+="if_bridge bridgestp usb" makeoptions MODULES_OVERRIDE+="alq" # Random - required during early boot! From owner-svn-src-stable@freebsd.org Thu Feb 27 00:51:31 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94A6E24CD2A; Thu, 27 Feb 2020 00:51:31 +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 48SYyW2Xgcz3G7c; Thu, 27 Feb 2020 00:51:31 +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 5030E85BA; Thu, 27 Feb 2020 00:51:31 +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 01R0pVaf059897; Thu, 27 Feb 2020 00:51:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01R0pVGk059896; Thu, 27 Feb 2020 00:51:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002270051.01R0pVGk059896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 27 Feb 2020 00:51:31 +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: r358359 - stable/12/sys/dev/pci X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/pci X-SVN-Commit-Revision: 358359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 00:51:31 -0000 Author: kib Date: Thu Feb 27 00:51:30 2020 New Revision: 358359 URL: https://svnweb.freebsd.org/changeset/base/358359 Log: MFC r358174: Add more values for PCI capabilities, PCIe extended capabilities, and subclasses. Modified: stable/12/sys/dev/pci/pcireg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/pci/pcireg.h ============================================================================== --- stable/12/sys/dev/pci/pcireg.h Wed Feb 26 23:17:16 2020 (r358358) +++ stable/12/sys/dev/pci/pcireg.h Thu Feb 27 00:51:30 2020 (r358359) @@ -152,6 +152,7 @@ #define PCIY_SATA 0x12 /* SATA */ #define PCIY_PCIAF 0x13 /* PCI Advanced Features */ #define PCIY_EA 0x14 /* PCI Extended Allocation */ +#define PCIY_FPB 0x15 /* Flattening Portal Bridge */ /* Extended Capability Register Fields */ @@ -195,6 +196,20 @@ #define PCIZ_LN_REQ 0x001c /* LN Requester */ #define PCIZ_DPC 0x001d /* Downstream Port Containment */ #define PCIZ_L1PM 0x001e /* L1 PM Substates */ +#define PCIZ_PTM 0x001f /* Precision Time Measurement */ +#define PCIZ_M_PCIE 0x0020 /* PCIe over M-PHY */ +#define PCIZ_FRS 0x0021 /* FRS Queuing */ +#define PCIZ_RTR 0x0022 /* Readiness Time Reporting */ +#define PCIZ_DVSEC 0x0023 /* Designated Vendor-Specific */ +#define PCIZ_VF_REBAR 0x0024 /* VF Resizable BAR */ +#define PCIZ_DLNK 0x0025 /* Data Link Feature */ +#define PCIZ_16GT 0x0026 /* Physical Layer 16.0 GT/s */ +#define PCIZ_LMR 0x0027 /* Lane Margining at Receiver */ +#define PCIZ_HIER_ID 0x0028 /* Hierarchy ID */ +#define PCIZ_NPEM 0x0029 /* Native PCIe Enclosure Management */ +#define PCIZ_PL32 0x002a /* Physical Layer 32.0 GT/s */ +#define PCIZ_AP 0x002b /* Alternate Protocol */ +#define PCIZ_SFI 0x002c /* System Firmware Intermediary */ /* config registers for header type 0 devices */ @@ -335,6 +350,8 @@ #define PCIS_STORAGE_NVM 0x08 #define PCIP_STORAGE_NVM_NVMHCI_1_0 0x01 #define PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0 0x02 +#define PCIS_STORAGE_UFS 0x09 +#define PCIP_STORAGE_UFS_UFSHCI_1_0 0x01 #define PCIS_STORAGE_OTHER 0x80 #define PCIC_NETWORK 0x02 @@ -345,6 +362,8 @@ #define PCIS_NETWORK_ISDN 0x04 #define PCIS_NETWORK_WORLDFIP 0x05 #define PCIS_NETWORK_PICMG 0x06 +#define PCIS_NETWORK_INFINIBAND 0x07 +#define PCIS_NETWORK_HFC 0x08 #define PCIS_NETWORK_OTHER 0x80 #define PCIC_DISPLAY 0x03 @@ -358,6 +377,7 @@ #define PCIS_MULTIMEDIA_AUDIO 0x01 #define PCIS_MULTIMEDIA_TELE 0x02 #define PCIS_MULTIMEDIA_HDA 0x03 +#define PCIP_MULTIMEDIA_HDA_VENDOR 0x01 #define PCIS_MULTIMEDIA_OTHER 0x80 #define PCIC_MEMORY 0x05 @@ -378,6 +398,8 @@ #define PCIS_BRIDGE_RACEWAY 0x08 #define PCIS_BRIDGE_PCI_TRANSPARENT 0x09 #define PCIS_BRIDGE_INFINIBAND 0x0a +#define PCIS_BRIDGE_AS_PCI 0x0b +#define PCIS_BRIDGE_AS_PCI_ASI_SIG 0x01 #define PCIS_BRIDGE_OTHER 0x80 #define PCIC_SIMPLECOMM 0x07 @@ -409,6 +431,7 @@ #define PCIS_BASEPERIPH_PCIHOT 0x04 #define PCIS_BASEPERIPH_SDHC 0x05 #define PCIS_BASEPERIPH_IOMMU 0x06 +#define PCIS_BASEPERIPH_RCEC 0x07 #define PCIS_BASEPERIPH_OTHER 0x80 #define PCIC_INPUTDEV 0x09 @@ -451,6 +474,7 @@ #define PCIP_SERIALBUS_IPMI_BT 0x02 #define PCIS_SERIALBUS_SERCOS 0x08 #define PCIS_SERIALBUS_CANBUS 0x09 +#define PCIS_SERIALBUS_MIPI_I3C 0x0a #define PCIC_WIRELESS 0x0d #define PCIS_WIRELESS_IRDA 0x00 @@ -460,6 +484,8 @@ #define PCIS_WIRELESS_BROADBAND 0x12 #define PCIS_WIRELESS_80211A 0x20 #define PCIS_WIRELESS_80211B 0x21 +#define PCIS_WIRELESS_CELL 0x40 +#define PCIS_WIRELESS_CELL_E 0x41 #define PCIS_WIRELESS_OTHER 0x80 #define PCIC_INTELLIIO 0x0e From owner-svn-src-stable@freebsd.org Thu Feb 27 00:55:32 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8755724CEF4; Thu, 27 Feb 2020 00:55:32 +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 48SZ382ZnZz3LkM; Thu, 27 Feb 2020 00:55:32 +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 2A4328721; Thu, 27 Feb 2020 00:55:32 +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 01R0tWO1064391; Thu, 27 Feb 2020 00:55:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01R0tVuf064389; Thu, 27 Feb 2020 00:55:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002270055.01R0tVuf064389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 27 Feb 2020 00:55:31 +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: r358360 - stable/12/usr.sbin/pciconf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/usr.sbin/pciconf X-SVN-Commit-Revision: 358360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 00:55:32 -0000 Author: kib Date: Thu Feb 27 00:55:31 2020 New Revision: 358360 URL: https://svnweb.freebsd.org/changeset/base/358360 Log: MFC r358175: Print out some newly added PCIe extended capabilities and subclasses. Modified: stable/12/usr.sbin/pciconf/cap.c stable/12/usr.sbin/pciconf/pciconf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/pciconf/cap.c ============================================================================== --- stable/12/usr.sbin/pciconf/cap.c Thu Feb 27 00:51:30 2020 (r358359) +++ stable/12/usr.sbin/pciconf/cap.c Thu Feb 27 00:55:31 2020 (r358360) @@ -988,6 +988,20 @@ static struct { { PCIZ_LN_REQ, "LN Requester" }, { PCIZ_DPC, "Downstream Port Containment" }, { PCIZ_L1PM, "L1 PM Substates" }, + { PCIZ_PTM, "Precision Time Measurement" }, + { PCIZ_M_PCIE, "PCIe over M-PHY" }, + { PCIZ_FRS, "FRS Queuing" }, + { PCIZ_RTR, "Readiness Time Reporting" }, + { PCIZ_DVSEC, "Designated Vendor-Specific" }, + { PCIZ_VF_REBAR, "VF Resizable BAR" }, + { PCIZ_DLNK, "Data Link Feature" }, + { PCIZ_16GT, "Physical Layer 16.0 GT/s" }, + { PCIZ_LMR, "Lane Margining at Receiver" }, + { PCIZ_HIER_ID, "Hierarchy ID" }, + { PCIZ_NPEM, "Native PCIe Enclosure Management" }, + { PCIZ_PL32, "Physical Layer 32.0 GT/s" }, + { PCIZ_AP, "Alternate Protocol" }, + { PCIZ_SFI, "System Firmware Intermediary" }, { 0, NULL } }; Modified: stable/12/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/12/usr.sbin/pciconf/pciconf.c Thu Feb 27 00:51:30 2020 (r358359) +++ stable/12/usr.sbin/pciconf/pciconf.c Thu Feb 27 00:55:31 2020 (r358360) @@ -647,12 +647,17 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM"}, + {PCIC_STORAGE, PCIS_STORAGE_UFS, "UFS"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, {PCIC_NETWORK, PCIS_NETWORK_FDDI, "fddi"}, {PCIC_NETWORK, PCIS_NETWORK_ATM, "ATM"}, {PCIC_NETWORK, PCIS_NETWORK_ISDN, "ISDN"}, + {PCIC_NETWORK, PCIS_NETWORK_WORLDFIP, "WorldFip"}, + {PCIC_NETWORK, PCIS_NETWORK_PICMG, "PICMG"}, + {PCIC_NETWORK, PCIS_NETWORK_INFINIBAND, "InfiniBand"}, + {PCIC_NETWORK, PCIS_NETWORK_HFC, "host fabric"}, {PCIC_DISPLAY, -1, "display"}, {PCIC_DISPLAY, PCIS_DISPLAY_VGA, "VGA"}, {PCIC_DISPLAY, PCIS_DISPLAY_XGA, "XGA"}, @@ -675,6 +680,11 @@ static struct {PCIC_BRIDGE, PCIS_BRIDGE_NUBUS, "PCI-NuBus"}, {PCIC_BRIDGE, PCIS_BRIDGE_CARDBUS, "PCI-CardBus"}, {PCIC_BRIDGE, PCIS_BRIDGE_RACEWAY, "PCI-RACEway"}, + {PCIC_BRIDGE, PCIS_BRIDGE_PCI_TRANSPARENT, + "Semi-transparent PCI-to-PCI"}, + {PCIC_BRIDGE, PCIS_BRIDGE_INFINIBAND, "InfiniBand-PCI"}, + {PCIC_BRIDGE, PCIS_BRIDGE_AS_PCI, + "AdvancedSwitching-PCI"}, {PCIC_SIMPLECOMM, -1, "simple comms"}, {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_UART, "UART"}, /* could detect 16550 */ {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_PAR, "parallel port"}, @@ -688,6 +698,8 @@ static struct {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug controller"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, "SD host controller"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_IOMMU, "IOMMU"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RCEC, + "Root Complex Event Collector"}, {PCIC_INPUTDEV, -1, "input device"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"}, @@ -703,10 +715,23 @@ static struct {PCIC_SERIALBUS, PCIS_SERIALBUS_USB, "USB"}, {PCIC_SERIALBUS, PCIS_SERIALBUS_FC, "Fibre Channel"}, {PCIC_SERIALBUS, PCIS_SERIALBUS_SMBUS, "SMBus"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_INFINIBAND, "InfiniBand"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_IPMI, "IPMI"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_SERCOS, "SERCOS"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_CANBUS, "CANbus"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_MIPI_I3C, "MIPI I3C"}, {PCIC_WIRELESS, -1, "wireless controller"}, {PCIC_WIRELESS, PCIS_WIRELESS_IRDA, "iRDA"}, {PCIC_WIRELESS, PCIS_WIRELESS_IR, "IR"}, {PCIC_WIRELESS, PCIS_WIRELESS_RF, "RF"}, + {PCIC_WIRELESS, PCIS_WIRELESS_BLUETOOTH, "bluetooth"}, + {PCIC_WIRELESS, PCIS_WIRELESS_BROADBAND, "broadband"}, + {PCIC_WIRELESS, PCIS_WIRELESS_80211A, "ethernet 802.11a"}, + {PCIC_WIRELESS, PCIS_WIRELESS_80211B, "ethernet 802.11b"}, + {PCIC_WIRELESS, PCIS_WIRELESS_CELL, + "cellular controller/modem"}, + {PCIC_WIRELESS, PCIS_WIRELESS_CELL_E, + "cellular controller/modem plus ethernet"}, {PCIC_INTELLIIO, -1, "intelligent I/O controller"}, {PCIC_INTELLIIO, PCIS_INTELLIIO_I2O, "I2O"}, {PCIC_SATCOM, -1, "satellite communication"}, From owner-svn-src-stable@freebsd.org Thu Feb 27 00:57:03 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AB8924D01A; Thu, 27 Feb 2020 00:57:03 +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 48SZ4v12vlz3PdD; Thu, 27 Feb 2020 00:57:03 +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 F37838726; Thu, 27 Feb 2020 00:57: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 01R0v2LO064521; Thu, 27 Feb 2020 00:57:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01R0v2GY064520; Thu, 27 Feb 2020 00:57:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002270057.01R0v2GY064520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 27 Feb 2020 00: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: r358361 - stable/11/sys/dev/pci X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/pci X-SVN-Commit-Revision: 358361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 00:57:03 -0000 Author: kib Date: Thu Feb 27 00:57:02 2020 New Revision: 358361 URL: https://svnweb.freebsd.org/changeset/base/358361 Log: MFC r358174: Add more values for PCI capabilities, PCIe extended capabilities, and subclasses. Modified: stable/11/sys/dev/pci/pcireg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/pci/pcireg.h ============================================================================== --- stable/11/sys/dev/pci/pcireg.h Thu Feb 27 00:55:31 2020 (r358360) +++ stable/11/sys/dev/pci/pcireg.h Thu Feb 27 00:57:02 2020 (r358361) @@ -150,6 +150,7 @@ #define PCIY_SATA 0x12 /* SATA */ #define PCIY_PCIAF 0x13 /* PCI Advanced Features */ #define PCIY_EA 0x14 /* PCI Extended Allocation */ +#define PCIY_FPB 0x15 /* Flattening Portal Bridge */ /* Extended Capability Register Fields */ @@ -193,6 +194,20 @@ #define PCIZ_LN_REQ 0x001c /* LN Requester */ #define PCIZ_DPC 0x001d /* Downstream Port Containment */ #define PCIZ_L1PM 0x001e /* L1 PM Substates */ +#define PCIZ_PTM 0x001f /* Precision Time Measurement */ +#define PCIZ_M_PCIE 0x0020 /* PCIe over M-PHY */ +#define PCIZ_FRS 0x0021 /* FRS Queuing */ +#define PCIZ_RTR 0x0022 /* Readiness Time Reporting */ +#define PCIZ_DVSEC 0x0023 /* Designated Vendor-Specific */ +#define PCIZ_VF_REBAR 0x0024 /* VF Resizable BAR */ +#define PCIZ_DLNK 0x0025 /* Data Link Feature */ +#define PCIZ_16GT 0x0026 /* Physical Layer 16.0 GT/s */ +#define PCIZ_LMR 0x0027 /* Lane Margining at Receiver */ +#define PCIZ_HIER_ID 0x0028 /* Hierarchy ID */ +#define PCIZ_NPEM 0x0029 /* Native PCIe Enclosure Management */ +#define PCIZ_PL32 0x002a /* Physical Layer 32.0 GT/s */ +#define PCIZ_AP 0x002b /* Alternate Protocol */ +#define PCIZ_SFI 0x002c /* System Firmware Intermediary */ /* config registers for header type 0 devices */ @@ -333,6 +348,8 @@ #define PCIS_STORAGE_NVM 0x08 #define PCIP_STORAGE_NVM_NVMHCI_1_0 0x01 #define PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0 0x02 +#define PCIS_STORAGE_UFS 0x09 +#define PCIP_STORAGE_UFS_UFSHCI_1_0 0x01 #define PCIS_STORAGE_OTHER 0x80 #define PCIC_NETWORK 0x02 @@ -343,6 +360,8 @@ #define PCIS_NETWORK_ISDN 0x04 #define PCIS_NETWORK_WORLDFIP 0x05 #define PCIS_NETWORK_PICMG 0x06 +#define PCIS_NETWORK_INFINIBAND 0x07 +#define PCIS_NETWORK_HFC 0x08 #define PCIS_NETWORK_OTHER 0x80 #define PCIC_DISPLAY 0x03 @@ -356,6 +375,7 @@ #define PCIS_MULTIMEDIA_AUDIO 0x01 #define PCIS_MULTIMEDIA_TELE 0x02 #define PCIS_MULTIMEDIA_HDA 0x03 +#define PCIP_MULTIMEDIA_HDA_VENDOR 0x01 #define PCIS_MULTIMEDIA_OTHER 0x80 #define PCIC_MEMORY 0x05 @@ -376,6 +396,8 @@ #define PCIS_BRIDGE_RACEWAY 0x08 #define PCIS_BRIDGE_PCI_TRANSPARENT 0x09 #define PCIS_BRIDGE_INFINIBAND 0x0a +#define PCIS_BRIDGE_AS_PCI 0x0b +#define PCIS_BRIDGE_AS_PCI_ASI_SIG 0x01 #define PCIS_BRIDGE_OTHER 0x80 #define PCIC_SIMPLECOMM 0x07 @@ -407,6 +429,7 @@ #define PCIS_BASEPERIPH_PCIHOT 0x04 #define PCIS_BASEPERIPH_SDHC 0x05 #define PCIS_BASEPERIPH_IOMMU 0x06 +#define PCIS_BASEPERIPH_RCEC 0x07 #define PCIS_BASEPERIPH_OTHER 0x80 #define PCIC_INPUTDEV 0x09 @@ -449,6 +472,7 @@ #define PCIP_SERIALBUS_IPMI_BT 0x02 #define PCIS_SERIALBUS_SERCOS 0x08 #define PCIS_SERIALBUS_CANBUS 0x09 +#define PCIS_SERIALBUS_MIPI_I3C 0x0a #define PCIC_WIRELESS 0x0d #define PCIS_WIRELESS_IRDA 0x00 @@ -458,6 +482,8 @@ #define PCIS_WIRELESS_BROADBAND 0x12 #define PCIS_WIRELESS_80211A 0x20 #define PCIS_WIRELESS_80211B 0x21 +#define PCIS_WIRELESS_CELL 0x40 +#define PCIS_WIRELESS_CELL_E 0x41 #define PCIS_WIRELESS_OTHER 0x80 #define PCIC_INTELLIIO 0x0e From owner-svn-src-stable@freebsd.org Thu Feb 27 00:57:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F4F524D0E9; Thu, 27 Feb 2020 00:57:37 +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 48SZ5Y1tp8z3QnH; Thu, 27 Feb 2020 00:57:37 +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 2E8E88728; Thu, 27 Feb 2020 00:57:37 +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 01R0vbYP064603; Thu, 27 Feb 2020 00:57:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01R0van7064601; Thu, 27 Feb 2020 00:57:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002270057.01R0van7064601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 27 Feb 2020 00:57:36 +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: r358362 - stable/11/usr.sbin/pciconf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/usr.sbin/pciconf X-SVN-Commit-Revision: 358362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 00:57:37 -0000 Author: kib Date: Thu Feb 27 00:57:36 2020 New Revision: 358362 URL: https://svnweb.freebsd.org/changeset/base/358362 Log: MFC r358175: Print out some newly added PCIe extended capabilities and subclasses. Modified: stable/11/usr.sbin/pciconf/cap.c stable/11/usr.sbin/pciconf/pciconf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/pciconf/cap.c ============================================================================== --- stable/11/usr.sbin/pciconf/cap.c Thu Feb 27 00:57:02 2020 (r358361) +++ stable/11/usr.sbin/pciconf/cap.c Thu Feb 27 00:57:36 2020 (r358362) @@ -979,6 +979,20 @@ static struct { { PCIZ_LN_REQ, "LN Requester" }, { PCIZ_DPC, "Downstream Port Containment" }, { PCIZ_L1PM, "L1 PM Substates" }, + { PCIZ_PTM, "Precision Time Measurement" }, + { PCIZ_M_PCIE, "PCIe over M-PHY" }, + { PCIZ_FRS, "FRS Queuing" }, + { PCIZ_RTR, "Readiness Time Reporting" }, + { PCIZ_DVSEC, "Designated Vendor-Specific" }, + { PCIZ_VF_REBAR, "VF Resizable BAR" }, + { PCIZ_DLNK, "Data Link Feature" }, + { PCIZ_16GT, "Physical Layer 16.0 GT/s" }, + { PCIZ_LMR, "Lane Margining at Receiver" }, + { PCIZ_HIER_ID, "Hierarchy ID" }, + { PCIZ_NPEM, "Native PCIe Enclosure Management" }, + { PCIZ_PL32, "Physical Layer 32.0 GT/s" }, + { PCIZ_AP, "Alternate Protocol" }, + { PCIZ_SFI, "System Firmware Intermediary" }, { 0, NULL } }; Modified: stable/11/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/11/usr.sbin/pciconf/pciconf.c Thu Feb 27 00:57:02 2020 (r358361) +++ stable/11/usr.sbin/pciconf/pciconf.c Thu Feb 27 00:57:36 2020 (r358362) @@ -625,12 +625,17 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM"}, + {PCIC_STORAGE, PCIS_STORAGE_UFS, "UFS"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, {PCIC_NETWORK, PCIS_NETWORK_FDDI, "fddi"}, {PCIC_NETWORK, PCIS_NETWORK_ATM, "ATM"}, {PCIC_NETWORK, PCIS_NETWORK_ISDN, "ISDN"}, + {PCIC_NETWORK, PCIS_NETWORK_WORLDFIP, "WorldFip"}, + {PCIC_NETWORK, PCIS_NETWORK_PICMG, "PICMG"}, + {PCIC_NETWORK, PCIS_NETWORK_INFINIBAND, "InfiniBand"}, + {PCIC_NETWORK, PCIS_NETWORK_HFC, "host fabric"}, {PCIC_DISPLAY, -1, "display"}, {PCIC_DISPLAY, PCIS_DISPLAY_VGA, "VGA"}, {PCIC_DISPLAY, PCIS_DISPLAY_XGA, "XGA"}, @@ -653,6 +658,11 @@ static struct {PCIC_BRIDGE, PCIS_BRIDGE_NUBUS, "PCI-NuBus"}, {PCIC_BRIDGE, PCIS_BRIDGE_CARDBUS, "PCI-CardBus"}, {PCIC_BRIDGE, PCIS_BRIDGE_RACEWAY, "PCI-RACEway"}, + {PCIC_BRIDGE, PCIS_BRIDGE_PCI_TRANSPARENT, + "Semi-transparent PCI-to-PCI"}, + {PCIC_BRIDGE, PCIS_BRIDGE_INFINIBAND, "InfiniBand-PCI"}, + {PCIC_BRIDGE, PCIS_BRIDGE_AS_PCI, + "AdvancedSwitching-PCI"}, {PCIC_SIMPLECOMM, -1, "simple comms"}, {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_UART, "UART"}, /* could detect 16550 */ {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_PAR, "parallel port"}, @@ -666,6 +676,8 @@ static struct {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug controller"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, "SD host controller"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_IOMMU, "IOMMU"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RCEC, + "Root Complex Event Collector"}, {PCIC_INPUTDEV, -1, "input device"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"}, @@ -681,10 +693,23 @@ static struct {PCIC_SERIALBUS, PCIS_SERIALBUS_USB, "USB"}, {PCIC_SERIALBUS, PCIS_SERIALBUS_FC, "Fibre Channel"}, {PCIC_SERIALBUS, PCIS_SERIALBUS_SMBUS, "SMBus"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_INFINIBAND, "InfiniBand"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_IPMI, "IPMI"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_SERCOS, "SERCOS"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_CANBUS, "CANbus"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_MIPI_I3C, "MIPI I3C"}, {PCIC_WIRELESS, -1, "wireless controller"}, {PCIC_WIRELESS, PCIS_WIRELESS_IRDA, "iRDA"}, {PCIC_WIRELESS, PCIS_WIRELESS_IR, "IR"}, {PCIC_WIRELESS, PCIS_WIRELESS_RF, "RF"}, + {PCIC_WIRELESS, PCIS_WIRELESS_BLUETOOTH, "bluetooth"}, + {PCIC_WIRELESS, PCIS_WIRELESS_BROADBAND, "broadband"}, + {PCIC_WIRELESS, PCIS_WIRELESS_80211A, "ethernet 802.11a"}, + {PCIC_WIRELESS, PCIS_WIRELESS_80211B, "ethernet 802.11b"}, + {PCIC_WIRELESS, PCIS_WIRELESS_CELL, + "cellular controller/modem"}, + {PCIC_WIRELESS, PCIS_WIRELESS_CELL_E, + "cellular controller/modem plus ethernet"}, {PCIC_INTELLIIO, -1, "intelligent I/O controller"}, {PCIC_INTELLIIO, PCIS_INTELLIIO_I2O, "I2O"}, {PCIC_SATCOM, -1, "satellite communication"}, From owner-svn-src-stable@freebsd.org Thu Feb 27 14:48:13 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7729F243707; Thu, 27 Feb 2020 14:48:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48SwWx14jZz46fw; Thu, 27 Feb 2020 14:48:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3B291A560; Thu, 27 Feb 2020 14:48:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01REmClX060892; Thu, 27 Feb 2020 14:48:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01REmCaA060891; Thu, 27 Feb 2020 14:48:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202002271448.01REmCaA060891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Feb 2020 14:48: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: r358383 - stable/12/stand/libsa/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/stand/libsa/zfs X-SVN-Commit-Revision: 358383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 14:48:13 -0000 Author: avg Date: Thu Feb 27 14:48:12 2020 New Revision: 358383 URL: https://svnweb.freebsd.org/changeset/base/358383 Log: MFC r355736: zfs boot: fix a crash in a rarely taken path in fzap_lookup Instead of passing NULL to fzap_name_equal and crashing, just return ENOENT. This happened when higher bits of a hash of the searched key (its hash prefix) matched a hash prefix of some key in the ZAP, but the full hash value of the searched key did not match any key in the ZAP. I observerved this problem when loader tried to look up "features_for_read" in a particular old pool that predates pool features. Sponsored by: Panzura Modified: stable/12/stand/libsa/zfs/zfsimpl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/libsa/zfs/zfsimpl.c ============================================================================== --- stable/12/stand/libsa/zfs/zfsimpl.c Thu Feb 27 14:27:42 2020 (r358382) +++ stable/12/stand/libsa/zfs/zfsimpl.c Thu Feb 27 14:48:12 2020 (r358383) @@ -2515,10 +2515,8 @@ fzap_lookup(const spa_t *spa, const dnode_phys_t *dnod return (ENOENT); zc = &ZAP_LEAF_CHUNK(&zl, h); while (zc->l_entry.le_hash != hash) { - if (zc->l_entry.le_next == 0xffff) { - zc = NULL; - break; - } + if (zc->l_entry.le_next == 0xffff) + return (ENOENT); zc = &ZAP_LEAF_CHUNK(&zl, zc->l_entry.le_next); } if (fzap_name_equal(&zl, zc, name)) { From owner-svn-src-stable@freebsd.org Thu Feb 27 14:50:03 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9133C2437BD; Thu, 27 Feb 2020 14:50:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48SwZ32pSGz4BZX; Thu, 27 Feb 2020 14:50:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7C631A567; Thu, 27 Feb 2020 14:50:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01REo2ua061078; Thu, 27 Feb 2020 14:50:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01REo2pd061077; Thu, 27 Feb 2020 14:50:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202002271450.01REo2pd061077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Feb 2020 14:50:02 +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: r358384 - stable/12/sys/dev/hyperv/storvsc X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/hyperv/storvsc X-SVN-Commit-Revision: 358384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 14:50:03 -0000 Author: avg Date: Thu Feb 27 14:50:02 2020 New Revision: 358384 URL: https://svnweb.freebsd.org/changeset/base/358384 Log: MFC r356730: storvsc: properly set residual data length on errors This change is based on Linux commit 40630f462824ee. csio.resid should account for transfer_len only for success and SRB_STATUS_DATA_OVERRUN condition. I am not sure how exactly this change works, but I have a report from a user that they see lots of checksum errors when running a pool scrub concurrently with iozone -l 1 -s 100G. After applying this patch the problem cannot be reproduced. Sponsored by: CyberSecure Modified: stable/12/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/12/sys/dev/hyperv/storvsc/hv_vstorage.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/12/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Feb 27 14:48:12 2020 (r358383) +++ stable/12/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Feb 27 14:50:02 2020 (r358384) @@ -2278,7 +2278,11 @@ storvsc_io_done(struct hv_storvsc_request *reqp) } ccb->csio.scsi_status = (vm_srb->scsi_status & 0xFF); - ccb->csio.resid = ccb->csio.dxfer_len - vm_srb->transfer_len; + if (srb_status == SRB_STATUS_SUCCESS || + srb_status == SRB_STATUS_DATA_OVERRUN) + ccb->csio.resid = ccb->csio.dxfer_len - vm_srb->transfer_len; + else + ccb->csio.resid = ccb->csio.dxfer_len; if (reqp->sense_info_len != 0) { csio->sense_resid = csio->sense_len - reqp->sense_info_len; Modified: stable/12/sys/dev/hyperv/storvsc/hv_vstorage.h ============================================================================== --- stable/12/sys/dev/hyperv/storvsc/hv_vstorage.h Thu Feb 27 14:48:12 2020 (r358383) +++ stable/12/sys/dev/hyperv/storvsc/hv_vstorage.h Thu Feb 27 14:50:02 2020 (r358384) @@ -245,7 +245,8 @@ struct vstor_packet { #define SRB_STATUS_SUCCESS 0x01 #define SRB_STATUS_ABORTED 0x02 #define SRB_STATUS_ERROR 0x04 -#define SRB_STATUS_INVALID_LUN 0x20 +#define SRB_STATUS_DATA_OVERRUN 0x12 +#define SRB_STATUS_INVALID_LUN 0x20 /** * SRB Status Masks (can be combined with above status codes) */ From owner-svn-src-stable@freebsd.org Thu Feb 27 14:52:56 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF631243A1D; Thu, 27 Feb 2020 14:52:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48SwdN41yyz4KMq; Thu, 27 Feb 2020 14:52:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57E041A724; Thu, 27 Feb 2020 14:52:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01REqu6a066427; Thu, 27 Feb 2020 14:52:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01REqtiF066425; Thu, 27 Feb 2020 14:52:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202002271452.01REqtiF066425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Feb 2020 14:52:55 +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: r358385 - stable/12/sys/dev/virtio/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/virtio/scsi X-SVN-Commit-Revision: 358385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 14:52:57 -0000 Author: avg Date: Thu Feb 27 14:52:55 2020 New Revision: 358385 URL: https://svnweb.freebsd.org/changeset/base/358385 Log: MFC r357040: virtio_scsi: use max target ID plus one as the initiator ID This bus does not really have a concept of the initiator ID, so use a guaranteed dummy one that won't conflict with any real target. This change fixes a problem with virtio_scsi on GCE where disks get sequential target IDs starting from one. If there are seven or more disks, then a disk with the target ID of seven would not be discovered by FreeBSD as that ID was reserved as the initiator ID -- see scsi_scan_bus(). Sponsored by: Panzura Modified: stable/12/sys/dev/virtio/scsi/virtio_scsi.c stable/12/sys/dev/virtio/scsi/virtio_scsivar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- stable/12/sys/dev/virtio/scsi/virtio_scsi.c Thu Feb 27 14:50:02 2020 (r358384) +++ stable/12/sys/dev/virtio/scsi/virtio_scsi.c Thu Feb 27 14:52:55 2020 (r358385) @@ -940,7 +940,7 @@ vtscsi_cam_path_inquiry(struct vtscsi_softc *sc, struc cpi->max_target = sc->vtscsi_max_target; cpi->max_lun = sc->vtscsi_max_lun; - cpi->initiator_id = VTSCSI_INITIATOR_ID; + cpi->initiator_id = cpi->max_target + 1; strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strlcpy(cpi->hba_vid, "VirtIO", HBA_IDLEN); Modified: stable/12/sys/dev/virtio/scsi/virtio_scsivar.h ============================================================================== --- stable/12/sys/dev/virtio/scsi/virtio_scsivar.h Thu Feb 27 14:50:02 2020 (r358384) +++ stable/12/sys/dev/virtio/scsi/virtio_scsivar.h Thu Feb 27 14:52:55 2020 (r358385) @@ -205,11 +205,6 @@ struct vtscsi_request { #define VTSCSI_RESERVED_REQUESTS 10 /* - * Specification doesn't say, use traditional SCSI default. - */ -#define VTSCSI_INITIATOR_ID 7 - -/* * How to wait (or not) for request completion. */ #define VTSCSI_EXECUTE_ASYNC 0 From owner-svn-src-stable@freebsd.org Thu Feb 27 15:08:44 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3E552441E6; Thu, 27 Feb 2020 15:08:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Swzc29N3z4dxj; Thu, 27 Feb 2020 15:08:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11EFD1A8FA; Thu, 27 Feb 2020 15:08:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01RF8hYt072619; Thu, 27 Feb 2020 15:08:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01RF8hYN072616; Thu, 27 Feb 2020 15:08:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202002271508.01RF8hYN072616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Feb 2020 15:08:43 +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: r358386 - in stable/12/sys: dev/vmware/vmxnet3 modules/vmware/vmxnet3 X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12/sys: dev/vmware/vmxnet3 modules/vmware/vmxnet3 X-SVN-Commit-Revision: 358386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 15:08:44 -0000 Author: avg Date: Thu Feb 27 15:08:43 2020 New Revision: 358386 URL: https://svnweb.freebsd.org/changeset/base/358386 Log: MFC r357042: vmxnet3: add support for RSS kernel option We observe at least one problem: if a UDP socket is connect(2)-ed, then a received packet that matches the connection cannot be matched to the corresponding PCB because of an incorrect flow ID. That was oberved for DNS requests from the libc resolver. We got this problem because FreeBSD r343291 enabled code that can set rsstype of received packets to values other than M_HASHTYPE_OPAQUE_HASH. Earlier that code was under 'ifdef notyet'. The essence of this change is to use the system-wide RSS key instead of some historic hardcoded key when the software RSS is enabled and it is configured to use Toeplitz algorithm (the default). In all other cases, the driver reports the opaque hash type for received packets while still using Toeplitz algorithm with the internal key. PR: 242890 Sponsored by: Panzura Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.c stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h stable/12/sys/modules/vmware/vmxnet3/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/12/sys/dev/vmware/vmxnet3/if_vmx.c Thu Feb 27 14:52:55 2020 (r358385) +++ stable/12/sys/dev/vmware/vmxnet3/if_vmx.c Thu Feb 27 15:08:43 2020 (r358386) @@ -23,6 +23,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_rss.h" + #include #include #include @@ -46,6 +48,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef RSS +#include +#endif #include #include @@ -1140,8 +1145,11 @@ vmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *s struct vmxnet3_driver_shared *ds; if_softc_ctx_t scctx; struct vmxnet3_rss_shared *rss; +#ifdef RSS + uint8_t rss_algo; +#endif int i; - + ds = sc->vmx_ds; scctx = sc->vmx_scctx; rss = sc->vmx_rss; @@ -1152,10 +1160,29 @@ vmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *s rss->hash_func = UPT1_RSS_HASH_FUNC_TOEPLITZ; rss->hash_key_size = UPT1_RSS_MAX_KEY_SIZE; rss->ind_table_size = UPT1_RSS_MAX_IND_TABLE_SIZE; - memcpy(rss->hash_key, rss_key, UPT1_RSS_MAX_KEY_SIZE); - - for (i = 0; i < UPT1_RSS_MAX_IND_TABLE_SIZE; i++) - rss->ind_table[i] = i % scctx->isc_nrxqsets; +#ifdef RSS + /* + * If the software RSS is configured to anything else other than + * Toeplitz, then just do Toeplitz in "hardware" for the sake of + * the packet distribution, but report the hash as opaque to + * disengage from the software RSS. + */ + rss_algo = rss_gethashalgo(); + if (rss_algo == RSS_HASH_TOEPLITZ) { + rss_getkey(rss->hash_key); + for (i = 0; i < UPT1_RSS_MAX_IND_TABLE_SIZE; i++) { + rss->ind_table[i] = rss_get_indirection_to_bucket(i) % + scctx->isc_nrxqsets; + } + sc->vmx_flags |= VMXNET3_FLAG_SOFT_RSS; + } else +#endif + { + memcpy(rss->hash_key, rss_key, UPT1_RSS_MAX_KEY_SIZE); + for (i = 0; i < UPT1_RSS_MAX_IND_TABLE_SIZE; i++) + rss->ind_table[i] = i % scctx->isc_nrxqsets; + sc->vmx_flags &= ~VMXNET3_FLAG_SOFT_RSS; + } } static void @@ -1499,29 +1526,50 @@ vmxnet3_isc_rxd_pkt_get(void *vsc, if_rxd_info_t ri) KASSERT(rxcd->sop, ("%s: expected sop", __func__)); /* - * RSS and flow ID + * RSS and flow ID. + * Types other than M_HASHTYPE_NONE and M_HASHTYPE_OPAQUE_HASH should + * be used only if the software RSS is enabled and it uses the same + * algorithm and the hash key as the "hardware". If the software RSS + * is not enabled, then it's simply pointless to use those types. + * If it's enabled but with different parameters, then hash values will + * not match. */ ri->iri_flowid = rxcd->rss_hash; - switch (rxcd->rss_type) { - case VMXNET3_RCD_RSS_TYPE_NONE: - ri->iri_flowid = ri->iri_qsidx; - ri->iri_rsstype = M_HASHTYPE_NONE; - break; - case VMXNET3_RCD_RSS_TYPE_IPV4: - ri->iri_rsstype = M_HASHTYPE_RSS_IPV4; - break; - case VMXNET3_RCD_RSS_TYPE_TCPIPV4: - ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV4; - break; - case VMXNET3_RCD_RSS_TYPE_IPV6: - ri->iri_rsstype = M_HASHTYPE_RSS_IPV6; - break; - case VMXNET3_RCD_RSS_TYPE_TCPIPV6: - ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV6; - break; - default: - ri->iri_rsstype = M_HASHTYPE_OPAQUE_HASH; - break; +#ifdef RSS + if ((sc->vmx_flags & VMXNET3_FLAG_SOFT_RSS) != 0) { + switch (rxcd->rss_type) { + case VMXNET3_RCD_RSS_TYPE_NONE: + ri->iri_flowid = ri->iri_qsidx; + ri->iri_rsstype = M_HASHTYPE_NONE; + break; + case VMXNET3_RCD_RSS_TYPE_IPV4: + ri->iri_rsstype = M_HASHTYPE_RSS_IPV4; + break; + case VMXNET3_RCD_RSS_TYPE_TCPIPV4: + ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV4; + break; + case VMXNET3_RCD_RSS_TYPE_IPV6: + ri->iri_rsstype = M_HASHTYPE_RSS_IPV6; + break; + case VMXNET3_RCD_RSS_TYPE_TCPIPV6: + ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV6; + break; + default: + ri->iri_rsstype = M_HASHTYPE_OPAQUE_HASH; + break; + } + } else +#endif + { + switch (rxcd->rss_type) { + case VMXNET3_RCD_RSS_TYPE_NONE: + ri->iri_flowid = ri->iri_qsidx; + ri->iri_rsstype = M_HASHTYPE_NONE; + break; + default: + ri->iri_rsstype = M_HASHTYPE_OPAQUE_HASH; + break; + } } /* VLAN */ Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h ============================================================================== --- stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h Thu Feb 27 14:52:55 2020 (r358385) +++ stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h Thu Feb 27 15:08:43 2020 (r358386) @@ -113,6 +113,8 @@ struct vmxnet3_softc { struct vmxnet3_driver_shared *vmx_ds; uint32_t vmx_flags; #define VMXNET3_FLAG_RSS 0x0002 +#define VMXNET3_FLAG_SOFT_RSS 0x0004 /* Software RSS is enabled with + compatible algorithm. */ struct vmxnet3_rxqueue *vmx_rxq; struct vmxnet3_txqueue *vmx_txq; Modified: stable/12/sys/modules/vmware/vmxnet3/Makefile ============================================================================== --- stable/12/sys/modules/vmware/vmxnet3/Makefile Thu Feb 27 14:52:55 2020 (r358385) +++ stable/12/sys/modules/vmware/vmxnet3/Makefile Thu Feb 27 15:08:43 2020 (r358386) @@ -28,6 +28,6 @@ KMOD= if_vmx SRCS= if_vmx.c SRCS+= bus_if.h device_if.h pci_if.h ifdi_if.h -SRCS+= opt_inet.h opt_inet6.h +SRCS+= opt_inet.h opt_inet6.h opt_rss.h .include From owner-svn-src-stable@freebsd.org Thu Feb 27 15:22:20 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36DF7244E43; Thu, 27 Feb 2020 15:22:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48SxHG6y36z4BNs; Thu, 27 Feb 2020 15:22:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 983F61ACDA; Thu, 27 Feb 2020 15:22:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01RFMIcY083724; Thu, 27 Feb 2020 15:22:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01RFMIST083723; Thu, 27 Feb 2020 15:22:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202002271522.01RFMIST083723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 27 Feb 2020 15:22:18 +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: r358388 - stable/12/lib/libdevstat X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/lib/libdevstat X-SVN-Commit-Revision: 358388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2020 15:22:20 -0000 Author: avg Date: Thu Feb 27 15:22:18 2020 New Revision: 358388 URL: https://svnweb.freebsd.org/changeset/base/358388 Log: MFC r355325: devstat_selectdevs: resize dev_select only after copying data The resizing could be a downsizing so some data would be lost and we could attempt to read past the end of the new memory allocation. Sponsored by: Panzura Modified: stable/12/lib/libdevstat/devstat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libdevstat/devstat.c ============================================================================== --- stable/12/lib/libdevstat/devstat.c Thu Feb 27 15:21:05 2020 (r358387) +++ stable/12/lib/libdevstat/devstat.c Thu Feb 27 15:22:18 2020 (r358388) @@ -584,10 +584,10 @@ devstat_selectdevs(struct device_selection **dev_selec * In this case, we have selected devices before, but the device * list has changed since we last selected devices, so we need to * either enlarge or reduce the size of the device selection list. + * But delay the resizing until after copying the data to old_dev_select + * as to not lose any data in the case of reducing the size. */ } else if (*num_selections != numdevs) { - *dev_select = (struct device_selection *)reallocf(*dev_select, - numdevs * sizeof(struct device_selection)); *select_generation = current_generation; init_selections = 1; /* @@ -643,6 +643,11 @@ devstat_selectdevs(struct device_selection **dev_selec old_num_selections = *num_selections; bcopy(*dev_select, old_dev_select, sizeof(struct device_selection) * *num_selections); + } + + if (!changed && *num_selections != numdevs) { + *dev_select = (struct device_selection *)reallocf(*dev_select, + numdevs * sizeof(struct device_selection)); } if (init_selections != 0) { From owner-svn-src-stable@freebsd.org Fri Feb 28 17:41:48 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79282240613; Fri, 28 Feb 2020 17:41:48 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48TcKm2CQkz4KDZ; Fri, 28 Feb 2020 17:41:48 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0905D568F; Fri, 28 Feb 2020 17:41:48 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01SHflaJ039534; Fri, 28 Feb 2020 17:41:47 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01SHflec038450; Fri, 28 Feb 2020 17:41:47 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202002281741.01SHflec038450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Fri, 28 Feb 2020 17:41:47 +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: r358438 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 358438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2020 17:41:48 -0000 Author: vmaffione Date: Fri Feb 28 17:41:46 2020 New Revision: 358438 URL: https://svnweb.freebsd.org/changeset/base/358438 Log: MFC r358180 bhyve: enable virtio-net mergeable rx buffers for tap(4) This patch adds a new netbe_peek_recvlen() function to the net backend API. The new function allows the virtio-net receive code to know in advance how many virtio descriptors chains will be needed to receive the next packet. As a result, the implementation of the virtio-net mergeable rx buffers feature becomes efficient, so that we can enable it also with the tap(4) backend. For the tap(4) backend, a bounce buffer is introduced to implement the peeck_recvlen() callback, which implies an additional packet copy on the receive datapath. In the future, it should be possible to remove the bounce buffer (and so the additional copy), by obtaining the length of the next packet from kevent data. Reviewed by: grehan, aleksandr.fedorov@itglobal.com Differential Revision: https://reviews.freebsd.org/D23472 Modified: stable/12/usr.sbin/bhyve/iov.c stable/12/usr.sbin/bhyve/iov.h stable/12/usr.sbin/bhyve/net_backends.c stable/12/usr.sbin/bhyve/net_backends.h stable/12/usr.sbin/bhyve/pci_virtio_net.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/iov.c ============================================================================== --- stable/12/usr.sbin/bhyve/iov.c Fri Feb 28 17:38:31 2020 (r358437) +++ stable/12/usr.sbin/bhyve/iov.c Fri Feb 28 17:41:46 2020 (r358438) @@ -119,24 +119,25 @@ iov_to_buf(const struct iovec *iov, int niov, void **b } ssize_t -buf_to_iov(const void *buf, size_t buflen, struct iovec *iov, int niov, +buf_to_iov(const void *buf, size_t buflen, const struct iovec *iov, int niov, size_t seek) { struct iovec *diov; - int ndiov, i; size_t off = 0, len; + int i; if (seek > 0) { + int ndiov; + diov = malloc(sizeof(struct iovec) * niov); seek_iov(iov, niov, diov, &ndiov, seek); - } else { - diov = iov; - ndiov = niov; + iov = diov; + niov = ndiov; } - for (i = 0; i < ndiov && off < buflen; i++) { - len = MIN(diov[i].iov_len, buflen - off); - memcpy(diov[i].iov_base, buf + off, len); + for (i = 0; i < niov && off < buflen; i++) { + len = MIN(iov[i].iov_len, buflen - off); + memcpy(iov[i].iov_base, buf + off, len); off += len; } Modified: stable/12/usr.sbin/bhyve/iov.h ============================================================================== --- stable/12/usr.sbin/bhyve/iov.h Fri Feb 28 17:38:31 2020 (r358437) +++ stable/12/usr.sbin/bhyve/iov.h Fri Feb 28 17:41:46 2020 (r358438) @@ -38,7 +38,7 @@ void seek_iov(const struct iovec *iov1, int niov1, str void truncate_iov(struct iovec *iov, int *niov, size_t length); size_t count_iov(const struct iovec *iov, int niov); ssize_t iov_to_buf(const struct iovec *iov, int niov, void **buf); -ssize_t buf_to_iov(const void *buf, size_t buflen, struct iovec *iov, int niov, - size_t seek); +ssize_t buf_to_iov(const void *buf, size_t buflen, const struct iovec *iov, + int niov, size_t seek); #endif /* _IOV_H_ */ Modified: stable/12/usr.sbin/bhyve/net_backends.c ============================================================================== --- stable/12/usr.sbin/bhyve/net_backends.c Fri Feb 28 17:38:31 2020 (r358437) +++ stable/12/usr.sbin/bhyve/net_backends.c Fri Feb 28 17:41:46 2020 (r358438) @@ -103,6 +103,13 @@ struct net_backend { int iovcnt); /* + * Get the length of the next packet that can be received from + * the backend. If no packets are currently available, this + * function returns 0. + */ + ssize_t (*peek_recvlen)(struct net_backend *be); + + /* * Called to receive a packet from the backend. When the function * returns a positive value 'len', the scatter-gather vector * provided by the caller contains a packet with such length. @@ -167,6 +174,13 @@ SET_DECLARE(net_backend_set, struct net_backend); struct tap_priv { struct mevent *mevp; + /* + * A bounce buffer that allows us to implement the peek_recvlen + * callback. In the future we may get the same information from + * the kevent data. + */ + char bbuf[1 << 16]; + ssize_t bbuflen; }; static void @@ -223,6 +237,9 @@ tap_init(struct net_backend *be, const char *devname, errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif + memset(priv->bbuf, 0, sizeof(priv->bbuf)); + priv->bbuflen = 0; + priv->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param); if (priv->mevp == NULL) { WPRINTF(("Could not register event")); @@ -246,15 +263,56 @@ tap_send(struct net_backend *be, const struct iovec *i } static ssize_t +tap_peek_recvlen(struct net_backend *be) +{ + struct tap_priv *priv = (struct tap_priv *)be->opaque; + ssize_t ret; + + if (priv->bbuflen > 0) { + /* + * We already have a packet in the bounce buffer. + * Just return its length. + */ + return priv->bbuflen; + } + + /* + * Read the next packet (if any) into the bounce buffer, so + * that we get to know its length and we can return that + * to the caller. + */ + ret = read(be->fd, priv->bbuf, sizeof(priv->bbuf)); + if (ret < 0 && errno == EWOULDBLOCK) { + return (0); + } + + if (ret > 0) + priv->bbuflen = ret; + + return (ret); +} + +static ssize_t tap_recv(struct net_backend *be, const struct iovec *iov, int iovcnt) { + struct tap_priv *priv = (struct tap_priv *)be->opaque; ssize_t ret; - /* Should never be called without a valid tap fd */ - assert(be->fd != -1); + if (priv->bbuflen > 0) { + /* + * A packet is available in the bounce buffer, so + * we read it from there. + */ + ret = buf_to_iov(priv->bbuf, priv->bbuflen, + iov, iovcnt, 0); - ret = readv(be->fd, iov, iovcnt); + /* Mark the bounce buffer as empty. */ + priv->bbuflen = 0; + return (ret); + } + + ret = readv(be->fd, iov, iovcnt); if (ret < 0 && errno == EWOULDBLOCK) { return (0); } @@ -299,6 +357,7 @@ static struct net_backend tap_backend = { .init = tap_init, .cleanup = tap_cleanup, .send = tap_send, + .peek_recvlen = tap_peek_recvlen, .recv = tap_recv, .recv_enable = tap_recv_enable, .recv_disable = tap_recv_disable, @@ -313,6 +372,7 @@ static struct net_backend vmnet_backend = { .init = tap_init, .cleanup = tap_cleanup, .send = tap_send, + .peek_recvlen = tap_peek_recvlen, .recv = tap_recv, .recv_enable = tap_recv_enable, .recv_disable = tap_recv_disable, @@ -331,8 +391,7 @@ DATA_SET(net_backend_set, vmnet_backend); #define NETMAP_FEATURES (VIRTIO_NET_F_CSUM | VIRTIO_NET_F_HOST_TSO4 | \ VIRTIO_NET_F_HOST_TSO6 | VIRTIO_NET_F_HOST_UFO | \ VIRTIO_NET_F_GUEST_CSUM | VIRTIO_NET_F_GUEST_TSO4 | \ - VIRTIO_NET_F_GUEST_TSO6 | VIRTIO_NET_F_GUEST_UFO | \ - VIRTIO_NET_F_MRG_RXBUF) + VIRTIO_NET_F_GUEST_TSO6 | VIRTIO_NET_F_GUEST_UFO) struct netmap_priv { char ifname[IFNAMSIZ]; @@ -540,6 +599,26 @@ txsync: } static ssize_t +netmap_peek_recvlen(struct net_backend *be) +{ + struct netmap_priv *priv = (struct netmap_priv *)be->opaque; + struct netmap_ring *ring = priv->rx; + uint32_t head = ring->head; + ssize_t totlen = 0; + + while (head != ring->tail) { + struct netmap_slot *slot = ring->slot + head; + + totlen += slot->len; + if ((slot->flags & NS_MOREFRAG) == 0) + break; + head = nm_ring_next(ring, head); + } + + return (totlen); +} + +static ssize_t netmap_recv(struct net_backend *be, const struct iovec *iov, int iovcnt) { struct netmap_priv *priv = (struct netmap_priv *)be->opaque; @@ -628,6 +707,7 @@ static struct net_backend netmap_backend = { .init = netmap_init, .cleanup = netmap_cleanup, .send = netmap_send, + .peek_recvlen = netmap_peek_recvlen, .recv = netmap_recv, .recv_enable = netmap_recv_enable, .recv_disable = netmap_recv_disable, @@ -642,6 +722,7 @@ static struct net_backend vale_backend = { .init = netmap_init, .cleanup = netmap_cleanup, .send = netmap_send, + .peek_recvlen = netmap_peek_recvlen, .recv = netmap_recv, .recv_enable = netmap_recv_enable, .recv_disable = netmap_recv_disable, @@ -756,6 +837,13 @@ netbe_send(struct net_backend *be, const struct iovec { return (be->send(be, iov, iovcnt)); +} + +ssize_t +netbe_peek_recvlen(struct net_backend *be) +{ + + return (be->peek_recvlen(be)); } /* Modified: stable/12/usr.sbin/bhyve/net_backends.h ============================================================================== --- stable/12/usr.sbin/bhyve/net_backends.h Fri Feb 28 17:38:31 2020 (r358437) +++ stable/12/usr.sbin/bhyve/net_backends.h Fri Feb 28 17:41:46 2020 (r358438) @@ -45,6 +45,7 @@ int netbe_set_cap(net_backend_t *be, uint64_t cap, unsigned vnet_hdr_len); size_t netbe_get_vnet_hdr_len(net_backend_t *be); ssize_t netbe_send(net_backend_t *be, const struct iovec *iov, int iovcnt); +ssize_t netbe_peek_recvlen(net_backend_t *be); ssize_t netbe_recv(net_backend_t *be, const struct iovec *iov, int iovcnt); ssize_t netbe_rx_discard(net_backend_t *be); void netbe_rx_disable(net_backend_t *be); Modified: stable/12/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_net.c Fri Feb 28 17:38:31 2020 (r358437) +++ stable/12/usr.sbin/bhyve/pci_virtio_net.c Fri Feb 28 17:41:46 2020 (r358438) @@ -228,22 +228,34 @@ pci_vtnet_rx(struct pci_vtnet_softc *sc) struct virtio_mrg_rxbuf_info info[VTNET_MAXSEGS]; struct iovec iov[VTNET_MAXSEGS + 1]; struct vqueue_info *vq; - uint32_t riov_bytes; - struct iovec *riov; - int riov_len; - uint32_t ulen; - int n_chains; - int len; vq = &sc->vsc_queues[VTNET_RXQ]; for (;;) { struct virtio_net_rxhdr *hdr; + uint32_t riov_bytes; + struct iovec *riov; + uint32_t ulen; + int riov_len; + int n_chains; + ssize_t rlen; + ssize_t plen; + plen = netbe_peek_recvlen(sc->vsc_be); + if (plen <= 0) { + /* + * No more packets (plen == 0), or backend errored + * (plen < 0). Interrupt if needed and stop. + */ + vq_endchains(vq, /*used_all_avail=*/0); + return; + } + plen += prepend_hdr_len; + /* * Get a descriptor chain to store the next ingress * packet. In case of mergeable rx buffers, get as * many chains as necessary in order to make room - * for a maximum sized LRO packet. + * for plen bytes. */ riov_bytes = 0; riov_len = 0; @@ -287,8 +299,7 @@ pci_vtnet_rx(struct pci_vtnet_softc *sc) riov_bytes += info[n_chains].len; riov += n; n_chains++; - } while (riov_bytes < VTNET_MAX_PKT_LEN && - riov_len < VTNET_MAXSEGS); + } while (riov_bytes < plen && riov_len < VTNET_MAXSEGS); riov = iov; hdr = riov[0].iov_base; @@ -312,21 +323,20 @@ pci_vtnet_rx(struct pci_vtnet_softc *sc) memset(hdr, 0, prepend_hdr_len); } - len = netbe_recv(sc->vsc_be, riov, riov_len); - - if (len <= 0) { + rlen = netbe_recv(sc->vsc_be, riov, riov_len); + if (rlen != plen - prepend_hdr_len) { /* - * No more packets (len == 0), or backend errored - * (err < 0). Return unused available buffers - * and stop. + * If this happens it means there is something + * wrong with the backend (e.g., some other + * process is stealing our packets). */ + WPRINTF(("netbe_recv: expected %zd bytes, " + "got %zd", plen - prepend_hdr_len, rlen)); vq_retchains(vq, n_chains); - /* Interrupt if needed/appropriate and stop. */ - vq_endchains(vq, /*used_all_avail=*/0); - return; + continue; } - ulen = (uint32_t)(len + prepend_hdr_len); + ulen = (uint32_t)plen; /* * Publish the used buffers to the guest, reporting the @@ -346,12 +356,11 @@ pci_vtnet_rx(struct pci_vtnet_softc *sc) vq_relchain_prepare(vq, info[i].idx, iolen); ulen -= iolen; i++; - assert(i <= n_chains); } while (ulen > 0); hdr->vrh_bufs = i; vq_relchain_publish(vq); - vq_retchains(vq, n_chains - i); + assert(i == n_chains); } } @@ -592,7 +601,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * free(sc); return (err); } - sc->vsc_consts.vc_hv_caps |= netbe_get_cap(sc->vsc_be); + sc->vsc_consts.vc_hv_caps |= VIRTIO_NET_F_MRG_RXBUF | + netbe_get_cap(sc->vsc_be); } if (!mac_provided) { From owner-svn-src-stable@freebsd.org Fri Feb 28 18:34:18 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03EB5241811; Fri, 28 Feb 2020 18:34:18 +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 48TdVK630tz4CFh; Fri, 28 Feb 2020 18:34:17 +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 C5089604C; Fri, 28 Feb 2020 18:34:17 +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 01SIYH7R071905; Fri, 28 Feb 2020 18:34:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01SIYHlS071904; Fri, 28 Feb 2020 18:34:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002281834.01SIYHlS071904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 28 Feb 2020 18:34: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: r358441 - in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Commit-Revision: 358441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2020 18:34:18 -0000 Author: kevans Date: Fri Feb 28 18:34:17 2020 New Revision: 358441 URL: https://svnweb.freebsd.org/changeset/base/358441 Log: MFC r358091: certctl(8): switch to install(1) to fix DESTDIR support "Oops" - ln(1) is fine and dandy, but when you're using DESTDIR...it's not- the path will almost certainly be invalid once the root you've just installed to is relocated, perhaps to /. Switch to install(1) using `-l rs` to calculate the relative symlink between the two, which should work just fine in all cases. Modified: stable/11/usr.sbin/certctl/certctl.sh Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/certctl/certctl.sh Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/certctl/certctl.sh ============================================================================== --- stable/11/usr.sbin/certctl/certctl.sh Fri Feb 28 18:32:40 2020 (r358440) +++ stable/11/usr.sbin/certctl/certctl.sh Fri Feb 28 18:34:17 2020 (r358441) @@ -69,7 +69,7 @@ create_trusted_link() return 1 fi [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && ln -fs $(realpath "$1") "$CERTDESTDIR/$hash.0" + [ $NOOP -eq 0 ] && install -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0" } create_blacklisted() @@ -88,7 +88,7 @@ create_blacklisted() return fi [ $VERBOSE -gt 0 ] && echo "Adding $filename to blacklist" - [ $NOOP -eq 0 ] && ln -fs "$srcfile" "$BLACKLISTDESTDIR/$filename" + [ $NOOP -eq 0 ] && install -lrs "$srcfile" "$BLACKLISTDESTDIR/$filename" } do_scan() From owner-svn-src-stable@freebsd.org Fri Feb 28 18:34:18 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88F41241817; Fri, 28 Feb 2020 18:34:18 +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 48TdVL2VxRz4CGY; Fri, 28 Feb 2020 18:34:18 +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 277F7604D; Fri, 28 Feb 2020 18:34:18 +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 01SIYIES071911; Fri, 28 Feb 2020 18:34:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01SIYIB0071910; Fri, 28 Feb 2020 18:34:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002281834.01SIYIB0071910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 28 Feb 2020 18:34:18 +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: r358441 - in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Commit-Revision: 358441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2020 18:34:18 -0000 Author: kevans Date: Fri Feb 28 18:34:17 2020 New Revision: 358441 URL: https://svnweb.freebsd.org/changeset/base/358441 Log: MFC r358091: certctl(8): switch to install(1) to fix DESTDIR support "Oops" - ln(1) is fine and dandy, but when you're using DESTDIR...it's not- the path will almost certainly be invalid once the root you've just installed to is relocated, perhaps to /. Switch to install(1) using `-l rs` to calculate the relative symlink between the two, which should work just fine in all cases. Modified: stable/12/usr.sbin/certctl/certctl.sh Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/certctl/certctl.sh Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/certctl/certctl.sh ============================================================================== --- stable/12/usr.sbin/certctl/certctl.sh Fri Feb 28 18:32:40 2020 (r358440) +++ stable/12/usr.sbin/certctl/certctl.sh Fri Feb 28 18:34:17 2020 (r358441) @@ -69,7 +69,7 @@ create_trusted_link() return 1 fi [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && ln -fs $(realpath "$1") "$CERTDESTDIR/$hash.0" + [ $NOOP -eq 0 ] && install -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0" } create_blacklisted() @@ -88,7 +88,7 @@ create_blacklisted() return fi [ $VERBOSE -gt 0 ] && echo "Adding $filename to blacklist" - [ $NOOP -eq 0 ] && ln -fs "$srcfile" "$BLACKLISTDESTDIR/$filename" + [ $NOOP -eq 0 ] && install -lrs "$srcfile" "$BLACKLISTDESTDIR/$filename" } do_scan() From owner-svn-src-stable@freebsd.org Fri Feb 28 18:35:38 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 474C8241916; Fri, 28 Feb 2020 18:35:38 +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 48TdWs1JZ2z4Fq5; Fri, 28 Feb 2020 18:35:37 +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 E3B776056; Fri, 28 Feb 2020 18:35:36 +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 01SIZaol072059; Fri, 28 Feb 2020 18:35:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01SIZaPb072058; Fri, 28 Feb 2020 18:35:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002281835.01SIZaPb072058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 28 Feb 2020 18:35:36 +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: r358442 - in stable: 11/stand/common 12/stand/common X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/stand/common 12/stand/common X-SVN-Commit-Revision: 358442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2020 18:35:38 -0000 Author: kevans Date: Fri Feb 28 18:35:36 2020 New Revision: 358442 URL: https://svnweb.freebsd.org/changeset/base/358442 Log: MFC r357828: interp_lua: fix bogus indentation, NFC Modified: stable/12/stand/common/interp_lua.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/stand/common/interp_lua.c Directory Properties: stable/11/ (props changed) Modified: stable/12/stand/common/interp_lua.c ============================================================================== --- stable/12/stand/common/interp_lua.c Fri Feb 28 18:34:17 2020 (r358441) +++ stable/12/stand/common/interp_lua.c Fri Feb 28 18:35:36 2020 (r358442) @@ -124,10 +124,10 @@ interp_init(void) filename = LOADER_LUA; if (interp_include(filename) != 0) { - const char *errstr = lua_tostring(luap, -1); - errstr = errstr == NULL ? "unknown" : errstr; - printf("Startup error in %s:\nLUA ERROR: %s.\n", filename, errstr); - lua_pop(luap, 1); + const char *errstr = lua_tostring(luap, -1); + errstr = errstr == NULL ? "unknown" : errstr; + printf("Startup error in %s:\nLUA ERROR: %s.\n", filename, errstr); + lua_pop(luap, 1); setenv("autoboot_delay", "NO", 1); } } @@ -144,7 +144,7 @@ interp_run(const char *line) luap = softc->luap; LDBG("executing line..."); if ((status = luaL_dostring(luap, line)) != 0) { - lua_pop(luap, 1); + lua_pop(luap, 1); /* * The line wasn't executable as lua; run it through parse to * to get consistent parsing of command line arguments, then From owner-svn-src-stable@freebsd.org Fri Feb 28 18:35:38 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48127241918; Fri, 28 Feb 2020 18:35:38 +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 48TdWs0r0cz4Fpn; Fri, 28 Feb 2020 18:35:37 +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 ABC1E6055; Fri, 28 Feb 2020 18:35:36 +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 01SIZac3072051; Fri, 28 Feb 2020 18:35:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01SIZadF072050; Fri, 28 Feb 2020 18:35:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202002281835.01SIZadF072050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 28 Feb 2020 18:35:36 +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: r358442 - in stable: 11/stand/common 12/stand/common X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/stand/common 12/stand/common X-SVN-Commit-Revision: 358442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2020 18:35:38 -0000 Author: kevans Date: Fri Feb 28 18:35:36 2020 New Revision: 358442 URL: https://svnweb.freebsd.org/changeset/base/358442 Log: MFC r357828: interp_lua: fix bogus indentation, NFC Modified: stable/11/stand/common/interp_lua.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/stand/common/interp_lua.c Directory Properties: stable/12/ (props changed) Modified: stable/11/stand/common/interp_lua.c ============================================================================== --- stable/11/stand/common/interp_lua.c Fri Feb 28 18:34:17 2020 (r358441) +++ stable/11/stand/common/interp_lua.c Fri Feb 28 18:35:36 2020 (r358442) @@ -124,10 +124,10 @@ interp_init(void) filename = LOADER_LUA; if (interp_include(filename) != 0) { - const char *errstr = lua_tostring(luap, -1); - errstr = errstr == NULL ? "unknown" : errstr; - printf("Startup error in %s:\nLUA ERROR: %s.\n", filename, errstr); - lua_pop(luap, 1); + const char *errstr = lua_tostring(luap, -1); + errstr = errstr == NULL ? "unknown" : errstr; + printf("Startup error in %s:\nLUA ERROR: %s.\n", filename, errstr); + lua_pop(luap, 1); setenv("autoboot_delay", "NO", 1); } } @@ -144,7 +144,7 @@ interp_run(const char *line) luap = softc->luap; LDBG("executing line..."); if ((status = luaL_dostring(luap, line)) != 0) { - lua_pop(luap, 1); + lua_pop(luap, 1); /* * The line wasn't executable as lua; run it through parse to * to get consistent parsing of command line arguments, then From owner-svn-src-stable@freebsd.org Fri Feb 28 22:00:02 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3AAF8247113; Fri, 28 Feb 2020 22:00: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 48Tk3j6zbsz3DfX; Fri, 28 Feb 2020 22:00: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 BB526868D; Fri, 28 Feb 2020 22:00: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 01SM01fV096568; Fri, 28 Feb 2020 22:00:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01SM01VJ096567; Fri, 28 Feb 2020 22:00:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002282200.01SM01VJ096567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 28 Feb 2020 22:00:01 +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: r358452 - stable/12/sys/dev/usb/input X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/usb/input X-SVN-Commit-Revision: 358452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2020 22:00:02 -0000 Author: hselasky Date: Fri Feb 28 22:00:01 2020 New Revision: 358452 URL: https://svnweb.freebsd.org/changeset/base/358452 Log: MFC r358310: Use hid_get_data_unsigned() instead of hid_get_data() when reading the key-codes from the USB keyboard. Negative key-codes are currently skipped. While at it use the bit size value provided by the HID location structure instead of assuming a value of 8. This fixes a regression issue after r357861. Reported by: Minoru TANABE PR: 224592 PR: 233884 Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/input/ukbd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/12/sys/dev/usb/input/ukbd.c Fri Feb 28 21:42:48 2020 (r358451) +++ stable/12/sys/dev/usb/input/ukbd.c Fri Feb 28 22:00:01 2020 (r358452) @@ -701,13 +701,15 @@ ukbd_intr_callback(struct usb_xfer *xfer, usb_error_t } else if (id != sc->sc_id_loc_key[i]) { continue; /* invalid HID ID */ } else if (i == 0) { - offset = sc->sc_loc_key[0].count; - if (offset < 0 || offset > len) - offset = len; - while (offset--) { + struct hid_location tmp_loc = sc->sc_loc_key[0]; + /* range check array size */ + if (tmp_loc.count > UKBD_NKEYCODE) + tmp_loc.count = UKBD_NKEYCODE; + while (tmp_loc.count--) { uint32_t key = - hid_get_data(sc->sc_buffer + offset, len - offset, - &sc->sc_loc_key[i]); + hid_get_data_unsigned(sc->sc_buffer, len, &tmp_loc); + /* advance to next location */ + tmp_loc.pos += tmp_loc.size; if (modifiers & MOD_FN) key = ukbd_apple_fn(key); if (sc->sc_flags & UKBD_FLAG_APPLE_SWAP) From owner-svn-src-stable@freebsd.org Fri Feb 28 22:00:51 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2284B2471B2; Fri, 28 Feb 2020 22:00:51 +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 48Tk4f6RpWz3F9y; Fri, 28 Feb 2020 22:00: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 D7FBC86AF; Fri, 28 Feb 2020 22:00: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 01SM0oje097507; Fri, 28 Feb 2020 22:00:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01SM0oEb097506; Fri, 28 Feb 2020 22:00:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202002282200.01SM0oEb097506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 28 Feb 2020 22:00: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: r358453 - stable/11/sys/dev/usb/input X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb/input X-SVN-Commit-Revision: 358453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2020 22:00:51 -0000 Author: hselasky Date: Fri Feb 28 22:00:50 2020 New Revision: 358453 URL: https://svnweb.freebsd.org/changeset/base/358453 Log: MFC r358310: Use hid_get_data_unsigned() instead of hid_get_data() when reading the key-codes from the USB keyboard. Negative key-codes are currently skipped. While at it use the bit size value provided by the HID location structure instead of assuming a value of 8. This fixes a regression issue after r357861. Reported by: Minoru TANABE PR: 224592 PR: 233884 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/input/ukbd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/11/sys/dev/usb/input/ukbd.c Fri Feb 28 22:00:01 2020 (r358452) +++ stable/11/sys/dev/usb/input/ukbd.c Fri Feb 28 22:00:50 2020 (r358453) @@ -723,13 +723,15 @@ ukbd_intr_callback(struct usb_xfer *xfer, usb_error_t } else if (id != sc->sc_id_loc_key[i]) { continue; /* invalid HID ID */ } else if (i == 0) { - offset = sc->sc_loc_key[0].count; - if (offset < 0 || offset > len) - offset = len; - while (offset--) { + struct hid_location tmp_loc = sc->sc_loc_key[0]; + /* range check array size */ + if (tmp_loc.count > UKBD_NKEYCODE) + tmp_loc.count = UKBD_NKEYCODE; + while (tmp_loc.count--) { uint32_t key = - hid_get_data(sc->sc_buffer + offset, len - offset, - &sc->sc_loc_key[i]); + hid_get_data_unsigned(sc->sc_buffer, len, &tmp_loc); + /* advance to next location */ + tmp_loc.pos += tmp_loc.size; if (modifiers & MOD_FN) key = ukbd_apple_fn(key); if (sc->sc_flags & UKBD_FLAG_APPLE_SWAP) From owner-svn-src-stable@freebsd.org Sat Feb 29 15:39:55 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D074A261950; Sat, 29 Feb 2020 15:39:55 +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 48V9Zg3gwFz4HV1; Sat, 29 Feb 2020 15:39:55 +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 784E51CD85; Sat, 29 Feb 2020 15:39:55 +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 01TFdtSW031888; Sat, 29 Feb 2020 15:39:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01TFdtSE031887; Sat, 29 Feb 2020 15:39:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202002291539.01TFdtSE031887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 29 Feb 2020 15:39:55 +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: r358467 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 358467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Feb 2020 15:39:55 -0000 Author: markj Date: Sat Feb 29 15:39:54 2020 New Revision: 358467 URL: https://svnweb.freebsd.org/changeset/base/358467 Log: MFC r358249: Constify uma_zcache_create() and uma_zsecond_create()'s "name" argument. Modified: stable/12/sys/vm/uma.h stable/12/sys/vm/uma_core.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/uma.h ============================================================================== --- stable/12/sys/vm/uma.h Sat Feb 29 15:08:14 2020 (r358466) +++ stable/12/sys/vm/uma.h Sat Feb 29 15:39:54 2020 (r358467) @@ -214,8 +214,8 @@ uma_zone_t uma_zcreate(const char *name, size_t size, * A pointer to a structure which is intended to be opaque to users of * the interface. The value may be null if the wait flag is not set. */ -uma_zone_t uma_zsecond_create(char *name, uma_ctor ctor, uma_dtor dtor, - uma_init zinit, uma_fini zfini, uma_zone_t master); +uma_zone_t uma_zsecond_create(const char *name, uma_ctor ctor, uma_dtor dtor, + uma_init zinit, uma_fini zfini, uma_zone_t master); /* * Add a second master to a secondary zone. This provides multiple data @@ -237,9 +237,9 @@ int uma_zsecond_add(uma_zone_t zone, uma_zone_t master * zones. The 'arg' parameter is passed to import/release and is caller * specific. */ -uma_zone_t uma_zcache_create(char *name, int size, uma_ctor ctor, uma_dtor dtor, - uma_init zinit, uma_fini zfini, uma_import zimport, - uma_release zrelease, void *arg, int flags); +uma_zone_t uma_zcache_create(const char *name, int size, uma_ctor ctor, + uma_dtor dtor, uma_init zinit, uma_fini zfini, uma_import zimport, + uma_release zrelease, void *arg, int flags); /* * Definitions for uma_zcreate flags Modified: stable/12/sys/vm/uma_core.c ============================================================================== --- stable/12/sys/vm/uma_core.c Sat Feb 29 15:08:14 2020 (r358466) +++ stable/12/sys/vm/uma_core.c Sat Feb 29 15:39:54 2020 (r358467) @@ -2242,8 +2242,8 @@ uma_zcreate(const char *name, size_t size, uma_ctor ct /* See uma.h */ uma_zone_t -uma_zsecond_create(char *name, uma_ctor ctor, uma_dtor dtor, - uma_init zinit, uma_fini zfini, uma_zone_t master) +uma_zsecond_create(const char *name, uma_ctor ctor, uma_dtor dtor, + uma_init zinit, uma_fini zfini, uma_zone_t master) { struct uma_zctor_args args; uma_keg_t keg; @@ -2277,9 +2277,9 @@ uma_zsecond_create(char *name, uma_ctor ctor, uma_dtor /* See uma.h */ uma_zone_t -uma_zcache_create(char *name, int size, uma_ctor ctor, uma_dtor dtor, - uma_init zinit, uma_fini zfini, uma_import zimport, - uma_release zrelease, void *arg, int flags) +uma_zcache_create(const char *name, int size, uma_ctor ctor, uma_dtor dtor, + uma_init zinit, uma_fini zfini, uma_import zimport, uma_release zrelease, + void *arg, int flags) { struct uma_zctor_args args; From owner-svn-src-stable@freebsd.org Sat Feb 29 21:42:37 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AE13241DE7; Sat, 29 Feb 2020 21:42:37 +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 48VKd82PVKz3Kp0; Sat, 29 Feb 2020 21:42:36 +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 2B97121320; Sat, 29 Feb 2020 21:42:36 +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 01TLgZZg060852; Sat, 29 Feb 2020 21:42:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01TLgZKs060847; Sat, 29 Feb 2020 21:42:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002292142.01TLgZKs060847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 29 Feb 2020 21:42: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: r358473 - in stable/12: include lib/libthr lib/libthr/thread share/man/man3 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12: include lib/libthr lib/libthr/thread share/man/man3 X-SVN-Commit-Revision: 358473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Feb 2020 21:42:37 -0000 Author: kib Date: Sat Feb 29 21:42:34 2020 New Revision: 358473 URL: https://svnweb.freebsd.org/changeset/base/358473 Log: MFC r357985: Add pthread_peekjoin_np(3). Modified: stable/12/include/pthread_np.h stable/12/lib/libthr/pthread.map stable/12/lib/libthr/thread/thr_join.c stable/12/share/man/man3/Makefile stable/12/share/man/man3/pthread_join.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/include/pthread_np.h ============================================================================== --- stable/12/include/pthread_np.h Sat Feb 29 19:59:21 2020 (r358472) +++ stable/12/include/pthread_np.h Sat Feb 29 21:42:34 2020 (r358473) @@ -63,6 +63,7 @@ int pthread_mutex_setyieldloops_np(pthread_mutex_t *mu int pthread_mutex_isowned_np(pthread_mutex_t *mutex); void pthread_resume_all_np(void); int pthread_resume_np(pthread_t); +int pthread_peekjoin_np(pthread_t, void **); void pthread_set_name_np(pthread_t, const char *); int pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *); int pthread_single_np(void); Modified: stable/12/lib/libthr/pthread.map ============================================================================== --- stable/12/lib/libthr/pthread.map Sat Feb 29 19:59:21 2020 (r358472) +++ stable/12/lib/libthr/pthread.map Sat Feb 29 21:42:34 2020 (r358473) @@ -326,3 +326,7 @@ FBSD_1.4 { FBSD_1.5 { pthread_get_name_np; }; + +FBSD_1.6 { + pthread_peekjoin_np; +}; Modified: stable/12/lib/libthr/thread/thr_join.c ============================================================================== --- stable/12/lib/libthr/thread/thr_join.c Sat Feb 29 19:59:21 2020 (r358472) +++ stable/12/lib/libthr/thread/thr_join.c Sat Feb 29 21:42:34 2020 (r358473) @@ -36,13 +36,15 @@ __FBSDID("$FreeBSD$"); #include "thr_private.h" +int _pthread_peekjoin_np(pthread_t pthread, void **thread_return); int _pthread_timedjoin_np(pthread_t pthread, void **thread_return, - const struct timespec *abstime); -static int join_common(pthread_t, void **, const struct timespec *); + const struct timespec *abstime); +static int join_common(pthread_t, void **, const struct timespec *, bool peek); __weak_reference(_thr_join, pthread_join); __weak_reference(_thr_join, _pthread_join); __weak_reference(_pthread_timedjoin_np, pthread_timedjoin_np); +__weak_reference(_pthread_peekjoin_np, pthread_peekjoin_np); static void backout_join(void *arg) { @@ -57,7 +59,7 @@ static void backout_join(void *arg) int _thr_join(pthread_t pthread, void **thread_return) { - return (join_common(pthread, thread_return, NULL)); + return (join_common(pthread, thread_return, NULL, false)); } int @@ -68,22 +70,28 @@ _pthread_timedjoin_np(pthread_t pthread, void **thread abstime->tv_nsec >= 1000000000) return (EINVAL); - return (join_common(pthread, thread_return, abstime)); + return (join_common(pthread, thread_return, abstime, false)); } +int +_pthread_peekjoin_np(pthread_t pthread, void **thread_return) +{ + return (join_common(pthread, thread_return, NULL, true)); +} + /* * Cancellation behavior: * if the thread is canceled, joinee is not recycled. */ static int join_common(pthread_t pthread, void **thread_return, - const struct timespec *abstime) + const struct timespec *abstime, bool peek) { struct pthread *curthread = _get_curthread(); struct timespec ts, ts2, *tsp; void *tmp; long tid; - int ret = 0; + int ret; if (pthread == NULL) return (EINVAL); @@ -100,10 +108,21 @@ join_common(pthread_t pthread, void **thread_return, /* Multiple joiners are not supported. */ ret = ENOTSUP; } - if (ret) { + if (ret != 0) { THR_THREAD_UNLOCK(curthread, pthread); return (ret); } + + /* Only peek into status, do not gc the thread. */ + if (peek) { + if (pthread->tid != TID_TERMINATED) + ret = EBUSY; + else if (thread_return != NULL) + *thread_return = pthread->ret; + THR_THREAD_UNLOCK(curthread, pthread); + return (ret); + } + /* Set the running thread to be the joiner: */ pthread->joiner = curthread; Modified: stable/12/share/man/man3/Makefile ============================================================================== --- stable/12/share/man/man3/Makefile Sat Feb 29 19:59:21 2020 (r358472) +++ stable/12/share/man/man3/Makefile Sat Feb 29 21:42:34 2020 (r358473) @@ -368,7 +368,8 @@ PTHREAD_MLINKS+=pthread_spin_init.3 pthread_spin_destr PTHREAD_MLINKS+=pthread_switch_add_np.3 pthread_switch_delete_np.3 PTHREAD_MLINKS+=pthread_testcancel.3 pthread_setcancelstate.3 \ pthread_testcancel.3 pthread_setcanceltype.3 -PTHREAD_MLINKS+=pthread_join.3 pthread_timedjoin_np.3 +PTHREAD_MLINKS+=pthread_join.3 pthread_peekjoin_np.3 \ + pthread_join.3 pthread_timedjoin_np.3 .endif .include Modified: stable/12/share/man/man3/pthread_join.3 ============================================================================== --- stable/12/share/man/man3/pthread_join.3 Sat Feb 29 19:59:21 2020 (r358472) +++ stable/12/share/man/man3/pthread_join.3 Sat Feb 29 21:42:34 2020 (r358473) @@ -30,13 +30,14 @@ .\" .\" $FreeBSD$ .\" -.Dd February 3, 2018 +.Dd February 13, 2019 .Dt PTHREAD_JOIN 3 .Os .Sh NAME .Nm pthread_join , +.Nm pthread_peekjoin_np , .Nm pthread_timedjoin_np -.Nd wait for thread termination +.Nd inspect thread termination state .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS @@ -45,7 +46,16 @@ .Fn pthread_join "pthread_t thread" "void **value_ptr" .In pthread_np.h .Ft int -.Fn pthread_timedjoin_np "pthread_t thread" "void **value_ptr" "const struct timespec *abstime" +.Fo pthread_peekjoin_np +.Fa "pthread_t thread" +.Fa "void **value_ptr" +.Fc +.Ft int +.Fo pthread_timedjoin_np +.Fa "pthread_t thread" +.Fa "void **value_ptr" +.Fa "const struct timespec *abstime" +.Fc .Sh DESCRIPTION The .Fn pthread_join @@ -82,19 +92,30 @@ function except it will return .Er ETIMEDOUT if target thread does not exit before specified absolute time passes. .Pp +The +.Fn pthread_peekjoin_np +only peeks into the exit status of the specified thread. +If the thread has not exited, the +.Er EBUSY +error is returned. +Otherwise, zero is returned and the thread exit value is optionally stored +into the location of +.Fa *value_ptr . +The target thread is left unjoined and can be used as an argument for +the +.Fn pthread_join +family of functions again. +.Pp A thread that has exited but remains unjoined counts against [_POSIX_THREAD_THREADS_MAX]. .Sh RETURN VALUES -If successful, the -.Fn pthread_join -and -.Fn pthread_timedjoin_np -functions will return zero. -Otherwise an error number will be returned to -indicate the error. +If successful, the described functions return zero. +Otherwise an error number is returned to indicate the error or +special condition. .Sh ERRORS The -.Fn pthread_join +.Fn pthread_join , +.Fn pthread_peekjoin_np , and .Fn pthread_timedjoin_np functions will fail if: @@ -125,6 +146,14 @@ The specified absolute time passed while .Fn pthread_timedjoin_np waited for thread exit. .El +.Pp +The +.Fn pthread_peekjoin_np +function will also fail if: +.Bl -tag -width Er +.It Bq Er EBUSY +The specified thread has not yet exited. +.El .Sh SEE ALSO .Xr wait 2 , .Xr pthread_create 3 @@ -139,3 +168,7 @@ function is a .Fx extension which first appeared in .Fx 6.1 . +Another extension, the +.Fn pthread_peekjoin_np +function, first appearead in +.Fx 13.0 . From owner-svn-src-stable@freebsd.org Sat Feb 29 21:55:50 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D0A2242308; Sat, 29 Feb 2020 21:55:50 +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 48VKwP5f7qz47J6; Sat, 29 Feb 2020 21:55:49 +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 8C732214EB; Sat, 29 Feb 2020 21:55:49 +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 01TLtngm067115; Sat, 29 Feb 2020 21:55:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01TLtmLZ067110; Sat, 29 Feb 2020 21:55:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002292155.01TLtmLZ067110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 29 Feb 2020 21:55: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: r358475 - in stable/12/sys: compat/linux kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: compat/linux kern sys X-SVN-Commit-Revision: 358475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Feb 2020 21:55:50 -0000 Author: kib Date: Sat Feb 29 21:55:48 2020 New Revision: 358475 URL: https://svnweb.freebsd.org/changeset/base/358475 Log: MFC r358251: Add td_pflags2, yet another thread-private flags word. Modified: stable/12/sys/compat/linux/linux_fork.c stable/12/sys/kern/kern_fork.c stable/12/sys/kern/kern_kthread.c stable/12/sys/kern/kern_thr.c stable/12/sys/sys/proc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_fork.c ============================================================================== --- stable/12/sys/compat/linux/linux_fork.c Sat Feb 29 21:50:08 2020 (r358474) +++ stable/12/sys/compat/linux/linux_fork.c Sat Feb 29 21:55:48 2020 (r358475) @@ -309,6 +309,7 @@ linux_clone_thread(struct thread *td, struct linux_clo bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); + newtd->td_pflags2 = 0; bcopy(&td->td_startcopy, &newtd->td_startcopy, __rangeof(struct thread, td_startcopy, td_endcopy)); Modified: stable/12/sys/kern/kern_fork.c ============================================================================== --- stable/12/sys/kern/kern_fork.c Sat Feb 29 21:50:08 2020 (r358474) +++ stable/12/sys/kern/kern_fork.c Sat Feb 29 21:55:48 2020 (r358475) @@ -489,6 +489,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct bzero(&td2->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); + td2->td_pflags2 = 0; bcopy(&td->td_startcopy, &td2->td_startcopy, __rangeof(struct thread, td_startcopy, td_endcopy)); Modified: stable/12/sys/kern/kern_kthread.c ============================================================================== --- stable/12/sys/kern/kern_kthread.c Sat Feb 29 21:50:08 2020 (r358474) +++ stable/12/sys/kern/kern_kthread.c Sat Feb 29 21:55:48 2020 (r358475) @@ -283,6 +283,7 @@ kthread_add(void (*func)(void *), void *arg, struct pr bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); + newtd->td_pflags2 = 0; bcopy(&oldtd->td_startcopy, &newtd->td_startcopy, __rangeof(struct thread, td_startcopy, td_endcopy)); Modified: stable/12/sys/kern/kern_thr.c ============================================================================== --- stable/12/sys/kern/kern_thr.c Sat Feb 29 21:50:08 2020 (r358474) +++ stable/12/sys/kern/kern_thr.c Sat Feb 29 21:55:48 2020 (r358475) @@ -235,6 +235,7 @@ thread_create(struct thread *td, struct rtprio *rtp, bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); + newtd->td_pflags2 = 0; bcopy(&td->td_startcopy, &newtd->td_startcopy, __rangeof(struct thread, td_startcopy, td_endcopy)); newtd->td_proc = td->td_proc; Modified: stable/12/sys/sys/proc.h ============================================================================== --- stable/12/sys/sys/proc.h Sat Feb 29 21:50:08 2020 (r358474) +++ stable/12/sys/sys/proc.h Sat Feb 29 21:55:48 2020 (r358475) @@ -368,6 +368,7 @@ struct thread { #ifdef __amd64__ struct mdthread td_md; /* (k) Any machine-dependent fields. */ #endif + int td_pflags2; /* (k) Private thread (TDP2_*) flags. */ }; struct thread0_storage { @@ -1162,6 +1163,25 @@ curthread_pflags_restore(int save) { curthread->td_pflags &= save; +} + +static __inline int +curthread_pflags2_set(int flags) +{ + struct thread *td; + int save; + + td = curthread; + save = ~flags | (td->td_pflags2 & flags); + td->td_pflags2 |= flags; + return (save); +} + +static __inline void +curthread_pflags2_restore(int save) +{ + + curthread->td_pflags2 &= save; } static __inline __pure2 struct td_sched * From owner-svn-src-stable@freebsd.org Sat Feb 29 22:10:02 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0221A242681; Sat, 29 Feb 2020 22:10: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 48VLDn3ymmz4T5Z; Sat, 29 Feb 2020 22:10: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 56EC3216B6; Sat, 29 Feb 2020 22:10: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 01TMA1rK073735; Sat, 29 Feb 2020 22:10:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01TMA02o073732; Sat, 29 Feb 2020 22:10:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202002292210.01TMA02o073732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 29 Feb 2020 22:10: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: r358476 - in stable/12/sys: fs/nfsclient sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: fs/nfsclient sys X-SVN-Commit-Revision: 358476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Feb 2020 22:10:02 -0000 Author: kib Date: Sat Feb 29 22:10:00 2020 New Revision: 358476 URL: https://svnweb.freebsd.org/changeset/base/358476 Log: MFC r358252: Fix NFS client deadlock when read reports truncated node. Modified: stable/12/sys/fs/nfsclient/nfs_clbio.c stable/12/sys/fs/nfsclient/nfs_clport.c stable/12/sys/sys/proc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clbio.c Sat Feb 29 21:55:48 2020 (r358475) +++ stable/12/sys/fs/nfsclient/nfs_clbio.c Sat Feb 29 22:10:00 2020 (r358476) @@ -425,14 +425,11 @@ int ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) { struct nfsnode *np = VTONFS(vp); - int biosize, i; struct buf *bp, *rabp; struct thread *td; struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn, rabn; - int bcount; - int seqcount; - int nra, error = 0, n = 0, on = 0; + int biosize, bcount, error, i, n, nra, on, save2, seqcount; off_t tmp_off; KASSERT(uio->uio_rw == UIO_READ, ("ncl_read mode")); @@ -464,6 +461,8 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof /* No caching/ no readaheads. Just read data into the user buffer */ return ncl_readrpc(vp, uio, cred); + n = 0; + on = 0; biosize = vp->v_bufobj.bo_bsize; seqcount = (int)((off_t)(ioflag >> IO_SEQSHIFT) * biosize / BKVASIZE); @@ -471,6 +470,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof if (error) return error; + save2 = curthread_pflags2_set(TDP2_SBPAGES); do { u_quad_t nsize; @@ -495,7 +495,9 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof rabp = nfs_getcacheblk(vp, rabn, biosize, td); if (!rabp) { error = newnfs_sigintr(nmp, td); - return (error ? error : EINTR); + if (error == 0) + error = EINTR; + goto out; } if ((rabp->b_flags & (B_CACHE|B_DELWRI)) == 0) { rabp->b_flags |= B_ASYNC; @@ -526,7 +528,9 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof if (!bp) { error = newnfs_sigintr(nmp, td); - return (error ? error : EINTR); + if (error == 0) + error = EINTR; + goto out; } /* @@ -540,7 +544,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof error = ncl_doio(vp, bp, cred, td, 0); if (error) { brelse(bp); - return (error); + goto out; } } @@ -561,7 +565,9 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof bp = nfs_getcacheblk(vp, (daddr_t)0, NFS_MAXPATHLEN, td); if (!bp) { error = newnfs_sigintr(nmp, td); - return (error ? error : EINTR); + if (error == 0) + error = EINTR; + goto out; } if ((bp->b_flags & B_CACHE) == 0) { bp->b_iocmd = BIO_READ; @@ -570,7 +576,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof if (error) { bp->b_ioflags |= BIO_ERROR; brelse(bp); - return (error); + goto out; } } n = MIN(uio->uio_resid, NFS_MAXPATHLEN - bp->b_resid); @@ -580,14 +586,17 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof NFSINCRGLOBAL(nfsstatsv1.biocache_readdirs); if (np->n_direofoffset && uio->uio_offset >= np->n_direofoffset) { - return (0); + error = 0; + goto out; } lbn = (uoff_t)uio->uio_offset / NFS_DIRBLKSIZ; on = uio->uio_offset & (NFS_DIRBLKSIZ - 1); bp = nfs_getcacheblk(vp, lbn, NFS_DIRBLKSIZ, td); if (!bp) { - error = newnfs_sigintr(nmp, td); - return (error ? error : EINTR); + error = newnfs_sigintr(nmp, td); + if (error == 0) + error = EINTR; + goto out; } if ((bp->b_flags & B_CACHE) == 0) { bp->b_iocmd = BIO_READ; @@ -612,12 +621,16 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof */ for (i = 0; i <= lbn && !error; i++) { if (np->n_direofoffset - && (i * NFS_DIRBLKSIZ) >= np->n_direofoffset) - return (0); + && (i * NFS_DIRBLKSIZ) >= np->n_direofoffset) { + error = 0; + goto out; + } bp = nfs_getcacheblk(vp, i, NFS_DIRBLKSIZ, td); if (!bp) { error = newnfs_sigintr(nmp, td); - return (error ? error : EINTR); + if (error == 0) + error = EINTR; + goto out; } if ((bp->b_flags & B_CACHE) == 0) { bp->b_iocmd = BIO_READ; @@ -646,7 +659,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof * we give up. */ if (error) - return (error); + goto out; } /* @@ -706,6 +719,12 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof if (bp != NULL) brelse(bp); } while (error == 0 && uio->uio_resid > 0 && n > 0); +out: + curthread_pflags2_restore(save2); + if ((curthread->td_pflags2 & TDP2_SBPAGES) == 0) { + NFSLOCKNODE(np); + ncl_pager_setsize(vp, NULL); + } return (error); } Modified: stable/12/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clport.c Sat Feb 29 21:55:48 2020 (r358475) +++ stable/12/sys/fs/nfsclient/nfs_clport.c Sat Feb 29 22:10:00 2020 (r358476) @@ -597,7 +597,8 @@ ncl_pager_setsize(struct vnode *vp, u_quad_t *nsizep) setnsize = false; if (object != NULL && nsize != object->un_pager.vnp.vnp_size) { - if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE) + if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE && + (curthread->td_pflags2 & TDP2_SBPAGES) == 0) setnsize = true; else np->n_flag |= NVNSETSZSKIP; Modified: stable/12/sys/sys/proc.h ============================================================================== --- stable/12/sys/sys/proc.h Sat Feb 29 21:55:48 2020 (r358475) +++ stable/12/sys/sys/proc.h Sat Feb 29 22:10:00 2020 (r358476) @@ -497,6 +497,8 @@ do { \ #define TDP_FORKING 0x20000000 /* Thread is being created through fork() */ #define TDP_EXECVMSPC 0x40000000 /* Execve destroyed old vmspace */ +#define TDP2_SBPAGES 0x00000001 /* Owns sbusy on some pages */ + /* * Reasons that the current thread can not be run yet. * More than one may apply. From owner-svn-src-stable@freebsd.org Sat Feb 29 22:51:29 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F4292435CE; Sat, 29 Feb 2020 22:51:29 +0000 (UTC) (envelope-from carlavilla@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48VM8c6R7Zz45BS; Sat, 29 Feb 2020 22:51:28 +0000 (UTC) (envelope-from carlavilla@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 909CC21FC4; Sat, 29 Feb 2020 22:51:28 +0000 (UTC) (envelope-from carlavilla@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01TMpSIS098303; Sat, 29 Feb 2020 22:51:28 GMT (envelope-from carlavilla@FreeBSD.org) Received: (from carlavilla@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01TMpRXF098299; Sat, 29 Feb 2020 22:51:27 GMT (envelope-from carlavilla@FreeBSD.org) Message-Id: <202002292251.01TMpRXF098299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: carlavilla set sender to carlavilla@FreeBSD.org using -f From: Sergio Carlavilla Delgado Date: Sat, 29 Feb 2020 22:51:27 +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: r358479 - in stable/12: lib/msun/man share/man/man7 usr.sbin/ac usr.sbin/sa X-SVN-Group: stable-12 X-SVN-Commit-Author: carlavilla X-SVN-Commit-Paths: in stable/12: lib/msun/man share/man/man7 usr.sbin/ac usr.sbin/sa X-SVN-Commit-Revision: 358479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Feb 2020 22:51:29 -0000 Author: carlavilla (doc committer) Date: Sat Feb 29 22:51:27 2020 New Revision: 358479 URL: https://svnweb.freebsd.org/changeset/base/358479 Log: MFC r358099: Add some HISTORY sections to manpages environ(7) was in AT&T Version 7 ac(8): Add a HISTORY section sa(8): Add a HISTORY section sqrt(3): Add the actual sqrt function to the HISTORY section Obtained from: OpenBSD Submitted by: gbergling@gmail.com Approved by: bcr@(mentor) Differential Revision: https://reviews.freebsd.org/D23693 Modified: stable/12/lib/msun/man/sqrt.3 stable/12/share/man/man7/environ.7 stable/12/usr.sbin/ac/ac.8 stable/12/usr.sbin/sa/sa.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/msun/man/sqrt.3 ============================================================================== --- stable/12/lib/msun/man/sqrt.3 Sat Feb 29 22:31:23 2020 (r358478) +++ stable/12/lib/msun/man/sqrt.3 Sat Feb 29 22:51:27 2020 (r358479) @@ -28,7 +28,7 @@ .\" from: @(#)sqrt.3 6.4 (Berkeley) 5/6/91 .\" $FreeBSD$ .\" -.Dd March 5, 2011 +.Dd February 15, 2020 .Dt SQRT 3 .Os .Sh NAME @@ -113,6 +113,9 @@ The function appeared in .Bx 4.3 . The +.Fn sqrt +function appeared in +.At v2 . .Fn sqrtl function appeared in .Fx 8.0 . Modified: stable/12/share/man/man7/environ.7 ============================================================================== --- stable/12/share/man/man7/environ.7 Sat Feb 29 22:31:23 2020 (r358478) +++ stable/12/share/man/man7/environ.7 Sat Feb 29 22:51:27 2020 (r358479) @@ -28,7 +28,7 @@ .\" @(#)environ.7 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 12, 2003 +.Dd February 14, 2020 .Dt ENVIRON 7 .Os .Sh NAME @@ -261,4 +261,4 @@ built-in command in The .Nm manual page appeared in -.Bx 4.2 . +.At v7 . Modified: stable/12/usr.sbin/ac/ac.8 ============================================================================== --- stable/12/usr.sbin/ac/ac.8 Sat Feb 29 22:31:23 2020 (r358478) +++ stable/12/usr.sbin/ac/ac.8 Sat Feb 29 22:51:27 2020 (r358479) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2010 +.Dd February 14, 2020 .Dt AC 8 .Os .Sh NAME @@ -126,6 +126,16 @@ ac -p -t "!ttyd*" > other .Xr getutxent 3 , .Xr init 8 , .Xr sa 8 +.Sh HISTORY +An +.Nm +command appeared in +.At v5 . +This version of +.Nm +was written for +.Nx 0.9a +from the specification provided by various systems' manual pages. .\" .Sh NOTES .\" If COMPAT_SUNOS is defined .\" .Nm ac Modified: stable/12/usr.sbin/sa/sa.8 ============================================================================== --- stable/12/usr.sbin/sa/sa.8 Sat Feb 29 22:31:23 2020 (r358478) +++ stable/12/usr.sbin/sa/sa.8 Sat Feb 29 22:51:27 2020 (r358479) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2007 +.Dd February 14, 2020 .Dt SA 8 .Os .Sh NAME @@ -234,6 +234,14 @@ per-user accounting summary database .Xr acct 5 , .Xr ac 8 , .Xr accton 8 +.Sh HISTORY +.Nm +first appeared in +.At v5 . +.Nm +was rewritten for +.Nx 0.9a +from the specification provided by various systems' manual pages. .Sh AUTHORS .An Chris G. Demetriou Aq Mt cgd@postgres.berkeley.edu .Sh CAVEATS