From owner-svn-src-stable-10@freebsd.org Sun Dec 13 03:32:42 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76147A41C9A; Sun, 13 Dec 2015 03:32:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 436C014C6; Sun, 13 Dec 2015 03:32:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3WfWk071093; Sun, 13 Dec 2015 03:32:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3Wf6t071092; Sun, 13 Dec 2015 03:32:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130332.tBD3Wf6t071092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292136 - stable/10/sys/ofed/drivers/infiniband/hw/mthca X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 03:32:42 -0000 Author: ngie Date: Sun Dec 13 03:32:41 2015 New Revision: 292136 URL: https://svnweb.freebsd.org/changeset/base/292136 Log: MFC r291753: Fix scope of bridge_header and bridge_pcix_cap in mthca_reset(..) They're only used in the __linux__ case Differential Revision: https://reviews.freebsd.org/D4332 Reported by: cppcheck Reviewed by: hselasky Sponsored by: EMC / Isilon Storage Division Modified: stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Sat Dec 12 22:54:12 2015 (r292135) +++ stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c Sun Dec 13 03:32:41 2015 (r292136) @@ -43,9 +43,13 @@ int mthca_reset(struct mthca_dev *mdev) int i; int err = 0; u32 *hca_header = NULL; +#ifdef __linux__ u32 *bridge_header = NULL; +#endif struct pci_dev *bridge = NULL; +#ifdef __linux__ int bridge_pcix_cap = 0; +#endif int hca_pcie_cap = 0; int hca_pcix_cap = 0; @@ -195,6 +199,7 @@ int mthca_reset(struct mthca_dev *mdev) } good: +#ifdef __linux__ /* Now restore the PCI headers */ if (bridge) { if (pci_write_config_dword(bridge, bridge_pcix_cap + 0x8, @@ -235,6 +240,7 @@ good: goto out; } } +#endif if (hca_pcix_cap) { if (pci_write_config_dword(mdev->pdev, hca_pcix_cap, @@ -289,8 +295,8 @@ out: #ifdef __linux__ if (bridge) pci_dev_put(bridge); -#endif kfree(bridge_header); +#endif kfree(hca_header); return err; From owner-svn-src-stable-10@freebsd.org Sun Dec 13 03:37:31 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3083FA14078; Sun, 13 Dec 2015 03:37:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1F9D18E4; Sun, 13 Dec 2015 03:37:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3bURQ071389; Sun, 13 Dec 2015 03:37:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3bUL8071388; Sun, 13 Dec 2015 03:37:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130337.tBD3bUL8071388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292138 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 03:37:31 -0000 Author: ngie Date: Sun Dec 13 03:37:29 2015 New Revision: 292138 URL: https://svnweb.freebsd.org/changeset/base/292138 Log: MFC r291979: Unbreak compiling getnetgrent.c with -DDEBUG after r236402 by adding a missing "}" Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/gen/getnetgrent.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getnetgrent.c ============================================================================== --- stable/10/lib/libc/gen/getnetgrent.c Sun Dec 13 03:35:54 2015 (r292137) +++ stable/10/lib/libc/gen/getnetgrent.c Sun Dec 13 03:37:29 2015 (r292138) @@ -512,6 +512,7 @@ parse_netgrp(const char *group) ng[NG_DOM] == NULL ? "" : ",", ng[NG_DOM] == NULL ? "" : ng[NG_DOM], lp->l_groupname); + } #endif } else { spos = strsep(&pos, ", \t"); From owner-svn-src-stable-10@freebsd.org Sun Dec 13 03:40:45 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 465FEA14394; Sun, 13 Dec 2015 03:40:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 108321C3F; Sun, 13 Dec 2015 03:40:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3eiQD071633; Sun, 13 Dec 2015 03:40:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3eiET071631; Sun, 13 Dec 2015 03:40:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130340.tBD3eiET071631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:40:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292140 - stable/10/lib/libc/stdio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 03:40:45 -0000 Author: ngie Date: Sun Dec 13 03:40:43 2015 New Revision: 292140 URL: https://svnweb.freebsd.org/changeset/base/292140 Log: MFC r292004: Fix compilation when -DDEBUG is defined by adding inttypes.h #include for intmax_t Differential Revision: https://reviews.freebsd.org/D4434 Reported by: cppcheck Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/stdio/open_memstream.c stable/10/lib/libc/stdio/open_wmemstream.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdio/open_memstream.c ============================================================================== --- stable/10/lib/libc/stdio/open_memstream.c Sun Dec 13 03:38:19 2015 (r292139) +++ stable/10/lib/libc/stdio/open_memstream.c Sun Dec 13 03:40:43 2015 (r292140) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#ifdef DEBUG +#include +#endif #include #include #include Modified: stable/10/lib/libc/stdio/open_wmemstream.c ============================================================================== --- stable/10/lib/libc/stdio/open_wmemstream.c Sun Dec 13 03:38:19 2015 (r292139) +++ stable/10/lib/libc/stdio/open_wmemstream.c Sun Dec 13 03:40:43 2015 (r292140) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#ifdef DEBUG +#include +#endif #include #include #include From owner-svn-src-stable-10@freebsd.org Sun Dec 13 03:45:59 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BA7EA1488E; Sun, 13 Dec 2015 03:45:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6ECA112F; Sun, 13 Dec 2015 03:45:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3jwgb074380; Sun, 13 Dec 2015 03:45:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3jvwj074378; Sun, 13 Dec 2015 03:45:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130345.tBD3jvwj074378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292142 - in stable/10/tools/regression/tls: ttls2 ttls4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 03:45:59 -0000 Author: ngie Date: Sun Dec 13 03:45:57 2015 New Revision: 292142 URL: https://svnweb.freebsd.org/changeset/base/292142 Log: MFC r291983,r291984: r291983: Fix compilation warnings by adding unistd.h #include and missing return statements Sponsored by: EMC / Isilon Storage Division r291984: Add missing stdlib.h header Apply some minor style(9) fixes Sponsored by: EMC / Isilon Storage Division Modified: stable/10/tools/regression/tls/ttls2/ttls2.c stable/10/tools/regression/tls/ttls4/ttls4.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/tls/ttls2/ttls2.c ============================================================================== --- stable/10/tools/regression/tls/ttls2/ttls2.c Sun Dec 13 03:41:50 2015 (r292141) +++ stable/10/tools/regression/tls/ttls2/ttls2.c Sun Dec 13 03:45:57 2015 (r292142) @@ -1,7 +1,8 @@ /* $FreeBSD$ */ -#include #include +#include +#include int __thread i; @@ -13,6 +14,7 @@ foo1(void *arg) printf("thread %p, i = %d\n", pthread_self(), i); sleep(1); } + return (NULL); } void * @@ -23,9 +25,11 @@ foo2(void *arg) printf("thread %p, i = %d\n", pthread_self(), i); sleep(1); } + return (NULL); } -int main(int argc, char** argv) +int +main(int argc, char** argv) { pthread_t t1, t2; @@ -33,4 +37,6 @@ int main(int argc, char** argv) pthread_create(&t2, 0, foo2, 0); pthread_join(t1, 0); pthread_join(t2, 0); + + return (0); } Modified: stable/10/tools/regression/tls/ttls4/ttls4.c ============================================================================== --- stable/10/tools/regression/tls/ttls4/ttls4.c Sun Dec 13 03:41:50 2015 (r292141) +++ stable/10/tools/regression/tls/ttls4/ttls4.c Sun Dec 13 03:45:57 2015 (r292142) @@ -9,11 +9,13 @@ #include #include +#include #include int __thread n; -void *f1(void *arg) +void +*f1(void *arg) { if (n != 0) { printf("bug, n == %d \n", n); @@ -23,7 +25,8 @@ void *f1(void *arg) return (0); } -int main() +int +main(void) { pthread_t td; int i; From owner-svn-src-stable-10@freebsd.org Sun Dec 13 03:51:50 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D81A14DB4; Sun, 13 Dec 2015 03:51:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A162A1840; Sun, 13 Dec 2015 03:51:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD3pnpx077190; Sun, 13 Dec 2015 03:51:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD3pnbL077187; Sun, 13 Dec 2015 03:51:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130351.tBD3pnbL077187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 03:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292144 - stable/10/lib/libc/regex/grot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 03:51:51 -0000 Author: ngie Date: Sun Dec 13 03:51:49 2015 New Revision: 292144 URL: https://svnweb.freebsd.org/changeset/base/292144 Log: MFC r291832,r291833,r291834,r291835,r291836,r291838: r291832: Fix -Wformat warnings by using the correct format qualifiers Sponsored by: EMC / Isilon Storage Division r291833: - Use ANSI C function prototypes/definitions instead of K&R style ones - Add a missing return type for main(..) Sponsored by: EMC / Isilon Storage Division r291834: Add missing headers and sort #includes per style(9) Sponsored by: EMC / Isilon Storage Division r291835: Use ANSI C function prototypes/definitions instead of K&R style ones Sponsored by: EMC / Isilon Storage Division r291836: Use `==` instead of `=` in the function comment above split(..) so mkh -p exposes split(..). Sponsored by: EMC / Isilon Storage Division r291838: Fix -Wformat issues and minor whitespace issues in surrounding areas Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/regex/grot/debug.c stable/10/lib/libc/regex/grot/main.c stable/10/lib/libc/regex/grot/split.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/regex/grot/debug.c ============================================================================== --- stable/10/lib/libc/regex/grot/debug.c Sun Dec 13 03:47:56 2015 (r292143) +++ stable/10/lib/libc/regex/grot/debug.c Sun Dec 13 03:51:49 2015 (r292144) @@ -186,7 +186,7 @@ FILE *d; fprintf(d, ">"); break; default: - fprintf(d, "!%d(%d)!", OP(*s), opnd); + fprintf(d, "!%ld(%ld)!", OP(*s), (long)opnd); break; } if (!done) Modified: stable/10/lib/libc/regex/grot/main.c ============================================================================== --- stable/10/lib/libc/regex/grot/main.c Sun Dec 13 03:47:56 2015 (r292143) +++ stable/10/lib/libc/regex/grot/main.c Sun Dec 13 03:51:49 2015 (r292144) @@ -1,11 +1,13 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include -#include #include +#include +#include +#include +#include +#include #include "main.ih" @@ -26,9 +28,8 @@ extern void regprint(); /* - main - do the simple case, hand off to regress() for regression */ -main(argc, argv) -int argc; -char *argv[]; +int +main(int argc, char **argv) { regex_t re; # define NS 10 @@ -80,43 +81,43 @@ char *argv[]; err = regcomp(&re, argv[optind++], copts); if (err) { len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); + fprintf(stderr, "error %s, %zu/%zu `%s'\n", + eprint(err), len, sizeof(erbuf), erbuf); exit(status); } - regprint(&re, stdout); + regprint(&re, stdout); if (optind >= argc) { regfree(&re); exit(status); } - if (eopts®_STARTEND) { + if ((eopts & REG_STARTEND) != 0) { subs[0].rm_so = startoff; subs[0].rm_eo = strlen(argv[optind]) - endoff; } err = regexec(&re, argv[optind], (size_t)NS, subs, eopts); if (err) { len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "error %s, %d/%d `%s'\n", - eprint(err), len, sizeof(erbuf), erbuf); + fprintf(stderr, "error %s, %zu/%zu `%s'\n", + eprint(err), len, sizeof(erbuf), erbuf); exit(status); } - if (!(copts®_NOSUB)) { + if ((copts & REG_NOSUB) == 0) { len = (int)(subs[0].rm_eo - subs[0].rm_so); if (subs[0].rm_so != -1) { if (len != 0) - printf("match `%.*s'\n", len, - argv[optind] + subs[0].rm_so); + printf("match `%.*s'\n", (int)len, + argv[optind] + subs[0].rm_so); else printf("match `'@%.1s\n", - argv[optind] + subs[0].rm_so); + argv[optind] + subs[0].rm_so); } for (i = 1; i < NS; i++) if (subs[i].rm_so != -1) printf("(%d) `%.*s'\n", i, - (int)(subs[i].rm_eo - subs[i].rm_so), - argv[optind] + subs[i].rm_so); + (int)(subs[i].rm_eo - subs[i].rm_so), + argv[optind] + subs[i].rm_so); } exit(status); } @@ -126,8 +127,7 @@ char *argv[]; == void regress(FILE *in); */ void -regress(in) -FILE *in; +regress(FILE *in) { char inbuf[1000]; # define MAXF 10 @@ -174,13 +174,13 @@ FILE *in; } ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT); if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' || - ne != strlen(badpat)+1) { + ne != strlen(badpat)+1) { fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n", erbuf, SHORT-1, badpat); status = 1; } ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf)); - if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) { + if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname) + 1) { fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n", erbuf, bpname); status = 1; @@ -191,7 +191,7 @@ FILE *in; fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n", erbuf, (long)REG_BADPAT); status = 1; - } else if (ne != strlen(erbuf)+1) { + } else if (ne != strlen(erbuf) + 1) { fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n", erbuf, (long)REG_BADPAT); status = 1; @@ -201,28 +201,21 @@ FILE *in; /* - try - try it, and report on problems == void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts); + - opts: may not match f1 */ void -try(f0, f1, f2, f3, f4, opts) -char *f0; -char *f1; -char *f2; -char *f3; -char *f4; -int opts; /* may not match f1 */ +try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts) { regex_t re; # define NSUBS 10 regmatch_t subs[NSUBS]; # define NSHOULD 15 char *should[NSHOULD]; - int nshould; char erbuf[100]; - int err; - int len; - char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; - int i; + size_t len; + int err, i, nshould; char *grump; + char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; char f0copy[1000]; char f2copy[1000]; @@ -233,9 +226,8 @@ int opts; /* may not match f1 */ if (err != 0 && (!opt('C', f1) || err != efind(f2))) { /* unexpected error or wrong error */ len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); + fprintf(stderr, "%d: %s error %s, %zu/%zu `%s'\n", + line, type, eprint(err), len, sizeof(erbuf), erbuf); status = 1; } else if (err == 0 && opt('C', f1)) { /* unexpected success */ @@ -264,16 +256,15 @@ int opts; /* may not match f1 */ if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) { /* unexpected error or wrong error */ len = regerror(err, &re, erbuf, sizeof(erbuf)); - fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n", - line, type, eprint(err), len, - sizeof(erbuf), erbuf); + fprintf(stderr, "%d: %s exec error %s, %zu/%zu `%s'\n", + line, type, eprint(err), len, sizeof(erbuf), erbuf); status = 1; } else if (err != 0) { /* nothing more to check */ } else if (f3 == NULL) { /* unexpected success */ fprintf(stderr, "%d: %s exec should have failed\n", - line, type); + line, type); status = 1; err = 1; /* just on principle */ } else if (opts®_NOSUB) { @@ -300,7 +291,7 @@ int opts; /* may not match f1 */ grump = check(f2, subs[i], should[i]); if (grump != NULL) { fprintf(stderr, "%d: %s $%d %s\n", line, - type, i, grump); + type, i, grump); status = 1; err = 1; } @@ -311,12 +302,11 @@ int opts; /* may not match f1 */ /* - options - pick options out of a regression-test string + - type: 'c' - compile, 'e' - exec == int options(int type, char *s); */ int -options(type, s) -int type; /* 'c' compile, 'e' exec */ -char *s; +options(int type, char *s) { char *p; int o = (type == 'c') ? copts : eopts; @@ -371,9 +361,7 @@ char *s; == int opt(int c, char *s); */ int /* predicate */ -opt(c, s) -int c; -char *s; +opt(int c, char *s) { return(strchr(s, c) != NULL); } @@ -383,8 +371,7 @@ char *s; == void fixstr(char *p); */ void -fixstr(p) -char *p; +fixstr(char *p) { if (p == NULL) return; @@ -405,10 +392,7 @@ char *p; == char *check(char *str, regmatch_t sub, char *should); */ char * /* NULL or complaint */ -check(str, sub, should) -char *str; -regmatch_t sub; -char *should; +check(char *str, regmatch_t sub, char *should) { int len; int shlen; @@ -442,7 +426,7 @@ char *should; /* check for in range */ if (sub.rm_eo > strlen(str)) { sprintf(grump, "start %ld end %ld, past end of string", - (long)sub.rm_so, (long)sub.rm_eo); + (long)sub.rm_so, (long)sub.rm_eo); return(grump); } @@ -482,8 +466,7 @@ char *should; == static char *eprint(int err); */ static char * -eprint(err) -int err; +eprint(int err) { static char epbuf[100]; size_t len; @@ -498,8 +481,7 @@ int err; == static int efind(char *name); */ static int -efind(name) -char *name; +efind(char *name) { static char efbuf[100]; size_t n; Modified: stable/10/lib/libc/regex/grot/split.c ============================================================================== --- stable/10/lib/libc/regex/grot/split.c Sun Dec 13 03:47:56 2015 (r292143) +++ stable/10/lib/libc/regex/grot/split.c Sun Dec 13 03:51:49 2015 (r292144) @@ -6,14 +6,13 @@ __FBSDID("$FreeBSD$"); /* - split - divide a string into fields, like awk split() - = int split(char *string, char *fields[], int nfields, char *sep); + == int split(char *string, char *fields[], int nfields, char *sep); + - fields: list is not NULL-terminated + - nfields: number of entries available in fields[] + - sep: "" white, "c" single char, "ab" [ab]+ */ int /* number of fields, including overflow */ -split(string, fields, nfields, sep) -char *string; -char *fields[]; /* list is not NULL-terminated */ -int nfields; /* number of entries available in fields[] */ -char *sep; /* "" white, "c" single char, "ab" [ab]+ */ +split(char *string, char *fields[], int nfields, char *sep) { char *p = string; char c; /* latest character */ @@ -151,9 +150,7 @@ char *sep; /* "" white, "c" single cha * pgm str sep n splits str by sep n times */ int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { char buf[512]; int n; @@ -182,9 +179,8 @@ char *argv[]; exit(0); } -dosplit(string, seps) -char *string; -char *seps; +void +dosplit(char *string, char *seps) { # define NF 5 char *fields[NF]; @@ -194,10 +190,8 @@ char *seps; print(nf, NF, fields); } -print(nf, nfp, fields) -int nf; -int nfp; -char *fields[]; +void +print(int nf, int nfp, char *fields[]) { int fn; int bound; @@ -277,7 +271,8 @@ struct { NULL, NULL, 0, { NULL }, }; -regress() +void +regress(void) { char buf[512]; int n; From owner-svn-src-stable-10@freebsd.org Sun Dec 13 04:20:48 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 938F0A4254C; Sun, 13 Dec 2015 04:20:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D7FB198B; Sun, 13 Dec 2015 04:20:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD4Kl4o084107; Sun, 13 Dec 2015 04:20:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD4KlUW084106; Sun, 13 Dec 2015 04:20:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130420.tBD4KlUW084106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 04:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292148 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 04:20:48 -0000 Author: ngie Date: Sun Dec 13 04:20:47 2015 New Revision: 292148 URL: https://svnweb.freebsd.org/changeset/base/292148 Log: MFC r291896: Remove unused atf.test.mk variables - ATF_BUILD_CC - ATF_BUILD_CPP - ATF_BUILD_CXX - ATF_SHELL - ATF_PREFIX Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/mk/atf.test.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/atf.test.mk ============================================================================== --- stable/10/share/mk/atf.test.mk Sun Dec 13 04:15:13 2015 (r292147) +++ stable/10/share/mk/atf.test.mk Sun Dec 13 04:20:47 2015 (r292148) @@ -22,29 +22,6 @@ ATF_TESTS_C?= ATF_TESTS_CXX?= ATF_TESTS_SH?= -# Path to the prefix of the installed ATF tools, if any. -# -# If atf-run and atf-report are installed from ports, we automatically define a -# realregress target below to run the tests using these tools. The tools are -# searched for in the hierarchy specified by this variable. -ATF_PREFIX?= /usr/local - -# C compiler passed to ATF tests that need to build code. -ATF_BUILD_CC?= ${DESTDIR}/usr/bin/cc -TESTS_ENV+= ATF_BUILD_CC=${ATF_BUILD_CC} - -# C preprocessor passed to ATF tests that need to build code. -ATF_BUILD_CPP?= ${DESTDIR}/usr/bin/cpp -TESTS_ENV+= ATF_BUILD_CPP=${ATF_BUILD_CPP} - -# C++ compiler passed to ATF tests that need to build code. -ATF_BUILD_CXX?= ${DESTDIR}/usr/bin/c++ -TESTS_ENV+= ATF_BUILD_CXX=${ATF_BUILD_CXX} - -# Shell interpreter used to run atf-sh(1) based tests. -ATF_SHELL?= ${DESTDIR}/bin/sh -TESTS_ENV+= ATF_SHELL=${ATF_SHELL} - .if !empty(ATF_TESTS_C) PROGS+= ${ATF_TESTS_C} _TESTS+= ${ATF_TESTS_C} From owner-svn-src-stable-10@freebsd.org Sun Dec 13 04:22:52 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DC3CA42782; Sun, 13 Dec 2015 04:22:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7AC11CEF; Sun, 13 Dec 2015 04:22:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD4MprU086596; Sun, 13 Dec 2015 04:22:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD4MpSm086595; Sun, 13 Dec 2015 04:22:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130422.tBD4MpSm086595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 04:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292149 - stable/10/share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 04:22:52 -0000 Author: ngie Date: Sun Dec 13 04:22:50 2015 New Revision: 292149 URL: https://svnweb.freebsd.org/changeset/base/292149 Log: MFC r291891: Use .Fx instead of explicitly spelling out FreeBSD Fix several warnings reported by igor Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/man/man7/tests.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/tests.7 ============================================================================== --- stable/10/share/man/man7/tests.7 Sun Dec 13 04:20:47 2015 (r292148) +++ stable/10/share/man/man7/tests.7 Sun Dec 13 04:22:50 2015 (r292149) @@ -26,20 +26,22 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 13, 2014 +.Dd December 5, 2015 .Dt TESTS 7 .Os .Sh NAME .Nm tests -.Nd introduction to the FreeBSD Test Suite +.Nd introduction to the +.Fx +Test Suite .Sh DESCRIPTION The .Fx Test Suite provides a collection of automated tests for two major purposes. On one hand, the test suite aids .Em developers -to detect bugs and regressions when they modify the source tree. On the other -hand, it allows +to detect bugs and regressions when they modify the source tree. +On the other hand, it allows .Em end users (and, in particular, system administrators) to verify that fresh installations of the @@ -164,23 +166,26 @@ Test Suite: .Bl -tag -width "allow_sysctl_side_effects" .It allow_devfs_side_effects If defined, enables tests that may destroy and recreate semipermanent device -nodes, like disk devices. Without this variable, tests may still create and -destroy devices nodes that are normally transient, like /dev/tap* and -/dev/pts*, as long as they clean them up afterwards. However, tests that -require this variable have a relaxed cleanup requirement; they must recreate -any devices that they destroyed, but not necessarily with the same devnames. +nodes, like disk devices. +Without this variable, tests may still create and destroy devices nodes that +are normally transient, like /dev/tap* and /dev/pts*, as long as they clean +them up afterwards. +However, tests that require this variable have a relaxed cleanup requirement; +they must recreate any devices that they destroyed, but not necessarily with +the same devnames. .It allow_sysctl_side_effects Enables tests that change globally significant .Xr sysctl 8 -variables. The tests will undo any changes in their cleanup phases. +variables. +The tests will undo any changes in their cleanup phases. .It disks -Must be set to a space delimited list of disk device nodes. Tests that need -destructive access to disks must use these devices. Tests are not required to -preserve any data present on these disks. +Must be set to a space delimited list of disk device nodes. +Tests that need destructive access to disks must use these devices. +Tests are not required to preserve any data present on these disks. .It fibs -Must be set to a space delimited list of FIBs (routing tables). Tests that -need to modify a routing table may use any of these. Tests will cleanup any -new routes that they create. +Must be set to a space delimited list of FIBs (routing tables). +Tests that need to modify a routing table may use any of these. +Tests will cleanup any new routes that they create. .El .Ss What to do if something fails? If there is From owner-svn-src-stable-10@freebsd.org Sun Dec 13 04:24:16 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0CFFA4285E; Sun, 13 Dec 2015 04:24:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A055C1E53; Sun, 13 Dec 2015 04:24:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD4OFDo086802; Sun, 13 Dec 2015 04:24:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD4OFJ6086799; Sun, 13 Dec 2015 04:24:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130424.tBD4OFJ6086799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 04:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292150 - stable/10/lib/libc/stdio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 04:24:16 -0000 Author: ngie Date: Sun Dec 13 04:24:15 2015 New Revision: 292150 URL: https://svnweb.freebsd.org/changeset/base/292150 Log: MFC r292013: Use stdint.h instead of inttypes.h as the latter pollutes namespace more Submitted by: bde Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/stdio/open_memstream.c stable/10/lib/libc/stdio/open_wmemstream.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdio/open_memstream.c ============================================================================== --- stable/10/lib/libc/stdio/open_memstream.c Sun Dec 13 04:22:50 2015 (r292149) +++ stable/10/lib/libc/stdio/open_memstream.c Sun Dec 13 04:24:15 2015 (r292150) @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #ifdef DEBUG -#include +#include #endif -#include #include #include #include Modified: stable/10/lib/libc/stdio/open_wmemstream.c ============================================================================== --- stable/10/lib/libc/stdio/open_wmemstream.c Sun Dec 13 04:22:50 2015 (r292149) +++ stable/10/lib/libc/stdio/open_wmemstream.c Sun Dec 13 04:24:15 2015 (r292150) @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #ifdef DEBUG -#include +#include #endif -#include #include #include #include From owner-svn-src-stable-10@freebsd.org Sun Dec 13 04:29:10 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCF51A42BCE; Sun, 13 Dec 2015 04:29:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7534A117B; Sun, 13 Dec 2015 04:29:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBD4T9g5087295; Sun, 13 Dec 2015 04:29:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBD4T9nI087292; Sun, 13 Dec 2015 04:29:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512130429.tBD4T9nI087292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 04:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292152 - stable/10/lib/libc/tests/stdio X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 04:29:10 -0000 Author: ngie Date: Sun Dec 13 04:29:09 2015 New Revision: 292152 URL: https://svnweb.freebsd.org/changeset/base/292152 Log: MFC r291980,r291981: r291980: Add missing va_ends for corresponding va_starts to clean up variable arguments initialized in _test_fmt(..) Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division r291981: Delete bogus freeing of uninitialized data Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/tests/stdio/getdelim_test.c stable/10/lib/libc/tests/stdio/printbasic_test.c stable/10/lib/libc/tests/stdio/printfloat_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/stdio/getdelim_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/getdelim_test.c Sun Dec 13 04:24:59 2015 (r292151) +++ stable/10/lib/libc/tests/stdio/getdelim_test.c Sun Dec 13 04:29:09 2015 (r292152) @@ -208,7 +208,6 @@ ATF_TC_BODY(empty_NULL_buffer, tc) /* Make sure NULL *linep and zero *linecapp are handled. */ fp = mkfilebuf(); - free(line); line = NULL; linecap = 42; ATF_REQUIRE(getline(&line, &linecap, fp) == sizeof(apothegm) - 1); Modified: stable/10/lib/libc/tests/stdio/printbasic_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/printbasic_test.c Sun Dec 13 04:24:59 2015 (r292151) +++ stable/10/lib/libc/tests/stdio/printbasic_test.c Sun Dec 13 04:29:09 2015 (r292152) @@ -94,6 +94,8 @@ _testfmt(const char *result, const char "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]\n", wfmt, argstr, ws, wresult); } + va_end(ap); + va_end(ap2); } ATF_TC_WITHOUT_HEAD(int_within_limits); Modified: stable/10/lib/libc/tests/stdio/printfloat_test.c ============================================================================== --- stable/10/lib/libc/tests/stdio/printfloat_test.c Sun Dec 13 04:24:59 2015 (r292151) +++ stable/10/lib/libc/tests/stdio/printfloat_test.c Sun Dec 13 04:29:09 2015 (r292152) @@ -86,6 +86,8 @@ _testfmt(const char *result, const char "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]\n", wfmt, argstr, ws, wresult); } + va_end(ap); + va_end(ap2); } ATF_TC_WITHOUT_HEAD(float_within_limits); From owner-svn-src-stable-10@freebsd.org Sun Dec 13 21:09:48 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4110AA42EDA; Sun, 13 Dec 2015 21:09:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C5BA1E65; Sun, 13 Dec 2015 21:09:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDL9lS5081368; Sun, 13 Dec 2015 21:09:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDL9lrN081365; Sun, 13 Dec 2015 21:09:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512132109.tBDL9lrN081365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 21:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292168 - stable/10/lib/libc/regex/grot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 21:09:48 -0000 Author: ngie Date: Sun Dec 13 21:09:46 2015 New Revision: 292168 URL: https://svnweb.freebsd.org/changeset/base/292168 Log: MFC r276737,r289369,r289376,r289424,r291219,r291382,r291385,r291908: r276737 (by imp): Remove old ioctl use and support, once and for all. r289369 (by emaste): newfs_msdos: rework option parsing to match NetBSD NetBSD split newfs_msdos in two so that they can reuse the file system creation part in makefs. This change is a step on the path of bringing that support to FreeBSD. Reviewed by: kib, pfg Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3905 r289376 (by emaste): newfs_msdos: move mkfs_msdos to separate file for later use in makefs Sponsored by: The FreeBSD Foundation r289424 (by emaste): newfs_msdos: prefer snprintf to sprintf Obtained from: NetBSD Sponsored by: The FreeBSD Foundation r291219 (by emaste): newfs_msdos: rework error handling for eventual use in makefs Return -1 on errors from mkfs_msdos() instead of err()/errx(), to allow different consumers to handle errors as appropriate. Obtained from: NetBSD Sponsored by: The FreeBSD Foundation r291382 (by emaste): mkfs_msdos: sync with NetBSD Add a sanity test and clean up whitespace. Obtained from: NetBSD r291385 (by emaste): Use netbsd usage() implementation in newfs_msdos In r289629 newfs_msdos option descriptions are available in mkfs_msdos.h. Obtained from: NetBSD r291908: Fix leak in mkfs_msdos(..) by initializing img to NULL and free'ing at the end of the function Differential Revision: https://reviews.freebsd.org/D4405 PR: 204943 Reviewed by: emaste, jilles Reported by: David Binderman Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/regex/grot/Makefile stable/10/lib/libc/regex/grot/main.c stable/10/lib/libc/regex/grot/split.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/regex/grot/Makefile ============================================================================== --- stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:00:21 2015 (r292167) +++ stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:09:46 2015 (r292168) @@ -62,7 +62,8 @@ regexec.o: engine.c engine.ih regerror.o: regerror.ih regerror.o: utils.h debug.o: debug.ih -main.o: main.ih +main.o: debug.ih main.ih split.ih +split.o: split.ih r: re tests ./re #include +#include "debug.ih" #include "main.ih" +#include "split.ih" char *progname; int debug = 0; @@ -22,9 +24,6 @@ regoff_t startoff = 0; regoff_t endoff = 0; -extern int split(); -extern void regprint(); - /* - main - do the simple case, hand off to regress() for regression */ Modified: stable/10/lib/libc/regex/grot/split.c ============================================================================== --- stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:00:21 2015 (r292167) +++ stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:09:46 2015 (r292168) @@ -4,6 +4,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "split.ih" + /* - split - divide a string into fields, like awk split() == int split(char *string, char *fields[], int nfields, char *sep); From owner-svn-src-stable-10@freebsd.org Sun Dec 13 21:14:06 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49580A431F2; Sun, 13 Dec 2015 21:14:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 027451255; Sun, 13 Dec 2015 21:14:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDLE55b084209; Sun, 13 Dec 2015 21:14:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDLE4WX084206; Sun, 13 Dec 2015 21:14:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512132114.tBDLE4WX084206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 21:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292169 - stable/10/lib/libc/regex/grot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 21:14:06 -0000 Author: ngie Date: Sun Dec 13 21:14:04 2015 New Revision: 292169 URL: https://svnweb.freebsd.org/changeset/base/292169 Log: Revert r292168 -- I used the wrong commit message by accident Modified: stable/10/lib/libc/regex/grot/Makefile stable/10/lib/libc/regex/grot/main.c stable/10/lib/libc/regex/grot/split.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/regex/grot/Makefile ============================================================================== --- stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:09:46 2015 (r292168) +++ stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:14:04 2015 (r292169) @@ -62,8 +62,7 @@ regexec.o: engine.c engine.ih regerror.o: regerror.ih regerror.o: utils.h debug.o: debug.ih -main.o: debug.ih main.ih split.ih -split.o: split.ih +main.o: main.ih r: re tests ./re #include -#include "debug.ih" #include "main.ih" -#include "split.ih" char *progname; int debug = 0; @@ -24,6 +22,9 @@ regoff_t startoff = 0; regoff_t endoff = 0; +extern int split(); +extern void regprint(); + /* - main - do the simple case, hand off to regress() for regression */ Modified: stable/10/lib/libc/regex/grot/split.c ============================================================================== --- stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:09:46 2015 (r292168) +++ stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:14:04 2015 (r292169) @@ -4,8 +4,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "split.ih" - /* - split - divide a string into fields, like awk split() == int split(char *string, char *fields[], int nfields, char *sep); From owner-svn-src-stable-10@freebsd.org Sun Dec 13 21:15:05 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53613A432F4; Sun, 13 Dec 2015 21:15:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06CA013BE; Sun, 13 Dec 2015 21:15:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBDLF46e084314; Sun, 13 Dec 2015 21:15:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBDLF3Xb084311; Sun, 13 Dec 2015 21:15:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512132115.tBDLF3Xb084311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 13 Dec 2015 21:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292170 - stable/10/lib/libc/regex/grot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2015 21:15:05 -0000 Author: ngie Date: Sun Dec 13 21:15:03 2015 New Revision: 292170 URL: https://svnweb.freebsd.org/changeset/base/292170 Log: MFC r291837: split.ih: - Create automatically generated include header for split.c main.c: - Use function definitions from debug.ih and split.ih instead of externs Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/regex/grot/Makefile stable/10/lib/libc/regex/grot/main.c stable/10/lib/libc/regex/grot/split.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/regex/grot/Makefile ============================================================================== --- stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:14:04 2015 (r292169) +++ stable/10/lib/libc/regex/grot/Makefile Sun Dec 13 21:15:03 2015 (r292170) @@ -62,7 +62,8 @@ regexec.o: engine.c engine.ih regerror.o: regerror.ih regerror.o: utils.h debug.o: debug.ih -main.o: main.ih +main.o: debug.ih main.ih split.ih +split.o: split.ih r: re tests ./re #include +#include "debug.ih" #include "main.ih" +#include "split.ih" char *progname; int debug = 0; @@ -22,9 +24,6 @@ regoff_t startoff = 0; regoff_t endoff = 0; -extern int split(); -extern void regprint(); - /* - main - do the simple case, hand off to regress() for regression */ Modified: stable/10/lib/libc/regex/grot/split.c ============================================================================== --- stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:14:04 2015 (r292169) +++ stable/10/lib/libc/regex/grot/split.c Sun Dec 13 21:15:03 2015 (r292170) @@ -4,6 +4,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "split.ih" + /* - split - divide a string into fields, like awk split() == int split(char *string, char *fields[], int nfields, char *sep); From owner-svn-src-stable-10@freebsd.org Mon Dec 14 07:54:46 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56E1CA43ED4; Mon, 14 Dec 2015 07:54:46 +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 mx1.freebsd.org (Postfix) with ESMTPS id 274A71645; Mon, 14 Dec 2015 07:54:46 +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 tBE7sjsH075294; Mon, 14 Dec 2015 07:54:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE7sjMn075293; Mon, 14 Dec 2015 07:54:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512140754.tBE7sjMn075293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 14 Dec 2015 07:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292182 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 07:54:46 -0000 Author: kib Date: Mon Dec 14 07:54:45 2015 New Revision: 292182 URL: https://svnweb.freebsd.org/changeset/base/292182 Log: MFC r291948: Use ANSI C definition. Modified: stable/10/sys/amd64/amd64/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Mon Dec 14 07:08:17 2015 (r292181) +++ stable/10/sys/amd64/amd64/machdep.c Mon Dec 14 07:54:45 2015 (r292182) @@ -1158,12 +1158,7 @@ struct soft_segment_descriptor gdt_segs[ }; void -setidt(idx, func, typ, dpl, ist) - int idx; - inthand_t *func; - int typ; - int dpl; - int ist; +setidt(int idx, inthand_t *func, int typ, int dpl, int ist) { struct gate_descriptor *ip; From owner-svn-src-stable-10@freebsd.org Mon Dec 14 09:24:42 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A788A424D8; Mon, 14 Dec 2015 09:24:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 352351742; Mon, 14 Dec 2015 09:24:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9Ofar010772; Mon, 14 Dec 2015 09:24:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9Of5J010769; Mon, 14 Dec 2015 09:24:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140924.tBE9Of5J010769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292183 - in stable/10/sys/dev/usb: . wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 09:24:42 -0000 Author: hselasky Date: Mon Dec 14 09:24:40 2015 New Revision: 292183 URL: https://svnweb.freebsd.org/changeset/base/292183 Log: MFC r263985, r275646 and r289028: Add more USB IDs. PR: usb/188046 Modified: stable/10/sys/dev/usb/usbdevs stable/10/sys/dev/usb/wlan/if_run.c stable/10/sys/dev/usb/wlan/if_upgt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Mon Dec 14 07:54:45 2015 (r292182) +++ stable/10/sys/dev/usb/usbdevs Mon Dec 14 09:24:40 2015 (r292183) @@ -525,7 +525,7 @@ vendor DMI 0x0c0b DMI vendor CANYON 0x0c10 Canyon vendor ICOM 0x0c26 Icom Inc. vendor GNOTOMETRICS 0x0c33 GN Otometrics -vendor CHICONY2 0x0c45 Chicony +vendor CHICONY2 0x0c45 Chicony / Microdia / Sonix Technology Co., Ltd. vendor REINERSCT 0x0c4b Reiner-SCT vendor SEALEVEL 0x0c52 Sealevel System vendor JETI 0x0c6c Jeti @@ -687,6 +687,7 @@ vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek vendor KAMSTRUP 0x17a8 Kamstrup A/S +vendor DISPLAYLINK 0x17e9 DisplayLink vendor LENOVO 0x17ef Lenovo vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala @@ -775,6 +776,7 @@ vendor MOSCHIP 0x9710 MosChip Semicondu vendor NETGEAR4 0x9846 Netgear vendor MARVELL 0x9e88 Marvell Technology Group Ltd. vendor 3COM3 0xa727 3Com +vendor CACE 0xcace CACE Technologies vendor EVOLUTION 0xdeee Evolution Robotics products vendor DATAAPEX 0xdaae DataApex vendor HP2 0xf003 Hewlett Packard @@ -862,6 +864,7 @@ product ACCTON RT3070_3 0xc522 RT3070 product ACCTON RT3070_5 0xd522 RT3070 product ACCTON RTL8192SU 0xc512 RTL8192SU product ACCTON ZD1211B 0xe501 ZD1211B +product ACCTON WN7512 0xf522 WN7512 /* Aceeca products */ product ACEECA MEZ1000 0x0001 MEZ1000 RDA @@ -1226,6 +1229,11 @@ product ATHEROS2 AR5523_2 0x0003 AR5523 product ATHEROS2 AR5523_2_NF 0x0004 AR5523 (no firmware) product ATHEROS2 AR5523_3 0x0005 AR5523 product ATHEROS2 AR5523_3_NF 0x0006 AR5523 (no firmware) +product ATHEROS2 TG121N 0x1001 TG121N +product ATHEROS2 WN821NV2 0x1002 WN821NV2 +product ATHEROS2 3CRUSBN275 0x1010 3CRUSBN275 +product ATHEROS2 WN612 0x1011 WN612 +product ATHEROS2 AR9170 0x9170 AR9170 /* Atmel Comp. products */ product ATMEL STK541 0x2109 Zigbee Controller @@ -1241,6 +1249,9 @@ product AUTHENTEC AES1610 0x1600 AES1610 /* Avision products */ product AVISION 1200U 0x0268 1200U scanner +/* AVM products */ +product AVM FRITZWLAN 0x8401 FRITZ!WLAN N + /* Axesstel products */ product AXESSTEL DATAMODEM 0x1000 Data Modem @@ -1343,6 +1354,9 @@ product BROTHER MFC8600_9650 0x0100 MFC8 product BTC BTC6100 0x5550 6100C Keyboard product BTC BTC7932 0x6782 Keyboard with mouse port +/* CACE Technologies products */ +product CACE AIRPCAPNX 0x0300 AirPcap NX + /* Canon, Inc. products */ product CANON N656U 0x2206 CanoScan N656U product CANON N1220U 0x2207 CanoScan N1220U @@ -1603,6 +1617,7 @@ product DLINK DUBE100C1 0x1a02 DUB-E100 product DLINK DSB650TX4 0x200c 10/100 Ethernet product DLINK DWL120E 0x3200 DWL-120 rev E product DLINK DWA125D1 0x330f DWA-125 rev D1 +product DLINK DWA123D1 0x3310 DWA-123 rev D1 product DLINK DWL122 0x3700 DWL-122 product DLINK DWLG120 0x3701 DWL-G120 product DLINK DWL120F 0x3702 DWL-120 rev F @@ -1642,8 +1657,10 @@ product DLINK DWA131B 0x330d DWA-131 re product DLINK2 RTL8192SU_1 0x3300 RTL8192SU product DLINK2 RTL8192SU_2 0x3302 RTL8192SU product DLINK2 DWA131A1 0x3303 DWA-131 A1 +product DLINK2 DWA160A2 0x3a09 DWA-160 A2 product DLINK2 DWA120 0x3a0c DWA-120 product DLINK2 DWA120_NF 0x3a0d DWA-120 (no firmware) +product DLINK2 DWA130D1 0x3a0f DWA-130 D1 product DLINK2 DWLG122C1 0x3c03 DWL-G122 c1 product DLINK2 WUA1340 0x3c04 WUA-1340 product DLINK2 DWA111 0x3c06 DWA-111 @@ -1654,12 +1671,35 @@ product DLINK2 RT3072_1 0x3c0b RT3072 product DLINK2 RT3070_1 0x3c0d RT3070 product DLINK2 RT3070_2 0x3c0e RT3070 product DLINK2 RT3070_3 0x3c0f RT3070 +product DLINK2 DWA160A1 0x3c10 DWA-160 A1 product DLINK2 RT2870_2 0x3c11 RT2870 product DLINK2 DWA130 0x3c13 DWA-130 product DLINK2 RT3070_4 0x3c15 RT3070 product DLINK2 RT3070_5 0x3c16 RT3070 product DLINK3 DWM652 0x3e04 DWM-652 +/* DisplayLink products */ +product DISPLAYLINK LCD4300U 0x01ba LCD-4300U +product DISPLAYLINK LCD8000U 0x01bb LCD-8000U +product DISPLAYLINK LD220 0x0100 Samsung LD220 +product DISPLAYLINK GUC2020 0x0059 IOGEAR DVI GUC2020 +product DISPLAYLINK VCUD60 0x0136 Rextron DVI +product DISPLAYLINK CONV 0x0138 StarTech CONV-USB2DVI +product DISPLAYLINK DLDVI 0x0141 DisplayLink DVI +product DISPLAYLINK VGA10 0x015a CMP-USBVGA10 +product DISPLAYLINK WSDVI 0x0198 WS Tech DVI +product DISPLAYLINK EC008 0x019b EasyCAP008 DVI +product DISPLAYLINK HPDOCK 0x01d4 HP USB Docking +product DISPLAYLINK NL571 0x01d7 HP USB DVI +product DISPLAYLINK M01061 0x01e2 Lenovo DVI +product DISPLAYLINK SWDVI 0x024c SUNWEIT DVI +product DISPLAYLINK NBDOCK 0x0215 VideoHome NBdock1920 +product DISPLAYLINK LUM70 0x02a9 Lilliput UM-70 +product DISPLAYLINK UM7X0 0x401a nanovision MiMo +product DISPLAYLINK LT1421 0x03e0 Lenovo ThinkVision LT1421 +product DISPLAYLINK POLARIS2 0x0117 Polaris2 USB dock +product DISPLAYLINK PLUGABLE 0x0377 Plugable docking station + /* DMI products */ product DMI CFSM_RW 0xa109 CF/SM Reader/Writer product DMI DISK 0x2bcf Generic Disk @@ -1720,6 +1760,7 @@ product ELECOM MOUSE29UO 0x0002 mouse 29 product ELECOM LDUSBTX0 0x200c LD-USB/TX product ELECOM LDUSBTX1 0x4002 LD-USB/TX product ELECOM LDUSBLTX 0x4005 LD-USBL/TX +product ELECOM WDC150SU2M 0x4008 WDC-150SU2M product ELECOM LDUSBTX2 0x400b LD-USB/TX product ELECOM LDUSB20 0x4010 LD-USB20 product ELECOM UCSGT 0x5003 UC-SGT @@ -2448,6 +2489,7 @@ product IODATA USBETTXS 0x0913 USB ETTX product IODATA USBWNB11A 0x0919 USB WN-B11 product IODATA USBWNB11 0x0922 USB Airport WN-B11 product IODATA ETGUS2 0x0930 ETG-US2 +product IODATA WNGDNUS2 0x093f WN-GDN/US2 product IODATA RT3072_1 0x0944 RT3072 product IODATA RT3072_2 0x0945 RT3072 product IODATA RT3072_3 0x0947 RT3072 @@ -2613,6 +2655,7 @@ product LARSENBRUSGAARD ALTITRACK 0x0001 product LEADTEK 9531 0x2101 9531 GPS /* Lenovo products */ +product LENOVO GIGALAN 0x304b USB 3.0 Ethernet product LENOVO ETHERNET 0x7203 USB 2.0 Ethernet /* Lexar products */ @@ -3030,6 +3073,11 @@ product MGE UPS2 0xffff MGE UPS SYSTEMS product MEI CASHFLOW_SC 0x1100 Cashflow-SC Cash Acceptor product MEI S2000 0x1101 Series 2000 Combo Acceptor +/* Microdia / Sonix Techonology Co., Ltd. products */ +product CHICONY2 YUREX 0x1010 YUREX +product CHICONY2 CAM_1 0x62c0 CAM_1 +product CHICONY2 TEMPER 0x7401 TEMPer sensor + /* Micro Star International products */ product MSI BT_DONGLE 0x1967 Bluetooth USB dongle product MSI RT3070_1 0x3820 RT3070 @@ -3182,6 +3230,7 @@ product NATIONAL BEARPAW2400 0x1001 Bear /* NEC products */ product NEC HUB_0050 0x0050 USB 2.0 7-Port Hub product NEC HUB_005A 0x005a USB 2.0 4-Port Hub +product NEC WL300NUG 0x0249 WL300NU-G product NEC HUB 0x55aa hub product NEC HUB_B 0x55ab hub @@ -3209,12 +3258,17 @@ product NETGEAR EA101X 0x1002 Ethernet product NETGEAR FA101 0x1020 Ethernet 10/100, USB1.1 product NETGEAR FA120 0x1040 USB 2.0 Ethernet product NETGEAR M4100 0x1100 M4100/M5300/M7100 series switch -product NETGEAR WG111V2_2 0x4240 PrismGT USB 2.0 WLAN +product NETGEAR WG111V1_2 0x4240 PrismGT USB 2.0 WLAN product NETGEAR WG111V3 0x4260 WG111v3 product NETGEAR WG111U 0x4300 WG111U product NETGEAR WG111U_NF 0x4301 WG111U (no firmware) product NETGEAR WG111V2 0x6a00 WG111V2 +product NETGEAR WN111V2 0x9001 WN111V2 +product NETGEAR WNDA3100 0x9010 WNDA3100 +product NETGEAR WNDA4100 0x9012 WNDA4100 +product NETGEAR WNDA3200 0x9018 WNDA3200 product NETGEAR RTL8192CU 0x9021 RTL8192CU +product NETGEAR WNA1000 0x9040 WNA1000 product NETGEAR WNA1000M 0x9041 WNA1000M product NETGEAR2 MA101 0x4100 MA101 product NETGEAR2 MA101B 0x4102 MA101 Rev B @@ -3478,6 +3532,7 @@ product PLANEX GW_US11H 0x14ea GW-US11H product PLANEX2 RTL8188CUS 0x1201 RTL8188CUS product PLANEX2 GW_US11S 0x3220 GW-US11S WLAN product PLANEX2 GW_US54GXS 0x5303 GW-US54GXS WLAN +product PLANEX2 GW_US300 0x5304 GW-US300 product PLANEX2 RTL8188CU_1 0xab2a RTL8188CU product PLANEX2 RTL8188CU_2 0xed17 RTL8188CU product PLANEX2 RTL8188CU_3 0x4902 RTL8188CU @@ -3658,6 +3713,7 @@ product QUALCOMMINC E0076 0x0076 3G mode product QUALCOMMINC E0078 0x0078 3G modem product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem +product QUALCOMMINC MF112 0x0103 3G modem product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick product QUALCOMMINC K3772_Z_INIT 0x1179 K3772-Z Initial product QUALCOMMINC K3772_Z 0x1181 K3772-Z @@ -4395,6 +4451,7 @@ product TREK THUMBDRIVE_8MB 0x9988 Thumb /* TRENDnet products */ product TRENDNET RTL8192CU 0x624d RTL8192CU +product TRENDNET TEW646UBH 0x646b TEW-646UBH product TRENDNET RTL8188CU 0x648b RTL8188CU /* Tripp-Lite products */ @@ -4548,8 +4605,10 @@ product WINBOND UH104 0x5518 4-port USB product WINMAXGROUP FLASH64MC 0x6660 USB Flash Disk 64M-C /* Wistron NeWeb products */ +product WISTRONNEWEB WNC0600 0x0326 WNC-0600USB product WISTRONNEWEB UR045G 0x0427 PrismGT USB 2.0 WLAN product WISTRONNEWEB UR055G 0x0711 UR055G +product WISTRONNEWEB O8494 0x0804 ORiNOCO 802.11n product WISTRONNEWEB AR5523_1 0x0826 AR5523 product WISTRONNEWEB AR5523_1_NF 0x0827 AR5523 (no firmware) product WISTRONNEWEB AR5523_2 0x082a AR5523 @@ -4598,7 +4657,9 @@ product ZCOM AR5523_NF 0x0013 AR5523 dr product ZCOM XM142 0x0015 XM-142 product ZCOM ZD1211B 0x001a ZD1211B product ZCOM RT2870_1 0x0022 RT2870 +product ZCOM UB81 0x0023 UB81 product ZCOM RT2870_2 0x0025 RT2870 +product ZCOM UB82 0x0026 UB82 /* Zinwell products */ product ZINWELL RT2570 0x0260 RT2570 @@ -4617,6 +4678,7 @@ product ZORAN EX20DSC 0x4343 Digital Ca /* Zydas Technology Corporation products */ product ZYDAS ZD1211 0x1211 ZD1211 WLAN abg product ZYDAS ZD1211B 0x1215 ZD1211B +product ZYDAS ZD1221 0x1221 ZD1221 /* ZyXEL Communication Co. products */ product ZYXEL OMNI56K 0x1500 Omni 56K Plus @@ -4628,6 +4690,8 @@ product ZYXEL M202 0x340a M-202 product ZYXEL G220V2 0x340f G-220 v2 product ZYXEL G202 0x3410 G-202 product ZYXEL RT2870_1 0x3416 RT2870 +product ZYXEL NWD271N 0x3417 NWD-271N +product ZYXEL NWD211AN 0x3418 NWD-211AN product ZYXEL RT2870_2 0x341a RT2870 product ZYXEL RT3070 0x341e NWD2105 product ZYXEL RTL8192CU 0x341f RTL8192CU Modified: stable/10/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_run.c Mon Dec 14 07:54:45 2015 (r292182) +++ stable/10/sys/dev/usb/wlan/if_run.c Mon Dec 14 09:24:40 2015 (r292183) @@ -246,6 +246,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(MSI, RT3070_9), RUN_DEV(MSI, RT3070_10), RUN_DEV(MSI, RT3070_11), + RUN_DEV(NETGEAR, WNDA4100), RUN_DEV(OVISLINK, RT3072), RUN_DEV(PARA, RT3070), RUN_DEV(PEGATRON, RT2870), @@ -317,6 +318,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(ZINWELL, RT3072_2), RUN_DEV(ZYXEL, RT2870_1), RUN_DEV(ZYXEL, RT2870_2), + RUN_DEV(ZYXEL, RT3070), RUN_DEV_EJECT(ZYXEL, NWD2705), RUN_DEV_EJECT(RALINK, RT_STOR), #undef RUN_DEV_EJECT Modified: stable/10/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_upgt.c Mon Dec 14 07:54:45 2015 (r292182) +++ stable/10/sys/dev/usb/wlan/if_upgt.c Mon Dec 14 09:24:40 2015 (r292183) @@ -182,7 +182,7 @@ static const STRUCT_USB_HOST_ID upgt_dev UPGT_DEV(FSC, E5400), UPGT_DEV(GLOBESPAN, PRISM_GT_1), UPGT_DEV(GLOBESPAN, PRISM_GT_2), - UPGT_DEV(NETGEAR, WG111V2_2), + UPGT_DEV(NETGEAR, WG111V1_2), UPGT_DEV(INTERSIL, PRISM_GT), UPGT_DEV(SMC, 2862WG), UPGT_DEV(USR, USR5422), From owner-svn-src-stable-10@freebsd.org Mon Dec 14 09:46:48 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17A43A43630; Mon, 14 Dec 2015 09:46: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 mx1.freebsd.org (Postfix) with ESMTPS id D938E1410; Mon, 14 Dec 2015 09:46: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 tBE9klD8019055; Mon, 14 Dec 2015 09:46:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9kk6X019054; Mon, 14 Dec 2015 09:46:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140946.tBE9kk6X019054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292185 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 09:46:48 -0000 Author: hselasky Date: Mon Dec 14 09:46:46 2015 New Revision: 292185 URL: https://svnweb.freebsd.org/changeset/base/292185 Log: MFC r291953: When setting up VLANs on a Raspberry Pi ethernet port, the MTU drops from 1500 to 1496 bytes. The MTU should remain at 1500, extending the frame size as per IEEE 802.3. Adding IFCAP_VLAN_MTU to the if_capabilities field in the smsc driver solves the problem. The datasheet for the LAN9512 chip, section 3.2.3 states that the chip supports the extended frame. Submitted by: rpp@ci.com.au PR: 205050 Modified: stable/10/sys/dev/usb/net/if_smsc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_smsc.c ============================================================================== --- stable/10/sys/dev/usb/net/if_smsc.c Mon Dec 14 09:42:39 2015 (r292184) +++ stable/10/sys/dev/usb/net/if_smsc.c Mon Dec 14 09:46:46 2015 (r292185) @@ -1686,7 +1686,7 @@ smsc_attach_post_sub(struct usb_ether *u /* The chip supports TCP/UDP checksum offloading on TX and RX paths, however * currently only RX checksum is supported in the driver (see top of file). */ - ifp->if_capabilities |= IFCAP_RXCSUM; + ifp->if_capabilities |= IFCAP_RXCSUM | IFCAP_VLAN_MTU; ifp->if_hwassist = 0; /* TX checksuming is disabled (for now?) From owner-svn-src-stable-10@freebsd.org Mon Dec 14 09:52:16 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE61AA43AAE; Mon, 14 Dec 2015 09:52:16 +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 mx1.freebsd.org (Postfix) with ESMTPS id 886E11B1D; Mon, 14 Dec 2015 09:52:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9qF5E022582; Mon, 14 Dec 2015 09:52:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9qFrf022581; Mon, 14 Dec 2015 09:52:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140952.tBE9qFrf022581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292187 - stable/10/etc/devd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 09:52:16 -0000 Author: hselasky Date: Mon Dec 14 09:52:15 2015 New Revision: 292187 URL: https://svnweb.freebsd.org/changeset/base/292187 Log: MFC r291703: Regenerate usb.conf . Modified: stable/10/etc/devd/usb.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/devd/usb.conf ============================================================================== --- stable/10/etc/devd/usb.conf Mon Dec 14 09:52:09 2015 (r292186) +++ stable/10/etc/devd/usb.conf Mon Dec 14 09:52:15 2015 (r292187) @@ -145,7 +145,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0403"; - match "product" "(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee1 8|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; + match "product" "(0x5259|0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x6015|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xa6d1|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed7 4|0xee18|0xeee8|0xeee9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)"; action "kldload -n uftdi"; }; @@ -169,7 +169,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0409"; - match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; + match "product" "(0x00d5|0x00d6|0x00d7)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0409"; + match "product" "0x0249"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0409"; + match "product" "(0x8024|0x8025)"; action "kldload -n uipaq"; }; @@ -281,7 +297,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0411"; - match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2|0x01ee)"; + match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2|0x01a8|0x01ee)"; action "kldload -n if_run"; }; @@ -521,6 +537,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x04bb"; + match "product" "0x093f"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; match "product" "(0x0944|0x0945|0x0947|0x0948)"; action "kldload -n if_run"; }; @@ -1064,6 +1088,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x057c"; + match "product" "0x8401"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0584"; match "product" "0xb000"; action "kldload -n uplcom"; @@ -1089,7 +1121,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0586"; - match "product" "(0x3416|0x341a|0x341e)"; + match "product" "0x3416"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "0x3417"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "(0x341a|0x341e)"; action "kldload -n if_run"; }; @@ -1153,7 +1201,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05ac"; - match "product" "(0x0230|0x0231|0x0232|0x0236|0x0237|0x0238|0x023f|0x0240|0x0241|0x0242|0x0243|0x0244|0x0245|0x0246|0x0247|0x0249|0x024a|0x024b|0x024c|0x024d|0x024e|0x0252|0x0253|0x0254|0x0259|0x025a|0x025b|0x0262|0x0263|0x0264|0x0290|0x0291|0x0292)"; + match "product" "(0x0230|0x0231|0x0232|0x0236|0x0237|0x0238|0x023f|0x0240|0x0241|0x0242|0x0243|0x0244|0x0245|0x0246|0x0247|0x0249|0x024a|0x024b|0x024c|0x024d|0x024e|0x0252|0x0253|0x0254|0x0259|0x025a|0x025b|0x0262|0x0263|0x0264|0x0272|0x0273|0x0274|0x0290|0x0291|0x0292)"; action "kldload -n wsp"; }; @@ -1193,7 +1241,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05c6"; - match "product" "(0x1000|0x6000|0x6500|0x6613|0x9000|0x9204|0x9205)"; + match "product" "(0x1000|0x6000|0x6500|0x6613|0x9000|0x9002|0x9204|0x9205)"; action "kldload -n u3g"; }; @@ -1721,6 +1769,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07d1"; + match "product" "0x3a09"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; match "product" "0x3a0c"; action "kldload -n if_uath"; }; @@ -1729,6 +1785,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07d1"; + match "product" "0x3a0f"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; match "product" "(0x3c03|0x3c04|0x3c06|0x3c07)"; action "kldload -n if_rum"; }; @@ -1737,7 +1801,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07d1"; - match "product" "(0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)"; + match "product" "(0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "0x3c10"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "(0x3c11|0x3c13|0x3c15|0x3c16)"; action "kldload -n if_run"; }; @@ -1848,6 +1928,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x083a"; + match "product" "0xf522"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0841"; match "product" "0x0001"; action "kldload -n urio"; @@ -1921,7 +2009,39 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0846"; - match "product" "(0x9021|0x9041)"; + match "product" "(0x9001|0x9010)"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9012"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9021"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9040"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x9041"; action "kldload -n if_urtwn"; }; @@ -2184,6 +2304,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0ace"; + match "product" "0x1221"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0af0"; match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701)"; action "kldload -n u3g"; @@ -2545,6 +2673,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; + match "product" "0x8152"; + action "kldload -n if_ure"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bda"; match "product" "0x8170"; action "kldload -n if_urtwn"; }; @@ -2561,7 +2697,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "(0x8176|0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e|0x817f)"; + match "product" "(0x8176|0x8177|0x8178|0x8179|0x817a|0x817b|0x817c|0x817d|0x817e|0x817f)"; action "kldload -n if_urtwn"; }; @@ -2577,7 +2713,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "0x818a"; + match "product" "(0x818a|0x8191)"; action "kldload -n if_urtwn"; }; @@ -2680,6 +2816,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0c45"; + match "product" "0x7401"; + action "kldload -n ugold"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0c52"; match "product" "(0x2101|0x2102|0x2103|0x2104|0x2211|0x2212|0x2213|0x2221|0x2222|0x2223|0x2411|0x2412|0x2413|0x2421|0x2422|0x2423|0x2431|0x2432|0x2433|0x2441|0x2442|0x2443|0x2811|0x2812|0x2813|0x2821|0x2822|0x2823|0x2831|0x2832|0x2833|0x2841|0x2842|0x2843|0x2851|0x2852|0x2853|0x2861|0x2862|0x2863|0x2871|0x2872|0x2873|0x2881|0x2882|0x2883|0x9020)"; action "kldload -n uftdi"; @@ -2785,13 +2929,37 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0cde"; - match "product" "(0x0022|0x0025)"; + match "product" "0x0022"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0023"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0025"; action "kldload -n if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0026"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0cf3"; match "product" "(0x0001|0x0003|0x0005)"; action "kldload -n if_uath"; @@ -2801,7 +2969,31 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0cf3"; - match "product" "(0x3002|0x3004|0x311d|0xe004|0xe019)"; + match "product" "(0x1001|0x1002|0x1010|0x1011)"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cf3"; + match "product" "(0x3002|0x3004|0x311d)"; + action "kldload -n ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cf3"; + match "product" "0x9170"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cf3"; + match "product" "(0xe004|0xe019)"; action "kldload -n ng_ubt"; }; @@ -3537,7 +3729,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1199"; - match "product" "0x68aa"; + match "product" "(0x68aa|0x68c0|0x9041)"; action "kldload -n u3g"; }; @@ -3649,7 +3841,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x12d1"; - match "product" "(0x1803|0x1c05|0x1c0b)"; + match "product" "(0x1573|0x1803|0x1c05|0x1c0b)"; action "kldload -n u3g"; }; @@ -3841,6 +4033,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1435"; + match "product" "0x0326"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1435"; match "product" "0x0427"; action "kldload -n if_upgt"; }; @@ -3857,6 +4057,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1435"; + match "product" "0x0804"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1435"; match "product" "(0x0826|0x082a)"; action "kldload -n if_uath"; }; @@ -4424,6 +4632,22 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x17e9"; + match "product" "(0x0059|0x0100|0x0117|0x0136|0x0138|0x0141|0x015a|0x0198|0x019b|0x01ba|0x01bb|0x01d4|0x01d7|0x01e2|0x0215|0x024c|0x02a9|0x0377|0x03e0|0x401a)"; + action "kldload -n udl"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x17ef"; + match "product" "0x304b"; + action "kldload -n if_axge"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x17ef"; match "product" "0x7203"; action "kldload -n if_axe"; @@ -4505,7 +4729,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x19d2"; - match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x1179|0x1181|0x1514|0x1516|0x2000|0x2002|0x2003|0xffdd|0xffde|0xfff1|0xfff5|0xfffe)"; + match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0103|0x0117|0x1179|0x1181|0x1420|0x1514|0x1516|0x2000|0x2002|0x2003|0xffdd|0xffde|0xfff1|0xfff5|0xfffe)"; action "kldload -n u3g"; }; @@ -4785,7 +5009,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x7e12|0xa805)"; + match "product" "(0x7d02|0x7e12|0xa707|0xa805)"; action "kldload -n u3g"; }; @@ -4817,6 +5041,14 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2019"; + match "product" "0x5304"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; match "product" "0xab01"; action "kldload -n if_rum"; }; @@ -5288,6 +5520,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0xcace"; + match "product" "0x0300"; + action "kldload -n if_otus"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0xdaae"; match "product" "0xead6"; action "kldload -n uslcom"; @@ -5393,7 +5633,7 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; - match "mode" "host"; + match "mode" "(host|device)"; match "intclass" "0x02"; match "intsubclass" "0x02"; match "intprotocol" "0x00"; @@ -5402,7 +5642,7 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; - match "mode" "host"; + match "mode" "(host|device)"; match "intclass" "0x02"; match "intsubclass" "0x02"; match "intprotocol" "0x01"; @@ -5412,6 +5652,15 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "intclass" "0x02"; + match "intsubclass" "0x02"; + match "intprotocol" "0xff"; + action "kldload -n if_urndis"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "intclass" "0x03"; match "intsubclass" "0x01"; match "intprotocol" "0x01"; @@ -5552,5 +5801,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2658 USB entries processed +# 2719 USB entries processed From owner-svn-src-stable-10@freebsd.org Mon Dec 14 09:55:15 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2D0EA43D88; Mon, 14 Dec 2015 09:55:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A34CE1FB0; Mon, 14 Dec 2015 09:55:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9tEE1023116; Mon, 14 Dec 2015 09:55:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9tEe2023115; Mon, 14 Dec 2015 09:55:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140955.tBE9tEe2023115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292189 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 09:55:15 -0000 Author: hselasky Date: Mon Dec 14 09:55:14 2015 New Revision: 292189 URL: https://svnweb.freebsd.org/changeset/base/292189 Log: MFC r291684: Update the mlx5en(4) manual page. Submitted by: Mark Bloch Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4348 Modified: stable/10/share/man/man4/mlx5en.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/mlx5en.4 ============================================================================== --- stable/10/share/man/man4/mlx5en.4 Mon Dec 14 09:53:18 2015 (r292188) +++ stable/10/share/man/man4/mlx5en.4 Mon Dec 14 09:55:14 2015 (r292189) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2015 +.Dd December 3, 2015 .Dt mlx5en 4 .Os .Sh NAME @@ -40,6 +40,12 @@ kernel configuration file: .Cd "device mlx5en" .Ed .Pp +To load the driver as a module at run-time, +run the following command as root: +.Bd -literal -offset indent +kldload mlx5en +.Ed +.Pp To load the driver as a module at boot time, place the following lines in .Xr loader.conf 5 : From owner-svn-src-stable-10@freebsd.org Mon Dec 14 09:57:44 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 033D3A43F6F; Mon, 14 Dec 2015 09:57:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C76EB11AB; Mon, 14 Dec 2015 09:57:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBE9vgUi023493; Mon, 14 Dec 2015 09:57:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9vgfp023492; Mon, 14 Dec 2015 09:57:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140957.tBE9vgfp023492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292190 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 09:57:44 -0000 Author: hselasky Date: Mon Dec 14 09:57:42 2015 New Revision: 292190 URL: https://svnweb.freebsd.org/changeset/base/292190 Log: MFC r291931: The firmware no longer supports setting a port MTU of zero bytes. Set the port MTU and then query it and report if any problems instead. Submitted by: Shahar Klein Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4408 Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 09:55:14 2015 (r292189) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 09:57:42 2015 (r292190) @@ -2005,32 +2005,15 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp struct mlx5e_priv *priv = ifp->if_softc; struct mlx5_core_dev *mdev = priv->mdev; int hw_mtu; - int min_mtu; int err; - /* - * Trying to set MTU to zero, in order - * to find out the FW's minimal MTU - */ - err = mlx5_set_port_mtu(mdev, 0); - if (err) - return (err); - err = mlx5_query_port_oper_mtu(mdev, &min_mtu); + err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); if (err) { - if_printf(ifp, "Query port minimal MTU failed\n"); + if_printf(ifp, "%s: mlx5_set_port_mtu failed setting %d, err=%d\n", + __func__, sw_mtu, err); return (err); } - - if (sw_mtu < MLX5E_HW2SW_MTU(min_mtu)) { - ifp->if_mtu = sw_mtu; - return (0); - } - - err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); - if (err) - return (err); - err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); if (!err) { ifp->if_mtu = MLX5E_HW2SW_MTU(hw_mtu); From owner-svn-src-stable-10@freebsd.org Mon Dec 14 09:59:22 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2838A43064; Mon, 14 Dec 2015 09:59:22 +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 mx1.freebsd.org (Postfix) with ESMTPS id B9C13134D; Mon, 14 Dec 2015 09:59:22 +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 tBE9xLYw023775; Mon, 14 Dec 2015 09:59:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBE9xLGm023772; Mon, 14 Dec 2015 09:59:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512140959.tBE9xLGm023772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 09:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292191 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 09:59:23 -0000 Author: hselasky Date: Mon Dec 14 09:59:21 2015 New Revision: 292191 URL: https://svnweb.freebsd.org/changeset/base/292191 Log: MFC r291932: Add support for setting the TX moderation mode via a sysctl entry. TX completion events can be moderated in the same way like RX completion events. Expose this functionality by a sysctl variable. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4409 Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Dec 14 09:57:42 2015 (r292190) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Dec 14 09:59:21 2015 (r292191) @@ -356,6 +356,7 @@ struct mlx5e_params { u8 default_vlan_prio; u8 num_tc; u8 rx_cq_moderation_mode; + u8 tx_cq_moderation_mode; u16 rx_cq_moderation_usec; u16 rx_cq_moderation_pkts; u16 tx_cq_moderation_usec; @@ -381,6 +382,7 @@ struct mlx5e_params { m(+1, u64 rx_coalesce_mode, "rx_coalesce_mode", "0: EQE mode 1: CQE mode") \ m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ + m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Dec 14 09:57:42 2015 (r292190) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Dec 14 09:59:21 2015 (r292191) @@ -136,6 +136,11 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params_ethtool.rx_coalesce_mode = 1; priv->params.rx_cq_moderation_mode = priv->params_ethtool.rx_coalesce_mode; + /* import TX mode */ + if (priv->params_ethtool.tx_coalesce_mode != 0) + priv->params_ethtool.tx_coalesce_mode = 1; + priv->params.tx_cq_moderation_mode = priv->params_ethtool.tx_coalesce_mode; + /* import RX coal time */ if (priv->params_ethtool.rx_coalesce_usecs < 1) priv->params_ethtool.rx_coalesce_usecs = 0; @@ -460,6 +465,7 @@ mlx5e_create_ethtool(struct mlx5e_priv * priv->params_ethtool.rx_coalesce_mode = priv->params.rx_cq_moderation_mode; priv->params_ethtool.rx_coalesce_usecs = priv->params.rx_cq_moderation_usec; priv->params_ethtool.rx_coalesce_pkts = priv->params.rx_cq_moderation_pkts; + priv->params_ethtool.tx_coalesce_mode = priv->params.tx_cq_moderation_mode; priv->params_ethtool.tx_coalesce_usecs = priv->params.tx_cq_moderation_usec; priv->params_ethtool.tx_coalesce_pkts = priv->params.tx_cq_moderation_pkts; priv->params_ethtool.hw_lro = priv->params.hw_lro_en; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 09:57:42 2015 (r292190) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 09:59:21 2015 (r292191) @@ -1324,13 +1324,25 @@ static int mlx5e_open_tx_cqs(struct mlx5e_channel *c, struct mlx5e_channel_param *cparam) { + u8 tx_moderation_mode; int err; int tc; + switch (c->priv->params.tx_cq_moderation_mode) { + case 0: + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + if (MLX5_CAP_GEN(c->priv->mdev, cq_period_start_from_cqe)) + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + else + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + } for (tc = 0; tc < c->num_tc; tc++) { /* open completion queue */ err = mlx5e_open_cq(c, &cparam->tx_cq, &c->sq[tc].cq, - &mlx5e_tx_cq_comp, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + &mlx5e_tx_cq_comp, tx_moderation_mode); if (err) goto err_close_tx_cqs; } From owner-svn-src-stable-10@freebsd.org Mon Dec 14 10:03:05 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 685C9A4338E; Mon, 14 Dec 2015 10:03:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35B571858; Mon, 14 Dec 2015 10:03:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEA34Y1026796; Mon, 14 Dec 2015 10:03:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEA348m026795; Mon, 14 Dec 2015 10:03:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512141003.tBEA348m026795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 10:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292192 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 10:03:05 -0000 Author: hselasky Date: Mon Dec 14 10:03:04 2015 New Revision: 292192 URL: https://svnweb.freebsd.org/changeset/base/292192 Log: MFC r290003: Add support for binding IRQs to CPUs in the LinuxKPI. The new function added is for BSD only and does not exist in Linux. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/include/linux/interrupt.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/interrupt.h ============================================================================== --- stable/10/sys/ofed/include/linux/interrupt.h Mon Dec 14 09:59:21 2015 (r292191) +++ stable/10/sys/ofed/include/linux/interrupt.h Mon Dec 14 10:03:04 2015 (r292192) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -117,6 +117,23 @@ request_irq(unsigned int irq, irq_handle return 0; } +static inline int +bind_irq_to_cpu(unsigned int irq, int cpu_id) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = _pci_find_irq_dev(irq); + if (dev == NULL) + return (-ENOENT); + + irqe = _irq_ent(dev, irq); + if (irqe == NULL) + return (-ENOENT); + + return (-bus_bind_intr(dev->bsddev, irqe->res, cpu_id)); +} + static inline void free_irq(unsigned int irq, void *device) { From owner-svn-src-stable-10@freebsd.org Mon Dec 14 10:18:06 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5217BA43E8F; Mon, 14 Dec 2015 10:18:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F82C1148; Mon, 14 Dec 2015 10:18:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEAI51P031536; Mon, 14 Dec 2015 10:18:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEAI4PS031530; Mon, 14 Dec 2015 10:18:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512141018.tBEAI4PS031530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 10:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292195 - in stable/10/sys/dev/mlx5: mlx5_core mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 10:18:06 -0000 Author: hselasky Date: Mon Dec 14 10:18:04 2015 New Revision: 292195 URL: https://svnweb.freebsd.org/changeset/base/292195 Log: MFC r291938: Add full support for Receive Side Scaling, RSS, to the mlx5en driver. This includes binding all interrupt and worker threads according to the RSS configuration, setting up correct Toeplitz hashing keys as given by RSS and setting the correct mbuf hashtype for all received traffic. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4410 Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 14 10:06:01 2015 (r292194) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 14 10:18:04 2015 (r292195) @@ -31,6 +31,15 @@ #include #include "mlx5_core.h" +#if (__FreeBSD_version >= 1100000) +#include "opt_rss.h" +#endif + +#ifdef RSS +#include +#include +#endif + enum { MLX5_EQE_SIZE = sizeof(struct mlx5_eqe), MLX5_EQE_OWNER_INIT_VAL = 0x1, @@ -389,6 +398,18 @@ int mlx5_create_map_eq(struct mlx5_core_ priv->irq_info[vecidx].name, eq); if (err) goto err_eq; +#ifdef RSS + if (vecidx >= MLX5_EQ_VEC_COMP_BASE) { + u8 bucket = vecidx - MLX5_EQ_VEC_COMP_BASE; + err = bind_irq_to_cpu(priv->msix_arr[vecidx].vector, + rss_getcpu(bucket % rss_getnumbuckets())); + if (err) + goto err_irq; + } +#else + if (0) + goto err_irq; +#endif /* EQs are created in ARMED state @@ -398,6 +419,8 @@ int mlx5_create_map_eq(struct mlx5_core_ kvfree(in); return 0; +err_irq: + free_irq(priv->msix_arr[vecidx].vector, eq); err_eq: mlx5_cmd_destroy_eq(dev, eq->eqn); Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Dec 14 10:06:01 2015 (r292194) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Mon Dec 14 10:18:04 2015 (r292195) @@ -50,6 +50,15 @@ #include #include +#if (__FreeBSD_version >= 1100000) +#include "opt_rss.h" +#endif + +#ifdef RSS +#include +#include +#endif + #include #ifdef HAVE_TURBO_LRO Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 10:06:01 2015 (r292194) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 14 10:18:04 2015 (r292195) @@ -931,6 +931,10 @@ mlx5e_create_sq(struct mlx5e_channel *c, void *sqc = param->sqc; void *sqc_wq = MLX5_ADDR_OF(sqc, sqc, wq); +#ifdef RSS + cpuset_t cpu_mask; + int cpu_id; +#endif int err; /* Create DMA descriptor TAG */ @@ -991,9 +995,15 @@ mlx5e_create_sq(struct mlx5e_channel *c, } TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq); - taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, "%s tx sq", - c->ifp->if_xname); - +#ifdef RSS + cpu_id = rss_getcpu(c->ix % rss_getnumbuckets()); + CPU_SETOF(cpu_id, &cpu_mask); + taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask, + "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id); +#else + taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, + "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc); +#endif snprintf(buffer, sizeof(buffer), "txstat%dtc%d", c->ix, tc); mlx5e_create_stats(&sq->stats.ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), buffer, mlx5e_sq_stats_desc, MLX5E_SQ_STATS_NUM, @@ -1768,8 +1778,14 @@ mlx5e_open_rqt(struct mlx5e_priv *priv) MLX5_SET(rqtc, rqtc, rqt_max_size, sz); for (i = 0; i < sz; i++) { - int ix = i % priv->params.num_channels; - + int ix; +#ifdef RSS + ix = rss_get_indirection_to_bucket(i); +#else + ix = i; +#endif + /* ensure we don't overflow */ + ix %= priv->params.num_channels; MLX5_SET(rqtc, rqtc, rq_num[i], priv->channel[ix]->rq.rqn); } @@ -1834,6 +1850,8 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_CAP_ETH(priv->mdev, lro_timer_supported_periods[2])); } + + /* setup parameters for hashing TIR type, if any */ switch (tt) { case MLX5E_TT_ANY: MLX5_SET(tirc, tirc, disp_type, @@ -1848,8 +1866,16 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p priv->rqtn); MLX5_SET(tirc, tirc, rx_hash_fn, MLX5_TIRC_RX_HASH_FN_HASH_TOEPLITZ); - MLX5_SET(tirc, tirc, rx_hash_symmetric, 1); hkey = (__be32 *) MLX5_ADDR_OF(tirc, tirc, rx_hash_toeplitz_key); +#ifdef RSS + /* + * The FreeBSD RSS implementation does currently not + * support symmetric Toeplitz hashes: + */ + MLX5_SET(tirc, tirc, rx_hash_symmetric, 0); + rss_getkey((uint8_t *)hkey); +#else + MLX5_SET(tirc, tirc, rx_hash_symmetric, 1); hkey[0] = cpu_to_be32(0xD181C62C); hkey[1] = cpu_to_be32(0xF7F4DB5B); hkey[2] = cpu_to_be32(0x1983A2FC); @@ -1860,6 +1886,7 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p hkey[7] = cpu_to_be32(0x593D56D9); hkey[8] = cpu_to_be32(0xF3253C06); hkey[9] = cpu_to_be32(0x2ADC1FFC); +#endif break; } @@ -1869,6 +1896,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV4); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_TCP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV4)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -1878,6 +1911,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV6); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_TCP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV6)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -1887,6 +1926,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV4); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_UDP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV4)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -1896,6 +1941,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV6); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_UDP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV6)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -2052,6 +2103,13 @@ mlx5e_open_locked(struct ifnet *ifp) if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0) return (0); +#ifdef RSS + if (rss_getnumbuckets() > priv->params.num_channels) { + if_printf(ifp, "NOTE: There are more RSS buckets(%u) than " + "channels(%u) available\n", rss_getnumbuckets(), + priv->params.num_channels); + } +#endif err = mlx5e_open_tises(priv); if (err) { if_printf(ifp, "%s: mlx5e_open_tises failed, %d\n", Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Dec 14 10:06:01 2015 (r292194) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Dec 14 10:18:04 2015 (r292195) @@ -192,12 +192,43 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *c mb->m_pkthdr.len = mb->m_len = cqe_bcnt; /* check if a Toeplitz hash was computed */ - if (cqe->rss_hash_type != 0) + if (cqe->rss_hash_type != 0) { mb->m_pkthdr.flowid = be32_to_cpu(cqe->rss_hash_result); - else +#ifdef RSS + /* decode the RSS hash type */ + switch (cqe->rss_hash_type & + (CQE_RSS_DST_HTYPE_L4 | CQE_RSS_DST_HTYPE_IP)) { + /* IPv4 */ + case (CQE_RSS_DST_HTYPE_TCP | CQE_RSS_DST_HTYPE_IPV4): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_TCP_IPV4); + break; + case (CQE_RSS_DST_HTYPE_UDP | CQE_RSS_DST_HTYPE_IPV4): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_UDP_IPV4); + break; + case CQE_RSS_DST_HTYPE_IPV4: + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_IPV4); + break; + /* IPv6 */ + case (CQE_RSS_DST_HTYPE_TCP | CQE_RSS_DST_HTYPE_IPV6): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_TCP_IPV6); + break; + case (CQE_RSS_DST_HTYPE_UDP | CQE_RSS_DST_HTYPE_IPV6): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_UDP_IPV6); + break; + case CQE_RSS_DST_HTYPE_IPV6: + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_IPV6); + break; + default: /* Other */ + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + break; + } +#else + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); +#endif + } else { mb->m_pkthdr.flowid = rq->ix; - - M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + } mb->m_pkthdr.rcvif = ifp; if (likely(ifp->if_capenable & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) && Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Dec 14 10:06:01 2015 (r292194) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Dec 14 10:18:04 2015 (r292195) @@ -85,7 +85,15 @@ mlx5e_select_queue(struct ifnet *ifp, st /* check if flowid is set */ if (M_HASHTYPE_GET(mb) != M_HASHTYPE_NONE) { - ch = (mb->m_pkthdr.flowid % 128) % ch; +#ifdef RSS + u32 temp; + + if (rss_hash2bucket(mb->m_pkthdr.flowid, + M_HASHTYPE_GET(mb), &temp) == 0) + ch = temp % ch; + else +#endif + ch = (mb->m_pkthdr.flowid % 128) % ch; } else { #if (__FreeBSD_version >= 1100000) ch = m_ether_tcpip_hash(MBUF_HASHFLAG_L3 | From owner-svn-src-stable-10@freebsd.org Mon Dec 14 10:31:05 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 374BCA448CB; Mon, 14 Dec 2015 10:31:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03B701A8E; Mon, 14 Dec 2015 10:31:04 +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 tBEAV4hh036552; Mon, 14 Dec 2015 10:31:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEAV3al036539; Mon, 14 Dec 2015 10:31:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512141031.tBEAV3al036539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 10:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292196 - in stable/10/sys: dev/mlx5 dev/mlx5/mlx5_core modules/mlx5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 10:31:05 -0000 Author: hselasky Date: Mon Dec 14 10:31:03 2015 New Revision: 292196 URL: https://svnweb.freebsd.org/changeset/base/292196 Log: MFC r291939: Update the mlx5 shared driver code to the latest version, which include the following list of changes: - Added eswitch ACL table management Introduce API for managing ACL table. This API include the following features: 1) vlan filter - for VST/VGT+ support. 2) spoofcheck. 3) robust functionality to allow/drop general untagged/tagged traffic. 4) support for both ingress and egress ACL types. - Added loopback filter to the vacl table. - Added multicast list set in the vPort context - Added promiscuous mode set in the vPort context - Set the vlan list in vPort context 1) Check caps if VLAN list is not longer than FW supports 2) Set MODIFY_NIC_VPORT_CONTEXT command - Changed MLX5_EEPROM_MAX_BYTES from 48 to 32 so that a single EEPROM reading cannot cross the 128-byte boundary. Previously reading the MCIA register was done in batches of 48 bytes. The third reading would then by-pass the 127th byte, which means that part of the low page and part of the high page would be read at the same time, which created a bug: 1st: 0-47 bytes 2nd: 48-95 bytes 3rd: 96-143 bytes Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4411 Added: stable/10/sys/dev/mlx5/eswitch_vacl.h - copied unchanged from r291939, head/sys/dev/mlx5/eswitch_vacl.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c - copied, changed from r291939, head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Modified: stable/10/sys/dev/mlx5/device.h stable/10/sys/dev/mlx5/driver.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c stable/10/sys/dev/mlx5/vport.h stable/10/sys/modules/mlx5/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/device.h ============================================================================== --- stable/10/sys/dev/mlx5/device.h Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/dev/mlx5/device.h Mon Dec 14 10:31:03 2015 (r292196) @@ -1023,6 +1023,25 @@ enum { MLX5_MODIFY_ESW_VPORT_CONTEXT_FIELD_SELECT_CVLAN_INSERT = 1 << 3 }; +enum { + MLX5_UC_ADDR_CHANGE = (1 << 0), + MLX5_MC_ADDR_CHANGE = (1 << 1), + MLX5_VLAN_CHANGE = (1 << 2), + MLX5_PROMISC_CHANGE = (1 << 3), + MLX5_MTU_CHANGE = (1 << 4), +}; + +enum mlx5_list_type { + MLX5_NIC_VPORT_LIST_TYPE_UC = 0x0, + MLX5_NIC_VPORT_LIST_TYPE_MC = 0x1, + MLX5_NIC_VPORT_LIST_TYPE_VLAN = 0x2, +}; + +enum { + MLX5_ESW_VPORT_ADMIN_STATE_DOWN = 0x0, + MLX5_ESW_VPORT_ADMIN_STATE_UP = 0x1, + MLX5_ESW_VPORT_ADMIN_STATE_AUTO = 0x2, +}; /* MLX5 DEV CAPs */ /* TODO: EAT.ME */ @@ -1087,6 +1106,22 @@ enum mlx5_cap_type { MLX5_GET(flow_table_eswitch_cap, \ mdev->hca_caps_max[MLX5_CAP_ESWITCH_FLOW_TABLE], cap) +#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(dev, \ + flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ + flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(dev, \ + flow_table_properties_esw_acl_ingress.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ + flow_table_properties_esw_acl_ingress.cap) + #define MLX5_CAP_ESW(mdev, cap) \ MLX5_GET(e_switch_cap, \ mdev->hca_caps_cur[MLX5_CAP_ESWITCH], cap) Modified: stable/10/sys/dev/mlx5/driver.h ============================================================================== --- stable/10/sys/dev/mlx5/driver.h Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/dev/mlx5/driver.h Mon Dec 14 10:31:03 2015 (r292196) @@ -934,7 +934,7 @@ struct mlx5_profile { }; -#define MLX5_EEPROM_MAX_BYTES 48 +#define MLX5_EEPROM_MAX_BYTES 32 #define MLX5_EEPROM_IDENTIFIER_BYTE_MASK 0x000000ff #define MLX5_EEPROM_REVISION_ID_BYTE_MASK 0x0000ff00 #define MLX5_EEPROM_PAGE_3_VALID_BIT_MASK 0x00040000 Copied: stable/10/sys/dev/mlx5/eswitch_vacl.h (from r291939, head/sys/dev/mlx5/eswitch_vacl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/mlx5/eswitch_vacl.h Mon Dec 14 10:31:03 2015 (r292196, copy of r291939, head/sys/dev/mlx5/eswitch_vacl.h) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2013-2015, 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 + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef MLX5_ESWITCH_VACL_TABLE_H +#define MLX5_ESWITCH_VACL_TABLE_H + +#include + +void *mlx5_vacl_table_create(struct mlx5_core_dev *dev, + u16 vport, bool is_egress); +void mlx5_vacl_table_cleanup(void *acl_t); +int mlx5_vacl_table_add_vlan(void *acl_t, u16 vlan); +void mlx5_vacl_table_del_vlan(void *acl_t, u16 vlan); +int mlx5_vacl_table_enable_vlan_filter(void *acl_t); +void mlx5_vacl_table_disable_vlan_filter(void *acl_t); +int mlx5_vacl_table_drop_untagged(void *acl_t); +int mlx5_vacl_table_allow_untagged(void *acl_t); +int mlx5_vacl_table_drop_unknown_vlan(void *acl_t); +int mlx5_vacl_table_allow_unknown_vlan(void *acl_t); +int mlx5_vacl_table_set_spoofchk(void *acl_t, bool spoofchk, u8 *vport_mac); + +#endif /* MLX5_ESWITCH_VACL_TABLE_H */ Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 14 10:31:03 2015 (r292196) @@ -64,7 +64,6 @@ enum { (1ull << MLX5_EVENT_TYPE_WQ_INVAL_REQ_ERROR) | \ (1ull << MLX5_EVENT_TYPE_WQ_ACCESS_ERROR) | \ (1ull << MLX5_EVENT_TYPE_PORT_CHANGE) | \ - (1ull << MLX5_EVENT_TYPE_NIC_VPORT_CHANGE) | \ (1ull << MLX5_EVENT_TYPE_SRQ_CATAS_ERROR) | \ (1ull << MLX5_EVENT_TYPE_SRQ_LAST_WQE) | \ (1ull << MLX5_EVENT_TYPE_SRQ_RQ_LIMIT)) @@ -475,6 +474,10 @@ int mlx5_start_eqs(struct mlx5_core_dev async_event_mask |= (1ull << MLX5_EVENT_TYPE_CODING_PORT_MODULE_EVENT); + if (MLX5_CAP_GEN(dev, nic_vport_change_event)) + async_event_mask |= (1ull << + MLX5_EVENT_TYPE_NIC_VPORT_CHANGE); + err = mlx5_create_map_eq(dev, &table->cmd_eq, MLX5_EQ_VEC_CMD, MLX5_NUM_CMD_EQE, 1ull << MLX5_EVENT_TYPE_CMD, "mlx5_cmd_eq", &dev->priv.uuari.uars[0]); Copied and modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c (from r291939, head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c) ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Mon Dec 7 13:16:48 2015 (r291939, copy source) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Mon Dec 14 10:31:03 2015 (r292196) @@ -25,6 +25,7 @@ * $FreeBSD$ */ +#include #include #include #include Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_vport.c Mon Dec 14 10:31:03 2015 (r292196) @@ -328,7 +328,8 @@ int mlx5_set_nic_vport_current_mac(struc MLX5_SET(modify_nic_vport_context_in, in, field_select.addresses_list, 1); MLX5_SET(modify_nic_vport_context_in, in, - nic_vport_context.allowed_list_type, 0); + nic_vport_context.allowed_list_type, + MLX5_NIC_VPORT_LIST_TYPE_UC); MLX5_SET(modify_nic_vport_context_in, in, nic_vport_context.allowed_list_size, 1); @@ -345,6 +346,131 @@ int mlx5_set_nic_vport_current_mac(struc return err; } EXPORT_SYMBOL_GPL(mlx5_set_nic_vport_current_mac); + +int mlx5_set_nic_vport_vlan_list(struct mlx5_core_dev *dev, u32 vport, + u16 *vlan_list, int list_len) +{ + void *in, *ctx; + int i, err; + int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in) + + MLX5_ST_SZ_BYTES(vlan_layout) * (int)list_len; + + int max_list_size = 1 << MLX5_CAP_GEN_MAX(dev, log_max_vlan_list); + + if (list_len > max_list_size) { + mlx5_core_warn(dev, "Requested list size (%d) > (%d) max_list_size\n", + list_len, max_list_size); + return -ENOSPC; + } + + in = mlx5_vzalloc(inlen); + if (!in) { + mlx5_core_warn(dev, "failed to allocate inbox\n"); + return -ENOMEM; + } + + MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport); + if (vport) + MLX5_SET(modify_nic_vport_context_in, in, + other_vport, 1); + MLX5_SET(modify_nic_vport_context_in, in, + field_select.addresses_list, 1); + + ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, in, nic_vport_context); + + MLX5_SET(nic_vport_context, ctx, allowed_list_type, + MLX5_NIC_VPORT_LIST_TYPE_VLAN); + MLX5_SET(nic_vport_context, ctx, allowed_list_size, list_len); + + for (i = 0; i < list_len; i++) { + u8 *vlan_lout = MLX5_ADDR_OF(nic_vport_context, ctx, + current_uc_mac_address[i]); + MLX5_SET(vlan_layout, vlan_lout, vlan, vlan_list[i]); + } + + err = mlx5_modify_nic_vport_context(dev, in, inlen); + + kvfree(in); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_set_nic_vport_vlan_list); + +int mlx5_set_nic_vport_mc_list(struct mlx5_core_dev *mdev, int vport, + u64 *addr_list, size_t addr_list_len) +{ + void *in, *ctx; + int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in) + + MLX5_ST_SZ_BYTES(mac_address_layout) * (int)addr_list_len; + int err; + size_t i; + int max_list_sz = 1 << MLX5_CAP_GEN_MAX(mdev, log_max_current_mc_list); + + if ((int)addr_list_len > max_list_sz) { + mlx5_core_warn(mdev, "Requested list size (%d) > (%d) max_list_size\n", + (int)addr_list_len, max_list_sz); + return -ENOSPC; + } + + in = mlx5_vzalloc(inlen); + if (!in) { + mlx5_core_warn(mdev, "failed to allocate inbox\n"); + return -ENOMEM; + } + + MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport); + if (vport) + MLX5_SET(modify_nic_vport_context_in, in, + other_vport, 1); + MLX5_SET(modify_nic_vport_context_in, in, + field_select.addresses_list, 1); + + ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, in, nic_vport_context); + + MLX5_SET(nic_vport_context, ctx, allowed_list_type, + MLX5_NIC_VPORT_LIST_TYPE_MC); + MLX5_SET(nic_vport_context, ctx, allowed_list_size, addr_list_len); + + for (i = 0; i < addr_list_len; i++) { + u8 *mac_lout = (u8 *)MLX5_ADDR_OF(nic_vport_context, ctx, + current_uc_mac_address[i]); + u8 *mac_ptr = (u8 *)MLX5_ADDR_OF(mac_address_layout, mac_lout, + mac_addr_47_32); + ether_addr_copy(mac_ptr, (u8 *)&addr_list[i]); + } + + err = mlx5_modify_nic_vport_context(mdev, in, inlen); + + kvfree(in); + + return err; +} +EXPORT_SYMBOL_GPL(mlx5_set_nic_vport_mc_list); + +int mlx5_set_nic_vport_promisc(struct mlx5_core_dev *mdev, int vport, + bool promisc_mc, bool promisc_uc, + bool promisc_all) +{ + u8 in[MLX5_ST_SZ_BYTES(modify_nic_vport_context_in)]; + u8 *ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, in, + nic_vport_context); + + memset(in, 0, MLX5_ST_SZ_BYTES(modify_nic_vport_context_in)); + + MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport); + if (vport) + MLX5_SET(modify_nic_vport_context_in, in, + other_vport, 1); + MLX5_SET(modify_nic_vport_context_in, in, field_select.promisc, 1); + if (promisc_mc) + MLX5_SET(nic_vport_context, ctx, promisc_mc, 1); + if (promisc_uc) + MLX5_SET(nic_vport_context, ctx, promisc_uc, 1); + if (promisc_all) + MLX5_SET(nic_vport_context, ctx, promisc_all, 1); + + return mlx5_modify_nic_vport_context(mdev, in, sizeof(in)); +} +EXPORT_SYMBOL_GPL(mlx5_set_nic_vport_promisc); int mlx5_set_nic_vport_permanent_mac(struct mlx5_core_dev *mdev, int vport, u8 *addr) { Modified: stable/10/sys/dev/mlx5/vport.h ============================================================================== --- stable/10/sys/dev/mlx5/vport.h Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/dev/mlx5/vport.h Mon Dec 14 10:31:03 2015 (r292196) @@ -42,6 +42,13 @@ int mlx5_query_nic_vport_mac_address(str u32 vport, u8 *addr); int mlx5_set_nic_vport_current_mac(struct mlx5_core_dev *mdev, int vport, bool other_vport, u8 *addr); +int mlx5_set_nic_vport_vlan_list(struct mlx5_core_dev *dev, u32 vport, + u16 *vlan_list, int list_len); +int mlx5_set_nic_vport_mc_list(struct mlx5_core_dev *mdev, int vport, + u64 *addr_list, size_t addr_list_len); +int mlx5_set_nic_vport_promisc(struct mlx5_core_dev *mdev, int vport, + bool promisc_mc, bool promisc_uc, + bool promisc_all); int mlx5_set_nic_vport_permanent_mac(struct mlx5_core_dev *mdev, int vport, u8 *addr); int mlx5_nic_vport_enable_roce(struct mlx5_core_dev *mdev); Modified: stable/10/sys/modules/mlx5/Makefile ============================================================================== --- stable/10/sys/modules/mlx5/Makefile Mon Dec 14 10:18:04 2015 (r292195) +++ stable/10/sys/modules/mlx5/Makefile Mon Dec 14 10:31:03 2015 (r292196) @@ -7,6 +7,7 @@ mlx5_alloc.c \ mlx5_cmd.c \ mlx5_cq.c \ mlx5_eq.c \ +mlx5_eswitch_vacl.c \ mlx5_flow_table.c \ mlx5_fw.c \ mlx5_health.c \ From owner-svn-src-stable-10@freebsd.org Mon Dec 14 11:28:17 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA3EA4408A; Mon, 14 Dec 2015 11:28:17 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D8D01FCE; Mon, 14 Dec 2015 11:28:17 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEBSGRI058565; Mon, 14 Dec 2015 11:28:16 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEBSGqx058564; Mon, 14 Dec 2015 11:28:16 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141128.tBEBSGqx058564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 11:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292198 - stable/10/share/examples/etc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 11:28:17 -0000 Author: brueffer Date: Mon Dec 14 11:28:16 2015 New Revision: 292198 URL: https://svnweb.freebsd.org/changeset/base/292198 Log: MFH: r291950 Fix a typo in the CPUTYPE list. PR: 205099 Submitted by: xxjack12xx@gmail.com Modified: stable/10/share/examples/etc/make.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/etc/make.conf ============================================================================== --- stable/10/share/examples/etc/make.conf Mon Dec 14 11:13:50 2015 (r292197) +++ stable/10/share/examples/etc/make.conf Mon Dec 14 11:28:16 2015 (r292198) @@ -32,7 +32,7 @@ # Intel x86 architecture: # (AMD CPUs) amdfam10, opteron-sse3, athlon64-sse3, k8-sse3, # opteron, athlon64, athlon-fx, k8, athlon-mp, -# athlen-xp, athlon-4, athlon-tbird, athlon, k7, +# athlon-xp, athlon-4, athlon-tbird, athlon, k7, # geode, k6-3, k6-2, k6 # (Intel CPUs) core2, core, nocona, pentium4m, pentium4, prescott, # pentium3m, pentium3, pentium-m, pentium2, From owner-svn-src-stable-10@freebsd.org Mon Dec 14 11:34:02 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 134A4A444BD; Mon, 14 Dec 2015 11:34:02 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D839114FF; Mon, 14 Dec 2015 11:34:01 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEBY0cF061390; Mon, 14 Dec 2015 11:34:00 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEBY0NU061389; Mon, 14 Dec 2015 11:34:00 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141134.tBEBY0NU061389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 11:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292199 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 11:34:02 -0000 Author: brueffer Date: Mon Dec 14 11:34:00 2015 New Revision: 292199 URL: https://svnweb.freebsd.org/changeset/base/292199 Log: MFH: r291954 Add an MLINK for m_collapse. PR: 204205 Submitted by: avos Modified: stable/10/share/man/man9/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Mon Dec 14 11:28:16 2015 (r292198) +++ stable/10/share/man/man9/Makefile Mon Dec 14 11:34:00 2015 (r292199) @@ -889,6 +889,7 @@ MLINKS+=\ mbuf.9 m_cat.9 \ mbuf.9 MCHTYPE.9 \ mbuf.9 MCLGET.9 \ + mbuf.9 m_collapse.9 \ mbuf.9 m_copyback.9 \ mbuf.9 m_copydata.9 \ mbuf.9 m_copym.9 \ From owner-svn-src-stable-10@freebsd.org Mon Dec 14 11:38:44 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E932DA447D6; Mon, 14 Dec 2015 11:38:44 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCA681A91; Mon, 14 Dec 2015 11:38:44 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEBchWE061810; Mon, 14 Dec 2015 11:38:43 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEBcho3061809; Mon, 14 Dec 2015 11:38:43 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512141138.tBEBcho3061809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 14 Dec 2015 11:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292201 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 11:38:45 -0000 Author: brueffer Date: Mon Dec 14 11:38:43 2015 New Revision: 292201 URL: https://svnweb.freebsd.org/changeset/base/292201 Log: MFH: r291957 Fix a comment typo in the code example. PR: 203497 Submitted by: chadf@triularity.org Modified: stable/10/share/man/man9/g_bio.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/g_bio.9 ============================================================================== --- stable/10/share/man/man9/g_bio.9 Mon Dec 14 11:36:01 2015 (r292200) +++ stable/10/share/man/man9/g_bio.9 Mon Dec 14 11:38:43 2015 (r292201) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2006 +.Dd December 7, 2015 .Dt G_BIO 9 .Os .Sh NAME @@ -253,7 +253,7 @@ example_start(struct bio *bp) /* Ok, schedule it down. */ /* * The consumer can be obtained from - * LIST_FIRST(&bp->bio_to->geom->consumers) as well, + * LIST_FIRST(&bp->bio_to->geom->consumer) as well, * if there is only one in our geom. */ g_io_request(cbp, sc->ex_consumer); From owner-svn-src-stable-10@freebsd.org Mon Dec 14 14:44:24 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61B03A426D2; Mon, 14 Dec 2015 14:44:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E70F18A3; Mon, 14 Dec 2015 14:44:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEEiNSZ018405; Mon, 14 Dec 2015 14:44:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEEiNVS018404; Mon, 14 Dec 2015 14:44:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512141444.tBEEiNVS018404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 14 Dec 2015 14:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292211 - stable/10/sys/dev/netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 14:44:24 -0000 Author: ngie Date: Mon Dec 14 14:44:23 2015 New Revision: 292211 URL: https://svnweb.freebsd.org/changeset/base/292211 Log: Unbreak the powerpc/powerpc64 tinderbox PR: 198805 Submitted by: sbruno MFC r280430: r280430 (by bz): Make ix_crcstrip a public symbol for the moment; it probably is not the right solution but I will leave it to experts to untangle this problem to properly stop the build failures. At the moment only if_ix.c includes dev/netmap/ixgbe_netmap.h which is good as ixgbe_netmap.h defines a couple of (file) static variables--thus local to if_ix.c. static int ix_crcstrip however now also got checked from ix_txrx.c (as an extern) and should not be visible there. In fact we do see powerpc and powerpc64 build failures because of this. It is unclear to me why on other (clang built?) architectures this does not lead to a reference of an undefined symbol and similar build breakage. Modified: stable/10/sys/dev/netmap/ixgbe_netmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- stable/10/sys/dev/netmap/ixgbe_netmap.h Mon Dec 14 13:51:14 2015 (r292210) +++ stable/10/sys/dev/netmap/ixgbe_netmap.h Mon Dec 14 14:44:23 2015 (r292211) @@ -61,7 +61,8 @@ * count packets that might be missed due to lost interrupts. */ SYSCTL_DECL(_dev_netmap); -static int ix_rx_miss, ix_rx_miss_bufs, ix_crcstrip; +static int ix_rx_miss, ix_rx_miss_bufs; +int ix_crcstrip; SYSCTL_INT(_dev_netmap, OID_AUTO, ix_crcstrip, CTLFLAG_RW, &ix_crcstrip, 0, "strip CRC on rx frames"); SYSCTL_INT(_dev_netmap, OID_AUTO, ix_rx_miss, From owner-svn-src-stable-10@freebsd.org Mon Dec 14 15:45:12 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2FEEA47E67; Mon, 14 Dec 2015 15:45:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C01961E34; Mon, 14 Dec 2015 15:45:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEFjBqR035773; Mon, 14 Dec 2015 15:45:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEFjBYj035772; Mon, 14 Dec 2015 15:45:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512141545.tBEFjBYj035772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Dec 2015 15:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292213 - stable/10/sys/i386/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 15:45:13 -0000 Author: hselasky Date: Mon Dec 14 15:45:11 2015 New Revision: 292213 URL: https://svnweb.freebsd.org/changeset/base/292213 Log: Fix the XEN build by disabling the mlx5 and mlx5en modules when XEN is enabled. This is a direct commit to stable/10. Sponsored by: Mellanox Technologies Modified: stable/10/sys/i386/conf/XEN Modified: stable/10/sys/i386/conf/XEN ============================================================================== --- stable/10/sys/i386/conf/XEN Mon Dec 14 15:44:34 2015 (r292212) +++ stable/10/sys/i386/conf/XEN Mon Dec 14 15:45:11 2015 (r292213) @@ -14,6 +14,9 @@ makeoptions WITHOUT_MODULES="ctl cxgb dp # The following drivers don't work with PAE enabled. makeoptions WITHOUT_MODULES+="asr ncr pst" +# The following drivers don't build with XEN enabled. +makeoptions WITHOUT_MODULES+="mlx5 mlx5en" + options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption From owner-svn-src-stable-10@freebsd.org Mon Dec 14 20:29:32 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6693EA43585; Mon, 14 Dec 2015 20:29:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35542134E; Mon, 14 Dec 2015 20:29:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEKTVdq019867; Mon, 14 Dec 2015 20:29:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEKTVwp019866; Mon, 14 Dec 2015 20:29:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512142029.tBEKTVwp019866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 14 Dec 2015 20:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292220 - stable/10/bin/freebsd-version X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 20:29:32 -0000 Author: bdrewery Date: Mon Dec 14 20:29:31 2015 New Revision: 292220 URL: https://svnweb.freebsd.org/changeset/base/292220 Log: MFC r291942: Add missing CLEANFILES. Modified: stable/10/bin/freebsd-version/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/freebsd-version/Makefile ============================================================================== --- stable/10/bin/freebsd-version/Makefile Mon Dec 14 19:44:49 2015 (r292219) +++ stable/10/bin/freebsd-version/Makefile Mon Dec 14 20:29:31 2015 (r292220) @@ -2,7 +2,7 @@ SCRIPTS = freebsd-version MAN = freebsd-version.1 -CLEANFILES = freebsd-version.sh +CLEANFILES = freebsd-version freebsd-version.sh NEWVERS = ${.CURDIR}/../../sys/conf/newvers.sh freebsd-version.sh: ${.CURDIR}/freebsd-version.sh.in ${NEWVERS} From owner-svn-src-stable-10@freebsd.org Mon Dec 14 21:21:44 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC527A436E8; Mon, 14 Dec 2015 21:21:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADDB41B67; Mon, 14 Dec 2015 21:21:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBELLhIw035198; Mon, 14 Dec 2015 21:21:43 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBELLh71035193; Mon, 14 Dec 2015 21:21:43 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512142121.tBELLh71035193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 14 Dec 2015 21:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292223 - in stable/10/sys: fs/nfs fs/nfsserver nfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 21:21:45 -0000 Author: rmacklem Date: Mon Dec 14 21:21:43 2015 New Revision: 292223 URL: https://svnweb.freebsd.org/changeset/base/292223 Log: MFC: r291527 Add kernel support to the NFS server for the "-manage-gids" option that will be added to the nfsuserd daemon in a future commit. It modifies the cache used by NFSv4 for name<-->id translation (both username/uid and group/gid) to support this. When "-manage-gids" is set, the server looks up each uid for the RPC and uses the list of groups cached in the server instead of the list of groups provided in the RPC request. The cached group list is acquired for the cache by the nfsuserd daemon via getgrouplist(3). This avoids the 16 groups limit for the list in the RPC request. Since the cache is now used for every RPC when "-manage-gids" is enabled, the code also modifies the cache to use a separate mutex for each hash list instead of a single global mutex. Modified: stable/10/sys/fs/nfs/nfs.h stable/10/sys/fs/nfs/nfs_commonport.c stable/10/sys/fs/nfs/nfs_commonsubs.c stable/10/sys/fs/nfs/nfs_var.h stable/10/sys/fs/nfs/nfsrvstate.h stable/10/sys/fs/nfsserver/nfs_nfsdport.c stable/10/sys/nfs/nfssvc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs.h ============================================================================== --- stable/10/sys/fs/nfs/nfs.h Mon Dec 14 21:00:00 2015 (r292222) +++ stable/10/sys/fs/nfs/nfs.h Mon Dec 14 21:21:43 2015 (r292223) @@ -96,12 +96,6 @@ #define NFSSESSIONHASHSIZE 20 /* Size of server session hash table */ #endif #define NFSSTATEHASHSIZE 10 /* Size of server stateid hash table */ -#ifndef NFSUSERHASHSIZE -#define NFSUSERHASHSIZE 30 /* Size of user id hash table */ -#endif -#ifndef NFSGROUPHASHSIZE -#define NFSGROUPHASHSIZE 5 /* Size of group id hash table */ -#endif #ifndef NFSCLDELEGHIGHWATER #define NFSCLDELEGHIGHWATER 10000 /* limit for client delegations */ #endif @@ -204,6 +198,18 @@ struct nfsd_idargs { int nid_usertimeout;/* User name timeout (minutes) */ u_char *nid_name; /* Name */ int nid_namelen; /* and its length */ + gid_t *nid_grps; /* and the list */ + int nid_ngroup; /* Size of groups list */ +}; + +struct nfsd_oidargs { + int nid_flag; /* Flags (see below) */ + uid_t nid_uid; /* user/group id */ + gid_t nid_gid; + int nid_usermax; /* Upper bound on user name cache */ + int nid_usertimeout;/* User name timeout (minutes) */ + u_char *nid_name; /* Name */ + int nid_namelen; /* and its length */ }; struct nfsd_clid { Modified: stable/10/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonport.c Mon Dec 14 21:00:00 2015 (r292222) +++ stable/10/sys/fs/nfs/nfs_commonport.c Mon Dec 14 21:21:43 2015 (r292223) @@ -63,6 +63,7 @@ int nfs_numnfscbd = 0; int nfscl_debuglevel = 0; char nfsv4_callbackaddr[INET6_ADDRSTRLEN]; struct callout newnfsd_callout; +int nfsrv_lughashsize = 100; void (*nfsd_call_servertimer)(void) = NULL; void (*ncl_call_invalcaches)(struct vnode *) = NULL; @@ -79,6 +80,9 @@ SYSCTL_STRING(_vfs_nfs, OID_AUTO, callba "NFSv4 callback addr for server to use"); SYSCTL_INT(_vfs_nfs, OID_AUTO, debuglevel, CTLFLAG_RW, &nfscl_debuglevel, 0, "Debug level for new nfs client"); +TUNABLE_INT("vfs.nfs.userhashsize", &nfsrv_lughashsize); +SYSCTL_INT(_vfs_nfs, OID_AUTO, userhashsize, CTLFLAG_RDTUN, &nfsrv_lughashsize, + 0, "Size of hash tables for uid/name mapping"); /* * Defines for malloc @@ -445,9 +449,25 @@ nfssvc_call(struct thread *p, struct nfs { int error = EINVAL; struct nfsd_idargs nid; + struct nfsd_oidargs onid; if (uap->flag & NFSSVC_IDNAME) { - error = copyin(uap->argp, (caddr_t)&nid, sizeof (nid)); + if ((uap->flag & NFSSVC_NEWSTRUCT) != 0) + error = copyin(uap->argp, &nid, sizeof(nid)); + else { + error = copyin(uap->argp, &onid, sizeof(onid)); + if (error == 0) { + nid.nid_flag = onid.nid_flag; + nid.nid_uid = onid.nid_uid; + nid.nid_gid = onid.nid_gid; + nid.nid_usermax = onid.nid_usermax; + nid.nid_usertimeout = onid.nid_usertimeout; + nid.nid_name = onid.nid_name; + nid.nid_namelen = onid.nid_namelen; + nid.nid_ngroup = 0; + nid.nid_grps = NULL; + } + } if (error) goto out; error = nfssvc_idname(&nid); Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Mon Dec 14 21:00:00 2015 (r292222) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Mon Dec 14 21:21:43 2015 (r292223) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include +#include + /* * Data items converted to xdr at startup, since they are constant * This is kinda hokey, but may save a little time doing byte swaps @@ -68,6 +70,7 @@ int ncl_mbuf_mlen = MLEN; int nfsd_enable_stringtouid = 0; NFSNAMEIDMUTEX; NFSSOCKMUTEX; +extern int nfsrv_lughashsize; /* * This array of structures indicates, for V4: @@ -154,11 +157,14 @@ static int nfsrv_usercnt = 0; static int nfsrv_dnsnamelen; static u_char *nfsrv_dnsname = NULL; static int nfsrv_usermax = 999999999; -static struct nfsuserhashhead nfsuserhash[NFSUSERHASHSIZE]; -static struct nfsuserhashhead nfsusernamehash[NFSUSERHASHSIZE]; -static struct nfsuserhashhead nfsgrouphash[NFSGROUPHASHSIZE]; -static struct nfsuserhashhead nfsgroupnamehash[NFSGROUPHASHSIZE]; -static struct nfsuserlruhead nfsuserlruhead; +struct nfsrv_lughash { + struct mtx mtx; + struct nfsuserhashhead lughead; +}; +static struct nfsrv_lughash *nfsuserhash; +static struct nfsrv_lughash *nfsusernamehash; +static struct nfsrv_lughash *nfsgrouphash; +static struct nfsrv_lughash *nfsgroupnamehash; /* * This static array indicates whether or not the RPC generates a large @@ -177,7 +183,7 @@ static void nfsv4_wanted(struct nfsv4loc static int nfsrv_cmpmixedcase(u_char *cp, u_char *cp2, int len); static int nfsrv_getuser(int procnum, uid_t uid, gid_t gid, char *name, NFSPROC_T *p); -static void nfsrv_removeuser(struct nfsusrgrp *usrp); +static void nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser); static int nfsrv_getrefstr(struct nfsrv_descript *, u_char **, u_char **, int *, int *); static void nfsrv_refstrbigenough(int, u_char **, u_char **, int *); @@ -2541,18 +2547,17 @@ nfsv4_uidtostr(uid_t uid, u_char **cpp, u_char *cp = *cpp; uid_t tmp; int cnt, hasampersand, len = NFSV4_SMALLSTR, ret; + struct nfsrv_lughash *hp; cnt = 0; tryagain: - NFSLOCKNAMEID(); - if (nfsrv_dnsname) { + if (nfsrv_dnsnamelen > 0) { /* * Always map nfsrv_defaultuid to "nobody". */ if (uid == nfsrv_defaultuid) { i = nfsrv_dnsnamelen + 7; if (i > len) { - NFSUNLOCKNAMEID(); if (len > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); cp = malloc(i, M_NFSSTRING, M_WAITOK); @@ -2564,11 +2569,12 @@ tryagain: NFSBCOPY("nobody@", cp, 7); cp += 7; NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); - NFSUNLOCKNAMEID(); return; } hasampersand = 0; - LIST_FOREACH(usrp, NFSUSERHASH(uid), lug_numhash) { + hp = NFSUSERHASH(uid); + mtx_lock(&hp->mtx); + TAILQ_FOREACH(usrp, &hp->lughead, lug_numhash) { if (usrp->lug_uid == uid) { if (usrp->lug_expiry < NFSD_MONOSEC) break; @@ -2588,7 +2594,7 @@ tryagain: i = usrp->lug_namelen + nfsrv_dnsnamelen + 1; if (i > len) { - NFSUNLOCKNAMEID(); + mtx_unlock(&hp->mtx); if (len > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); cp = malloc(i, M_NFSSTRING, M_WAITOK); @@ -2603,20 +2609,19 @@ tryagain: *cp++ = '@'; NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); } - TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); - TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru); - NFSUNLOCKNAMEID(); + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + TAILQ_INSERT_TAIL(&hp->lughead, usrp, + lug_numhash); + mtx_unlock(&hp->mtx); return; } } - NFSUNLOCKNAMEID(); + mtx_unlock(&hp->mtx); cnt++; ret = nfsrv_getuser(RPCNFSUSERD_GETUID, uid, (gid_t)0, NULL, p); if (ret == 0 && cnt < 2) goto tryagain; - } else { - NFSUNLOCKNAMEID(); } /* @@ -2640,6 +2645,52 @@ tryagain: } /* + * Get a credential for the uid with the server's group list. + * If none is found, just return the credential passed in after + * logging a warning message. + */ +struct ucred * +nfsrv_getgrpscred(struct ucred *oldcred) +{ + struct nfsusrgrp *usrp; + struct ucred *newcred; + int cnt, ret; + uid_t uid; + struct nfsrv_lughash *hp; + + cnt = 0; + uid = oldcred->cr_uid; +tryagain: + if (nfsrv_dnsnamelen > 0) { + hp = NFSUSERHASH(uid); + mtx_lock(&hp->mtx); + TAILQ_FOREACH(usrp, &hp->lughead, lug_numhash) { + if (usrp->lug_uid == uid) { + if (usrp->lug_expiry < NFSD_MONOSEC) + break; + if (usrp->lug_cred != NULL) { + newcred = crhold(usrp->lug_cred); + crfree(oldcred); + } else + newcred = oldcred; + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + TAILQ_INSERT_TAIL(&hp->lughead, usrp, + lug_numhash); + mtx_unlock(&hp->mtx); + return (newcred); + } + } + mtx_unlock(&hp->mtx); + cnt++; + ret = nfsrv_getuser(RPCNFSUSERD_GETUID, uid, (gid_t)0, + NULL, curthread); + if (ret == 0 && cnt < 2) + goto tryagain; + } + return (oldcred); +} + +/* * Convert a string to a uid. * If no conversion is possible return NFSERR_BADOWNER, otherwise * return 0. @@ -2657,6 +2708,7 @@ nfsv4_strtouid(struct nfsrv_descript *nd int cnt, ret; int error = 0; uid_t tuid; + struct nfsrv_lughash *hp, *hp2; if (len == 0) { error = NFSERR_BADOWNER; @@ -2686,49 +2738,55 @@ nfsv4_strtouid(struct nfsrv_descript *nd cnt = 0; tryagain: - NFSLOCKNAMEID(); - /* - * If an '@' is found and the domain name matches, search for the name - * with dns stripped off. - * Mixed case alpahbetics will match for the domain name, but all - * upper case will not. - */ - if (cnt == 0 && i < len && i > 0 && nfsrv_dnsname && - (len - 1 - i) == nfsrv_dnsnamelen && - !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) { - len -= (nfsrv_dnsnamelen + 1); - *(cp - 1) = '\0'; - } - - /* - * Check for the special case of "nobody". - */ - if (len == 6 && !NFSBCMP(str, "nobody", 6)) { - *uidp = nfsrv_defaultuid; - NFSUNLOCKNAMEID(); - error = 0; - goto out; - } - - LIST_FOREACH(usrp, NFSUSERNAMEHASH(str, len), lug_namehash) { - if (usrp->lug_namelen == len && - !NFSBCMP(usrp->lug_name, str, len)) { - if (usrp->lug_expiry < NFSD_MONOSEC) - break; - *uidp = usrp->lug_uid; - TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); - TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru); - NFSUNLOCKNAMEID(); + if (nfsrv_dnsnamelen > 0) { + /* + * If an '@' is found and the domain name matches, search for + * the name with dns stripped off. + * Mixed case alpahbetics will match for the domain name, but + * all upper case will not. + */ + if (cnt == 0 && i < len && i > 0 && + (len - 1 - i) == nfsrv_dnsnamelen && + !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) { + len -= (nfsrv_dnsnamelen + 1); + *(cp - 1) = '\0'; + } + + /* + * Check for the special case of "nobody". + */ + if (len == 6 && !NFSBCMP(str, "nobody", 6)) { + *uidp = nfsrv_defaultuid; error = 0; goto out; } + + hp = NFSUSERNAMEHASH(str, len); + mtx_lock(&hp->mtx); + TAILQ_FOREACH(usrp, &hp->lughead, lug_namehash) { + if (usrp->lug_namelen == len && + !NFSBCMP(usrp->lug_name, str, len)) { + if (usrp->lug_expiry < NFSD_MONOSEC) + break; + hp2 = NFSUSERHASH(usrp->lug_uid); + mtx_lock(&hp2->mtx); + TAILQ_REMOVE(&hp2->lughead, usrp, lug_numhash); + TAILQ_INSERT_TAIL(&hp2->lughead, usrp, + lug_numhash); + *uidp = usrp->lug_uid; + mtx_unlock(&hp2->mtx); + mtx_unlock(&hp->mtx); + error = 0; + goto out; + } + } + mtx_unlock(&hp->mtx); + cnt++; + ret = nfsrv_getuser(RPCNFSUSERD_GETUSER, (uid_t)0, (gid_t)0, + str, p); + if (ret == 0 && cnt < 2) + goto tryagain; } - NFSUNLOCKNAMEID(); - cnt++; - ret = nfsrv_getuser(RPCNFSUSERD_GETUSER, (uid_t)0, (gid_t)0, - str, p); - if (ret == 0 && cnt < 2) - goto tryagain; error = NFSERR_BADOWNER; out: @@ -2751,18 +2809,17 @@ nfsv4_gidtostr(gid_t gid, u_char **cpp, u_char *cp = *cpp; gid_t tmp; int cnt, hasampersand, len = NFSV4_SMALLSTR, ret; + struct nfsrv_lughash *hp; cnt = 0; tryagain: - NFSLOCKNAMEID(); - if (nfsrv_dnsname) { + if (nfsrv_dnsnamelen > 0) { /* * Always map nfsrv_defaultgid to "nogroup". */ if (gid == nfsrv_defaultgid) { i = nfsrv_dnsnamelen + 8; if (i > len) { - NFSUNLOCKNAMEID(); if (len > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); cp = malloc(i, M_NFSSTRING, M_WAITOK); @@ -2774,11 +2831,12 @@ tryagain: NFSBCOPY("nogroup@", cp, 8); cp += 8; NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); - NFSUNLOCKNAMEID(); return; } hasampersand = 0; - LIST_FOREACH(usrp, NFSGROUPHASH(gid), lug_numhash) { + hp = NFSGROUPHASH(gid); + mtx_lock(&hp->mtx); + TAILQ_FOREACH(usrp, &hp->lughead, lug_numhash) { if (usrp->lug_gid == gid) { if (usrp->lug_expiry < NFSD_MONOSEC) break; @@ -2798,7 +2856,7 @@ tryagain: i = usrp->lug_namelen + nfsrv_dnsnamelen + 1; if (i > len) { - NFSUNLOCKNAMEID(); + mtx_unlock(&hp->mtx); if (len > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); cp = malloc(i, M_NFSSTRING, M_WAITOK); @@ -2813,20 +2871,19 @@ tryagain: *cp++ = '@'; NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen); } - TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); - TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru); - NFSUNLOCKNAMEID(); + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + TAILQ_INSERT_TAIL(&hp->lughead, usrp, + lug_numhash); + mtx_unlock(&hp->mtx); return; } } - NFSUNLOCKNAMEID(); + mtx_unlock(&hp->mtx); cnt++; ret = nfsrv_getuser(RPCNFSUSERD_GETGID, (uid_t)0, gid, NULL, p); if (ret == 0 && cnt < 2) goto tryagain; - } else { - NFSUNLOCKNAMEID(); } /* @@ -2867,6 +2924,7 @@ nfsv4_strtogid(struct nfsrv_descript *nd int cnt, ret; int error = 0; gid_t tgid; + struct nfsrv_lughash *hp, *hp2; if (len == 0) { error = NFSERR_BADOWNER; @@ -2896,47 +2954,53 @@ nfsv4_strtogid(struct nfsrv_descript *nd cnt = 0; tryagain: - NFSLOCKNAMEID(); - /* - * If an '@' is found and the dns name matches, search for the name - * with the dns stripped off. - */ - if (cnt == 0 && i < len && i > 0 && nfsrv_dnsname && - (len - 1 - i) == nfsrv_dnsnamelen && - !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) { - len -= (nfsrv_dnsnamelen + 1); - *(cp - 1) = '\0'; - } - - /* - * Check for the special case of "nogroup". - */ - if (len == 7 && !NFSBCMP(str, "nogroup", 7)) { - *gidp = nfsrv_defaultgid; - NFSUNLOCKNAMEID(); - error = 0; - goto out; - } - - LIST_FOREACH(usrp, NFSGROUPNAMEHASH(str, len), lug_namehash) { - if (usrp->lug_namelen == len && - !NFSBCMP(usrp->lug_name, str, len)) { - if (usrp->lug_expiry < NFSD_MONOSEC) - break; - *gidp = usrp->lug_gid; - TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); - TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru); - NFSUNLOCKNAMEID(); + if (nfsrv_dnsnamelen > 0) { + /* + * If an '@' is found and the dns name matches, search for the + * name with the dns stripped off. + */ + if (cnt == 0 && i < len && i > 0 && + (len - 1 - i) == nfsrv_dnsnamelen && + !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) { + len -= (nfsrv_dnsnamelen + 1); + *(cp - 1) = '\0'; + } + + /* + * Check for the special case of "nogroup". + */ + if (len == 7 && !NFSBCMP(str, "nogroup", 7)) { + *gidp = nfsrv_defaultgid; error = 0; goto out; } + + hp = NFSGROUPNAMEHASH(str, len); + mtx_lock(&hp->mtx); + TAILQ_FOREACH(usrp, &hp->lughead, lug_namehash) { + if (usrp->lug_namelen == len && + !NFSBCMP(usrp->lug_name, str, len)) { + if (usrp->lug_expiry < NFSD_MONOSEC) + break; + hp2 = NFSGROUPHASH(usrp->lug_gid); + mtx_lock(&hp2->mtx); + TAILQ_REMOVE(&hp2->lughead, usrp, lug_numhash); + TAILQ_INSERT_TAIL(&hp2->lughead, usrp, + lug_numhash); + *gidp = usrp->lug_gid; + mtx_unlock(&hp2->mtx); + mtx_unlock(&hp->mtx); + error = 0; + goto out; + } + } + mtx_unlock(&hp->mtx); + cnt++; + ret = nfsrv_getuser(RPCNFSUSERD_GETGROUP, (uid_t)0, (gid_t)0, + str, p); + if (ret == 0 && cnt < 2) + goto tryagain; } - NFSUNLOCKNAMEID(); - cnt++; - ret = nfsrv_getuser(RPCNFSUSERD_GETGROUP, (uid_t)0, (gid_t)0, - str, p); - if (ret == 0 && cnt < 2) - goto tryagain; error = NFSERR_BADOWNER; out: @@ -3094,111 +3158,218 @@ APPLESTATIC int nfssvc_idname(struct nfsd_idargs *nidp) { struct nfsusrgrp *nusrp, *usrp, *newusrp; - struct nfsuserhashhead *hp; - int i; + struct nfsrv_lughash *hp_name, *hp_idnum, *thp; + int i, group_locked, groupname_locked, user_locked, username_locked; int error = 0; u_char *cp; + gid_t *grps; + struct ucred *cr; + static int onethread = 0; + static time_t lasttime = 0; if (nidp->nid_flag & NFSID_INITIALIZE) { - cp = (u_char *)malloc(nidp->nid_namelen + 1, - M_NFSSTRING, M_WAITOK); - error = copyin(CAST_USER_ADDR_T(nidp->nid_name), cp, - nidp->nid_namelen); - NFSLOCKNAMEID(); - if (nfsrv_dnsname) { + cp = malloc(nidp->nid_namelen + 1, M_NFSSTRING, M_WAITOK); + error = copyin(CAST_USER_ADDR_T(nidp->nid_name), cp, + nidp->nid_namelen); + if (error != 0) { + free(cp, M_NFSSTRING); + goto out; + } + if (atomic_cmpset_acq_int(&nfsrv_dnsnamelen, 0, 0) == 0) { + /* + * Free up all the old stuff and reinitialize hash + * lists. All mutexes for both lists must be locked, + * with the user/group name ones before the uid/gid + * ones, to avoid a LOR. + */ + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsusernamehash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsuserhash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_FOREACH_SAFE(usrp, + &nfsuserhash[i].lughead, lug_numhash, nusrp) + nfsrv_removeuser(usrp, 1); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsuserhash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsusernamehash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsgroupnamehash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsgrouphash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_FOREACH_SAFE(usrp, + &nfsgrouphash[i].lughead, lug_numhash, + nusrp) + nfsrv_removeuser(usrp, 0); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsgrouphash[i].mtx); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsgroupnamehash[i].mtx); + free(nfsrv_dnsname, M_NFSSTRING); + nfsrv_dnsname = NULL; + } + if (nfsuserhash == NULL) { + /* Allocate the hash tables. */ + nfsuserhash = malloc(sizeof(struct nfsrv_lughash) * + nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | + M_ZERO); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_init(&nfsuserhash[i].mtx, "nfsuidhash", + NULL, MTX_DEF | MTX_DUPOK); + nfsusernamehash = malloc(sizeof(struct nfsrv_lughash) * + nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | + M_ZERO); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_init(&nfsusernamehash[i].mtx, + "nfsusrhash", NULL, MTX_DEF | + MTX_DUPOK); + nfsgrouphash = malloc(sizeof(struct nfsrv_lughash) * + nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | + M_ZERO); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_init(&nfsgrouphash[i].mtx, "nfsgidhash", + NULL, MTX_DEF | MTX_DUPOK); + nfsgroupnamehash = malloc(sizeof(struct nfsrv_lughash) * + nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK | + M_ZERO); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_init(&nfsgroupnamehash[i].mtx, + "nfsgrphash", NULL, MTX_DEF | MTX_DUPOK); + } + /* (Re)initialize the list heads. */ + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_INIT(&nfsuserhash[i].lughead); + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_INIT(&nfsusernamehash[i].lughead); + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_INIT(&nfsgrouphash[i].lughead); + for (i = 0; i < nfsrv_lughashsize; i++) + TAILQ_INIT(&nfsgroupnamehash[i].lughead); + /* - * Free up all the old stuff and reinitialize hash lists. + * Put name in "DNS" string. */ - TAILQ_FOREACH_SAFE(usrp, &nfsuserlruhead, lug_lru, nusrp) { - nfsrv_removeuser(usrp); - } - free(nfsrv_dnsname, M_NFSSTRING); - nfsrv_dnsname = NULL; - } - TAILQ_INIT(&nfsuserlruhead); - for (i = 0; i < NFSUSERHASHSIZE; i++) - LIST_INIT(&nfsuserhash[i]); - for (i = 0; i < NFSGROUPHASHSIZE; i++) - LIST_INIT(&nfsgrouphash[i]); - for (i = 0; i < NFSUSERHASHSIZE; i++) - LIST_INIT(&nfsusernamehash[i]); - for (i = 0; i < NFSGROUPHASHSIZE; i++) - LIST_INIT(&nfsgroupnamehash[i]); - - /* - * Put name in "DNS" string. - */ - if (!error) { nfsrv_dnsname = cp; - nfsrv_dnsnamelen = nidp->nid_namelen; nfsrv_defaultuid = nidp->nid_uid; nfsrv_defaultgid = nidp->nid_gid; nfsrv_usercnt = 0; nfsrv_usermax = nidp->nid_usermax; - } - NFSUNLOCKNAMEID(); - if (error) - free(cp, M_NFSSTRING); - goto out; + atomic_store_rel_int(&nfsrv_dnsnamelen, nidp->nid_namelen); + goto out; } /* * malloc the new one now, so any potential sleep occurs before * manipulation of the lists. */ - MALLOC(newusrp, struct nfsusrgrp *, sizeof (struct nfsusrgrp) + - nidp->nid_namelen, M_NFSUSERGROUP, M_WAITOK); + newusrp = malloc(sizeof(struct nfsusrgrp) + nidp->nid_namelen, + M_NFSUSERGROUP, M_WAITOK | M_ZERO); error = copyin(CAST_USER_ADDR_T(nidp->nid_name), newusrp->lug_name, nidp->nid_namelen); + if (error == 0 && nidp->nid_ngroup > 0 && + (nidp->nid_flag & NFSID_ADDUID) != 0) { + grps = malloc(sizeof(gid_t) * nidp->nid_ngroup, M_TEMP, + M_WAITOK); + error = copyin(CAST_USER_ADDR_T(nidp->nid_grps), grps, + sizeof(gid_t) * nidp->nid_ngroup); + if (error == 0) { + /* + * Create a credential just like svc_getcred(), + * but using the group list provided. + */ + cr = crget(); + cr->cr_uid = cr->cr_ruid = cr->cr_svuid = nidp->nid_uid; + crsetgroups(cr, nidp->nid_ngroup, grps); + cr->cr_rgid = cr->cr_svgid = cr->cr_groups[0]; + cr->cr_prison = &prison0; + prison_hold(cr->cr_prison); +#ifdef MAC + mac_cred_associate_nfsd(cr); +#endif + newusrp->lug_cred = cr; + } + free(grps, M_TEMP); + } if (error) { - free((caddr_t)newusrp, M_NFSUSERGROUP); + free(newusrp, M_NFSUSERGROUP); goto out; } newusrp->lug_namelen = nidp->nid_namelen; - NFSLOCKNAMEID(); + /* + * The lock order is username[0]->[nfsrv_lughashsize - 1] followed + * by uid[0]->[nfsrv_lughashsize - 1], with the same for group. + * The flags user_locked, username_locked, group_locked and + * groupname_locked are set to indicate all of those hash lists are + * locked. hp_name != NULL and hp_idnum != NULL indicates that + * the respective one mutex is locked. + */ + user_locked = username_locked = group_locked = groupname_locked = 0; + hp_name = hp_idnum = NULL; + /* * Delete old entries, as required. */ if (nidp->nid_flag & (NFSID_DELUID | NFSID_ADDUID)) { - hp = NFSUSERHASH(nidp->nid_uid); - LIST_FOREACH_SAFE(usrp, hp, lug_numhash, nusrp) { + /* Must lock all username hash lists first, to avoid a LOR. */ + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsusernamehash[i].mtx); + username_locked = 1; + hp_idnum = NFSUSERHASH(nidp->nid_uid); + mtx_lock(&hp_idnum->mtx); + TAILQ_FOREACH_SAFE(usrp, &hp_idnum->lughead, lug_numhash, + nusrp) { if (usrp->lug_uid == nidp->nid_uid) - nfsrv_removeuser(usrp); + nfsrv_removeuser(usrp, 1); } - } - if (nidp->nid_flag & (NFSID_DELUSERNAME | NFSID_ADDUSERNAME)) { - hp = NFSUSERNAMEHASH(newusrp->lug_name, newusrp->lug_namelen); - LIST_FOREACH_SAFE(usrp, hp, lug_namehash, nusrp) { + } else if (nidp->nid_flag & (NFSID_DELUSERNAME | NFSID_ADDUSERNAME)) { + hp_name = NFSUSERNAMEHASH(newusrp->lug_name, + newusrp->lug_namelen); + mtx_lock(&hp_name->mtx); + TAILQ_FOREACH_SAFE(usrp, &hp_name->lughead, lug_namehash, + nusrp) { if (usrp->lug_namelen == newusrp->lug_namelen && !NFSBCMP(usrp->lug_name, newusrp->lug_name, - usrp->lug_namelen)) - nfsrv_removeuser(usrp); - } - } - if (nidp->nid_flag & (NFSID_DELGID | NFSID_ADDGID)) { - hp = NFSGROUPHASH(nidp->nid_gid); - LIST_FOREACH_SAFE(usrp, hp, lug_numhash, nusrp) { + usrp->lug_namelen)) { + thp = NFSUSERHASH(usrp->lug_uid); + mtx_lock(&thp->mtx); + nfsrv_removeuser(usrp, 1); + mtx_unlock(&thp->mtx); + } + } + hp_idnum = NFSUSERHASH(nidp->nid_uid); + mtx_lock(&hp_idnum->mtx); + } else if (nidp->nid_flag & (NFSID_DELGID | NFSID_ADDGID)) { + /* Must lock all groupname hash lists first, to avoid a LOR. */ + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsgroupnamehash[i].mtx); + groupname_locked = 1; + hp_idnum = NFSGROUPHASH(nidp->nid_gid); + mtx_lock(&hp_idnum->mtx); + TAILQ_FOREACH_SAFE(usrp, &hp_idnum->lughead, lug_numhash, + nusrp) { if (usrp->lug_gid == nidp->nid_gid) - nfsrv_removeuser(usrp); + nfsrv_removeuser(usrp, 0); } - } - if (nidp->nid_flag & (NFSID_DELGROUPNAME | NFSID_ADDGROUPNAME)) { - hp = NFSGROUPNAMEHASH(newusrp->lug_name, newusrp->lug_namelen); - LIST_FOREACH_SAFE(usrp, hp, lug_namehash, nusrp) { + } else if (nidp->nid_flag & (NFSID_DELGROUPNAME | NFSID_ADDGROUPNAME)) { + hp_name = NFSGROUPNAMEHASH(newusrp->lug_name, + newusrp->lug_namelen); + mtx_lock(&hp_name->mtx); + TAILQ_FOREACH_SAFE(usrp, &hp_name->lughead, lug_namehash, + nusrp) { if (usrp->lug_namelen == newusrp->lug_namelen && !NFSBCMP(usrp->lug_name, newusrp->lug_name, - usrp->lug_namelen)) - nfsrv_removeuser(usrp); + usrp->lug_namelen)) { + thp = NFSGROUPHASH(usrp->lug_gid); + mtx_lock(&thp->mtx); + nfsrv_removeuser(usrp, 0); + mtx_unlock(&thp->mtx); + } } - } - TAILQ_FOREACH_SAFE(usrp, &nfsuserlruhead, lug_lru, nusrp) { - if (usrp->lug_expiry < NFSD_MONOSEC) - nfsrv_removeuser(usrp); - } - while (nfsrv_usercnt >= nfsrv_usermax) { - usrp = TAILQ_FIRST(&nfsuserlruhead); - nfsrv_removeuser(usrp); + hp_idnum = NFSGROUPHASH(nidp->nid_gid); + mtx_lock(&hp_idnum->mtx); } /* @@ -3210,23 +3381,129 @@ nfssvc_idname(struct nfsd_idargs *nidp) newusrp->lug_expiry = NFSD_MONOSEC + 5; if (nidp->nid_flag & (NFSID_ADDUID | NFSID_ADDUSERNAME)) { newusrp->lug_uid = nidp->nid_uid; - LIST_INSERT_HEAD(NFSUSERHASH(newusrp->lug_uid), newusrp, - lug_numhash); - LIST_INSERT_HEAD(NFSUSERNAMEHASH(newusrp->lug_name, - newusrp->lug_namelen), newusrp, lug_namehash); - TAILQ_INSERT_TAIL(&nfsuserlruhead, newusrp, lug_lru); - nfsrv_usercnt++; + thp = NFSUSERHASH(newusrp->lug_uid); + mtx_assert(&thp->mtx, MA_OWNED); + TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_numhash); + thp = NFSUSERNAMEHASH(newusrp->lug_name, newusrp->lug_namelen); + mtx_assert(&thp->mtx, MA_OWNED); + TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_namehash); + atomic_add_int(&nfsrv_usercnt, 1); } else if (nidp->nid_flag & (NFSID_ADDGID | NFSID_ADDGROUPNAME)) { newusrp->lug_gid = nidp->nid_gid; - LIST_INSERT_HEAD(NFSGROUPHASH(newusrp->lug_gid), newusrp, - lug_numhash); - LIST_INSERT_HEAD(NFSGROUPNAMEHASH(newusrp->lug_name, - newusrp->lug_namelen), newusrp, lug_namehash); - TAILQ_INSERT_TAIL(&nfsuserlruhead, newusrp, lug_lru); - nfsrv_usercnt++; - } else - FREE((caddr_t)newusrp, M_NFSUSERGROUP); - NFSUNLOCKNAMEID(); + thp = NFSGROUPHASH(newusrp->lug_gid); + mtx_assert(&thp->mtx, MA_OWNED); + TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_numhash); + thp = NFSGROUPNAMEHASH(newusrp->lug_name, newusrp->lug_namelen); + mtx_assert(&thp->mtx, MA_OWNED); + TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_namehash); + atomic_add_int(&nfsrv_usercnt, 1); + } else { + if (newusrp->lug_cred != NULL) + crfree(newusrp->lug_cred); + free(newusrp, M_NFSUSERGROUP); + } + + /* + * Once per second, allow one thread to trim the cache. + */ + if (lasttime < NFSD_MONOSEC && + atomic_cmpset_acq_int(&onethread, 0, 1) != 0) { + /* + * First, unlock the single mutexes, so that all entries + * can be locked and any LOR is avoided. + */ + if (hp_name != NULL) { + mtx_unlock(&hp_name->mtx); + hp_name = NULL; + } + if (hp_idnum != NULL) { + mtx_unlock(&hp_idnum->mtx); + hp_idnum = NULL; + } + + if ((nidp->nid_flag & (NFSID_DELUID | NFSID_ADDUID | + NFSID_DELUSERNAME | NFSID_ADDUSERNAME)) != 0) { + if (username_locked == 0) { + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsusernamehash[i].mtx); + username_locked = 1; + } + KASSERT(user_locked == 0, + ("nfssvc_idname: user_locked")); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsuserhash[i].mtx); + user_locked = 1; + for (i = 0; i < nfsrv_lughashsize; i++) { + TAILQ_FOREACH_SAFE(usrp, + &nfsuserhash[i].lughead, lug_numhash, + nusrp) + if (usrp->lug_expiry < NFSD_MONOSEC) + nfsrv_removeuser(usrp, 1); + } + for (i = 0; i < nfsrv_lughashsize; i++) { + /* + * Trim the cache using an approximate LRU + * algorithm. This code deletes the least + * recently used entry on each hash list. + */ + if (nfsrv_usercnt <= nfsrv_usermax) + break; + usrp = TAILQ_FIRST(&nfsuserhash[i].lughead); + if (usrp != NULL) + nfsrv_removeuser(usrp, 1); + } + } else { + if (groupname_locked == 0) { + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsgroupnamehash[i].mtx); + groupname_locked = 1; + } + KASSERT(group_locked == 0, + ("nfssvc_idname: group_locked")); + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_lock(&nfsgrouphash[i].mtx); + group_locked = 1; + for (i = 0; i < nfsrv_lughashsize; i++) { + TAILQ_FOREACH_SAFE(usrp, + &nfsgrouphash[i].lughead, lug_numhash, + nusrp) + if (usrp->lug_expiry < NFSD_MONOSEC) + nfsrv_removeuser(usrp, 0); + } + for (i = 0; i < nfsrv_lughashsize; i++) { + /* + * Trim the cache using an approximate LRU + * algorithm. This code deletes the least + * recently user entry on each hash list. + */ + if (nfsrv_usercnt <= nfsrv_usermax) + break; + usrp = TAILQ_FIRST(&nfsgrouphash[i].lughead); + if (usrp != NULL) + nfsrv_removeuser(usrp, 0); + } + } + lasttime = NFSD_MONOSEC; + atomic_store_rel_int(&onethread, 0); + } + + /* Now, unlock all locked mutexes. */ + if (hp_idnum != NULL) + mtx_unlock(&hp_idnum->mtx); + if (hp_name != NULL) + mtx_unlock(&hp_name->mtx); + if (user_locked != 0) + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsuserhash[i].mtx); + if (username_locked != 0) + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsusernamehash[i].mtx); + if (group_locked != 0) + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsgrouphash[i].mtx); + if (groupname_locked != 0) + for (i = 0; i < nfsrv_lughashsize; i++) + mtx_unlock(&nfsgroupnamehash[i].mtx); out: NFSEXITCODE(error); return (error); @@ -3236,15 +3513,29 @@ out: * Remove a user/group name element. */ static void -nfsrv_removeuser(struct nfsusrgrp *usrp) +nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser) { + struct nfsrv_lughash *hp; - NFSNAMEIDREQUIRED(); - LIST_REMOVE(usrp, lug_numhash); - LIST_REMOVE(usrp, lug_namehash); - TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); - nfsrv_usercnt--; - FREE((caddr_t)usrp, M_NFSUSERGROUP); + if (isuser != 0) { + hp = NFSUSERHASH(usrp->lug_uid); + mtx_assert(&hp->mtx, MA_OWNED); + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + hp = NFSUSERNAMEHASH(usrp->lug_name, usrp->lug_namelen); + mtx_assert(&hp->mtx, MA_OWNED); + TAILQ_REMOVE(&hp->lughead, usrp, lug_namehash); + } else { + hp = NFSGROUPHASH(usrp->lug_gid); + mtx_assert(&hp->mtx, MA_OWNED); + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + hp = NFSGROUPNAMEHASH(usrp->lug_name, usrp->lug_namelen); + mtx_assert(&hp->mtx, MA_OWNED); + TAILQ_REMOVE(&hp->lughead, usrp, lug_namehash); + } + atomic_add_int(&nfsrv_usercnt, -1); + if (usrp->lug_cred != NULL) + crfree(usrp->lug_cred); + free(usrp, M_NFSUSERGROUP); } /* Modified: stable/10/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/10/sys/fs/nfs/nfs_var.h Mon Dec 14 21:00:00 2015 (r292222) +++ stable/10/sys/fs/nfs/nfs_var.h Mon Dec 14 21:21:43 2015 (r292223) @@ -296,6 +296,7 @@ void nfsv4_setsequence(struct nfsmount * int nfsv4_sequencelookup(struct nfsmount *, struct nfsclsession *, int *, int *, uint32_t *, uint8_t *); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Mon Dec 14 21:30:29 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA7CCA43BFB; Mon, 14 Dec 2015 21:30:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97A6D1EC7; Mon, 14 Dec 2015 21:30:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBELUSDZ038373; Mon, 14 Dec 2015 21:30:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBELUSJV038371; Mon, 14 Dec 2015 21:30:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512142130.tBELUSJV038371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 14 Dec 2015 21:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292224 - in stable/10: . sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 21:30:29 -0000 Author: rmacklem Date: Mon Dec 14 21:30:28 2015 New Revision: 292224 URL: https://svnweb.freebsd.org/changeset/base/292224 Log: Bump __FreeBSD_version since r292223 changed the internal interface between the nfsd.ko and nfscommon.ko modules such that they need to be upgraded to-gether. Modified: stable/10/UPDATING stable/10/sys/sys/param.h Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Mon Dec 14 21:21:43 2015 (r292223) +++ stable/10/UPDATING Mon Dec 14 21:30:28 2015 (r292224) @@ -16,6 +16,11 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20151214: + r292223 changed the internal interface between the nfsd.ko and + nfscommon.ko modules. As such, they must both be upgraded to-gether. + __FreeBSD_version has been bumped because of this. + 20151113: Qlogic 24xx/25xx firmware images were updated from 5.5.0 to 7.3.0. Kernel modules isp_2400_multi and isp_2500_multi were removed and Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Mon Dec 14 21:21:43 2015 (r292223) +++ stable/10/sys/sys/param.h Mon Dec 14 21:30:28 2015 (r292224) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1002502 /* Master, propagated to newvers */ +#define __FreeBSD_version 1002503 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-10@freebsd.org Mon Dec 14 21:33:32 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98589A43F77; Mon, 14 Dec 2015 21:33:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 697A912F7; Mon, 14 Dec 2015 21:33:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBELXVp1041195; Mon, 14 Dec 2015 21:33:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBELXVJD041194; Mon, 14 Dec 2015 21:33:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512142133.tBELXVJD041194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 14 Dec 2015 21:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292225 - stable/10/usr.bin/bmake X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 21:33:32 -0000 Author: bdrewery Date: Mon Dec 14 21:33:31 2015 New Revision: 292225 URL: https://svnweb.freebsd.org/changeset/base/292225 Log: MFC r266566: Add .../share/mk to the default system make path. This will fix the problem with broken in-tree builds (which are used far more pervasively than I'd known outside the tree). However, weird results may now happen if at any point in the tree above you there happens to be a directory that has subdirectory of share/mk, as unpredictable results will follow. This was considered the lessor of the two evils, at least for now. In the future this will be removed again when the underlying issues are resolved. For MFCing, this is to ensure that when upgrading to head the share/mk in-tree is always used. Otherwise several build features will not work. This passes a build using head's bmake which has this as the default already. Relnotes: yes Modified: stable/10/usr.bin/bmake/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bmake/Makefile ============================================================================== --- stable/10/usr.bin/bmake/Makefile Mon Dec 14 21:30:28 2015 (r292224) +++ stable/10/usr.bin/bmake/Makefile Mon Dec 14 21:33:31 2015 (r292225) @@ -167,7 +167,6 @@ accept test: # override some simple things BINDIR= /usr/bin MANDIR= /usr/share/man/man -DEFAULT_SYS_PATH= /usr/share/mk # make sure we get this CFLAGS+= ${COPTS.${.IMPSRC:T}} From owner-svn-src-stable-10@freebsd.org Mon Dec 14 22:43:45 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 115F7A44B5F; Mon, 14 Dec 2015 22:43:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1C41183F; Mon, 14 Dec 2015 22:43:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEMhidV067126; Mon, 14 Dec 2015 22:43:44 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEMhip9067125; Mon, 14 Dec 2015 22:43:44 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512142243.tBEMhip9067125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 14 Dec 2015 22:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292231 - stable/10/usr.sbin/nfsuserd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 22:43:45 -0000 Author: rmacklem Date: Mon Dec 14 22:43:43 2015 New Revision: 292231 URL: https://svnweb.freebsd.org/changeset/base/292231 Log: MFC: r291534 Add support for the "-manage-gids" option to the nfsuserd daemon. When this option is set, the NFS server uses the list of groups acquired via getgrouplist(3) for the uid instead of the list of groups in the RPC request. This can be used to avoid the 16 gid limit for the group list in the RPC request. Relnotes: yes Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.c ============================================================================== --- stable/10/usr.sbin/nfsuserd/nfsuserd.c Mon Dec 14 22:42:05 2015 (r292230) +++ stable/10/usr.sbin/nfsuserd/nfsuserd.c Mon Dec 14 22:43:43 2015 (r292231) @@ -92,7 +92,7 @@ uid_t defaultuid = (uid_t)32767; u_char *defaultgroup = "nogroup"; gid_t defaultgid = (gid_t)32767; int verbose = 0, im_a_slave = 0, nfsuserdcnt = -1, forcestart = 0; -int defusertimeout = DEFUSERTIMEOUT; +int defusertimeout = DEFUSERTIMEOUT, manage_gids = 0; pid_t slaves[MAXNFSUSERD]; int @@ -110,6 +110,8 @@ main(int argc, char *argv[]) char hostname[MAXHOSTNAMELEN + 1], *cp; struct addrinfo *aip, hints; static uid_t check_dups[MAXUSERMAX]; + gid_t grps[NGROUPS]; + int ngroup; if (modfind("nfscommon") < 0) { /* Not present in kernel, try loading it */ @@ -160,6 +162,8 @@ main(int argc, char *argv[]) verbose = 1; } else if (!strcmp(*argv, "-force")) { forcestart = 1; + } else if (!strcmp(*argv, "-manage-gids")) { + manage_gids = 1; } else if (!strcmp(*argv, "-usermax")) { if (argc == 1) usage(); @@ -297,12 +301,14 @@ main(int argc, char *argv[]) nid.nid_gid = defaultgid; nid.nid_name = dnsname; nid.nid_namelen = strlen(nid.nid_name); + nid.nid_ngroup = 0; + nid.nid_grps = NULL; nid.nid_flag = NFSID_INITIALIZE; #ifdef DEBUG printf("Initialize uid=%d gid=%d dns=%s\n", nid.nid_uid, nid.nid_gid, nid.nid_name); #else - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) errx(1, "Can't initialize nfs user/groups"); #endif @@ -316,11 +322,13 @@ main(int argc, char *argv[]) nid.nid_gid = grp->gr_gid; nid.nid_name = grp->gr_name; nid.nid_namelen = strlen(grp->gr_name); + nid.nid_ngroup = 0; + nid.nid_grps = NULL; nid.nid_flag = NFSID_ADDGID; #ifdef DEBUG printf("add gid=%d name=%s\n", nid.nid_gid, nid.nid_name); #else - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) errx(1, "Can't add group %s", grp->gr_name); #endif @@ -352,11 +360,23 @@ main(int argc, char *argv[]) nid.nid_uid = pwd->pw_uid; nid.nid_name = pwd->pw_name; nid.nid_namelen = strlen(pwd->pw_name); + if (manage_gids != 0) { + /* Get the group list for this user. */ + ngroup = NGROUPS; + if (getgrouplist(pwd->pw_name, pwd->pw_gid, grps, + &ngroup) < 0) + syslog(LOG_ERR, "Group list too small"); + nid.nid_ngroup = ngroup; + nid.nid_grps = grps; + } else { + nid.nid_ngroup = 0; + nid.nid_grps = NULL; + } nid.nid_flag = NFSID_ADDUID; #ifdef DEBUG printf("add uid=%d name=%s\n", nid.nid_uid, nid.nid_name); #else - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) errx(1, "Can't add user %s", pwd->pw_name); #endif @@ -439,6 +459,8 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXP struct info info; struct nfsd_idargs nid; u_int32_t saddr; + gid_t grps[NGROUPS]; + int ngroup; /* * Only handle requests from 127.0.0.1 on a reserved port number. @@ -472,14 +494,28 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXP nid.nid_usertimeout = defusertimeout; nid.nid_uid = pwd->pw_uid; nid.nid_name = pwd->pw_name; + if (manage_gids != 0) { + /* Get the group list for this user. */ + ngroup = NGROUPS; + if (getgrouplist(pwd->pw_name, pwd->pw_gid, + grps, &ngroup) < 0) + syslog(LOG_ERR, "Group list too small"); + nid.nid_ngroup = ngroup; + nid.nid_grps = grps; + } else { + nid.nid_ngroup = 0; + nid.nid_grps = NULL; + } } else { nid.nid_usertimeout = 5; nid.nid_uid = (uid_t)info.id; nid.nid_name = defaultuser; + nid.nid_ngroup = 0; + nid.nid_grps = NULL; } nid.nid_namelen = strlen(nid.nid_name); nid.nid_flag = NFSID_ADDUID; - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) { info.retval = error; syslog(LOG_ERR, "Can't add user %s\n", pwd->pw_name); @@ -509,8 +545,10 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXP nid.nid_name = defaultgroup; } nid.nid_namelen = strlen(nid.nid_name); + nid.nid_ngroup = 0; + nid.nid_grps = NULL; nid.nid_flag = NFSID_ADDGID; - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) { info.retval = error; syslog(LOG_ERR, "Can't add group %s\n", @@ -541,8 +579,10 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXP nid.nid_name = info.name; } nid.nid_namelen = strlen(nid.nid_name); + nid.nid_ngroup = 0; + nid.nid_grps = NULL; nid.nid_flag = NFSID_ADDUSERNAME; - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) { info.retval = error; syslog(LOG_ERR, "Can't add user %s\n", pwd->pw_name); @@ -572,8 +612,10 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXP nid.nid_name = info.name; } nid.nid_namelen = strlen(nid.nid_name); + nid.nid_ngroup = 0; + nid.nid_grps = NULL; nid.nid_flag = NFSID_ADDGROUPNAME; - error = nfssvc(NFSSVC_IDNAME, &nid); + error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid); if (error) { info.retval = error; syslog(LOG_ERR, "Can't add group %s\n", @@ -679,5 +721,5 @@ usage(void) { errx(1, - "usage: nfsuserd [-usermax cache_size] [-usertimeout minutes] [-verbose] [-domain domain_name] [n]"); + "usage: nfsuserd [-usermax cache_size] [-usertimeout minutes] [-verbose] [-manage-gids] [-domain domain_name] [n]"); } From owner-svn-src-stable-10@freebsd.org Mon Dec 14 22:54:04 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5793AA47E36; Mon, 14 Dec 2015 22:54:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C9151F79; Mon, 14 Dec 2015 22:54:03 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEMs3US070934; Mon, 14 Dec 2015 22:54:03 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEMs3gm070933; Mon, 14 Dec 2015 22:54:03 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512142254.tBEMs3gm070933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 14 Dec 2015 22:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292232 - stable/10/usr.sbin/nfsuserd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 22:54:04 -0000 Author: rmacklem Date: Mon Dec 14 22:54:02 2015 New Revision: 292232 URL: https://svnweb.freebsd.org/changeset/base/292232 Log: MFC: r291535 Document the new "-manage-gids" option for the nfsuserd daemon. This is a content change. Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/nfsuserd/nfsuserd.8 ============================================================================== --- stable/10/usr.sbin/nfsuserd/nfsuserd.8 Mon Dec 14 22:43:43 2015 (r292231) +++ stable/10/usr.sbin/nfsuserd/nfsuserd.8 Mon Dec 14 22:54:02 2015 (r292232) @@ -24,14 +24,14 @@ .\" .\" $FreeBSD$ .\" -.Dd April 25, 2009 +.Dd November 1, 2015 .Dt NFSUSERD 8 .Os .Sh NAME .Nm nfsuserd .Nd load user and group information into the kernel for .Tn NFSv4 -services +services plus support manage-gids for all NFS versions .Sh SYNOPSIS .Nm nfsuserd .Op Fl domain Ar domain_name @@ -39,11 +39,14 @@ services .Op Fl usermax Ar max_cache_size .Op Fl verbose .Op Fl force +.Op Fl manage-gids .Op Ar num_servers .Sh DESCRIPTION .Nm loads user and group information into the kernel for NFSv4. It must be running for NFSv4 to function correctly, either client or server. +It also provides support for manage-gids and must be running on the server if +this is being used for any version of NFS. .Pp Upon startup, it loads the machines DNS domain name, plus timeout and cache size limit into the kernel. It then preloads the cache with group @@ -79,6 +82,15 @@ When set, the server logs a bunch of inf This flag option must be set to restart the daemon after it has gone away abnormally and refuses to start, because it thinks nfsuserd is already running. +.It Fl manage-gids +This flag enables manage-gids for the NFS server +.Xr nfsd 8 . +When this is enabled, all NFS requests using +AUTH_SYS authentication take the uid from the RPC request +and uses the group list for that uid provided by +.Xr getgrouplist 3 +on the server instead of the list of groups provided in the RPC authenticator. +This can be used to avoid the 16 group limit for AUTH_SYS. .It Ar num_servers Specifies how many servers to create (max 20). The default of 4 may be sufficient. You should run enough servers, so that @@ -89,8 +101,9 @@ performance impact, whereas running too such as a process table entry and swap space. .El .Sh SEE ALSO -.Xr getpwent 3 , .Xr getgrent 3 , +.Xr getgrouplist 3 , +.Xr getpwent 3 , .Xr nfsv4 4 , .Xr group 5 , .Xr passwd 5 , @@ -103,7 +116,8 @@ utility was introduced with the NFSv4 ex The .Nm use -.Xr getgrent 3 +.Xr getgrent 3 , +.Xr getgrouplist 3 and .Xr getpwent 3 library calls to resolve requests and will hang if the servers handling From owner-svn-src-stable-10@freebsd.org Mon Dec 14 23:09:04 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80CAEA438A2; Mon, 14 Dec 2015 23:09:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38A591A01; Mon, 14 Dec 2015 23:09:04 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEN93d3075448; Mon, 14 Dec 2015 23:09:03 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEN93cv075445; Mon, 14 Dec 2015 23:09:03 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512142309.tBEN93cv075445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 14 Dec 2015 23:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292233 - in stable/10/etc: defaults rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 23:09:04 -0000 Author: rmacklem Date: Mon Dec 14 23:09:02 2015 New Revision: 292233 URL: https://svnweb.freebsd.org/changeset/base/292233 Log: MFC: r291536 Add support for the new "-manage-gids" option for the nfsuserd daemon to the rc scripts. With these changes, setting nfs_server_managegids="YES" in /etc/rc.conf will enable this capability. Relnotes: yes Modified: stable/10/etc/defaults/rc.conf stable/10/etc/rc.d/nfsd stable/10/etc/rc.d/nfsuserd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Mon Dec 14 22:54:02 2015 (r292232) +++ stable/10/etc/defaults/rc.conf Mon Dec 14 23:09:02 2015 (r292233) @@ -330,6 +330,7 @@ nfs_access_cache="60" # Client cache ti nfs_server_enable="NO" # This host is an NFS server (or NO). oldnfs_server_enable="NO" # Run the old NFS server (YES/NO). nfs_server_flags="-u -t" # Flags to nfsd (if enabled). +nfs_server_managegids="NO" # The NFS server maps gids for AUTH_SYS (or NO). mountd_enable="NO" # Run mountd (or NO). mountd_flags="-r" # Flags to mountd (if NFS server enabled). weak_mountd_authentication="NO" # Allow non-root mount requests to be served. Modified: stable/10/etc/rc.d/nfsd ============================================================================== --- stable/10/etc/rc.d/nfsd Mon Dec 14 22:54:02 2015 (r292232) +++ stable/10/etc/rc.d/nfsd Mon Dec 14 23:09:02 2015 (r292233) @@ -46,9 +46,13 @@ nfsd_precmd() sysctl vfs.nfsd.nfs_privport=0 > /dev/null fi + if checkyesno nfsv4_server_enable || \ + checkyesno nfs_server_managegids; then + force_depend nfsuserd || err 1 "Cannot run nfsuserd" + fi + if checkyesno nfsv4_server_enable; then sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null - force_depend nfsuserd || err 1 "Cannot run nfsuserd" else echo 'NFSv4 is disabled' sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null Modified: stable/10/etc/rc.d/nfsuserd ============================================================================== --- stable/10/etc/rc.d/nfsuserd Mon Dec 14 22:54:02 2015 (r292232) +++ stable/10/etc/rc.d/nfsuserd Mon Dec 14 23:09:02 2015 (r292233) @@ -15,5 +15,14 @@ command="/usr/sbin/${name}" sig_stop="USR1" load_rc_config $name +start_precmd="nfsuserd_precmd" + +nfsuserd_precmd() +{ + if checkyesno nfs_server_managegids; then + rc_flags="-manage-gids ${nfsuserd_flags}" + fi + return 0 +} run_rc_command "$1" From owner-svn-src-stable-10@freebsd.org Mon Dec 14 23:35:23 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63426A449A8; Mon, 14 Dec 2015 23:35:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com [IPv6:2a00:1450:4010:c04::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 129FB1CFC; Mon, 14 Dec 2015 23:35:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by lbblt2 with SMTP id lt2so117788770lbb.3; Mon, 14 Dec 2015 15:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CaCaxWp5uTXfYmKkbkh9DrIOEbjXqzQDYVcgAIJPLqg=; b=EouaW6GPYHc71MHOUepcAlRO+fCQKeHO6EfsiYOeV4xndCLjlXDLGyfbw7J0/WtPBI AktIIJa3+IGb1DK9jAxHw4UGlaUxK+vpY5A/q9/FRf7rW+29iPIkdB94j29Kajh4sIu2 +Z/l2ZdpzuPmlbp5AABxlVNbh9XFkm/Z+AQ12TWM5OX60wwIRVm4UgljhKi6aoe6O8GS H422kMpdUjqZXW+LIwgCTXlNL07SWYpdGvrjMIq16uKV/xyzF39T6ZlFyjB+9So/xg6X VSHvlSSqpQ9k8uCGiG9/+1alEzvG1UrfZjwLUwfDMj8NiwIIPSe4GvzRG3eMMrr1XgXQ tHfg== MIME-Version: 1.0 X-Received: by 10.112.160.169 with SMTP id xl9mr14452760lbb.40.1450136120709; Mon, 14 Dec 2015 15:35:20 -0800 (PST) Received: by 10.112.219.9 with HTTP; Mon, 14 Dec 2015 15:35:20 -0800 (PST) In-Reply-To: <201512142133.tBELXVJD041194@repo.freebsd.org> References: <201512142133.tBELXVJD041194@repo.freebsd.org> Date: Mon, 14 Dec 2015 15:35:20 -0800 Message-ID: Subject: Re: svn commit: r292225 - stable/10/usr.bin/bmake From: NGie Cooper To: Bryan Drewery Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-10@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 23:35:23 -0000 On Mon, Dec 14, 2015 at 1:33 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Mon Dec 14 21:33:31 2015 > New Revision: 292225 > URL: https://svnweb.freebsd.org/changeset/base/292225 > > Log: > MFC r266566: > > Add .../share/mk to the default system make path. This will fix the problem > with broken in-tree builds (which are used far more pervasively than I'd > known outside the tree). However, weird results may now happen if at any > point in the tree above you there happens to be a directory that has > subdirectory of share/mk, as unpredictable results will follow. This was > considered the lessor of the two evils, at least for now. In the future this > will be removed again when the underlying issues are resolved. > > For MFCing, this is to ensure that when upgrading to head the share/mk > in-tree is always used. Otherwise several build features will not work. > This passes a build using head's bmake which has this as the default > already. > > Relnotes: yes THANK YOU!!!! From owner-svn-src-stable-10@freebsd.org Tue Dec 15 01:19:21 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7400FA44661; Tue, 15 Dec 2015 01:19:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 413931441; Tue, 15 Dec 2015 01:19:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF1JKbg023929; Tue, 15 Dec 2015 01:19:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF1JKNA023928; Tue, 15 Dec 2015 01:19:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512150119.tBF1JKNA023928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 01:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292239 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2015 01:19:21 -0000 Author: bdrewery Date: Tue Dec 15 01:19:19 2015 New Revision: 292239 URL: https://svnweb.freebsd.org/changeset/base/292239 Log: Add SRCTOP and RELDIR support. This is a direct commit to stable/10. It allows simpler MFCing from head where these are being used more frequently. Sponsored by: EMC / Isilon Storage Division Added: stable/10/share/mk/local.sys.mk (contents, props changed) Added: stable/10/share/mk/local.sys.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/mk/local.sys.mk Tue Dec 15 01:19:19 2015 (r292239) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.if defined(.PARSEDIR) +SRCTOP:= ${.PARSEDIR:tA:H:H} +.else +SRCTOP:= ${.MAKE.MAKEFILES:M*/local.sys.mk:H:H:H} +.endif + +.if ${.CURDIR} == ${SRCTOP} +RELDIR = . +.elif ${.CURDIR:M${SRCTOP}/*} +RELDIR := ${.CURDIR:S,${SRCTOP}/,,} +.endif From owner-svn-src-stable-10@freebsd.org Tue Dec 15 01:37:48 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EAD1A47EFE; Tue, 15 Dec 2015 01:37:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D616F2000; Tue, 15 Dec 2015 01:37:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF1blDU031296; Tue, 15 Dec 2015 01:37:47 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF1blJ3031295; Tue, 15 Dec 2015 01:37:47 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512150137.tBF1blJ3031295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Dec 2015 01:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292240 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2015 01:37:48 -0000 Author: bdrewery Date: Tue Dec 15 01:37:46 2015 New Revision: 292240 URL: https://svnweb.freebsd.org/changeset/base/292240 Log: Partial MFC r291349: Standardize on OBJTOP in and outside of META MODE. For stable/10 this means bringing OBJTOP support in which simplifies MFCs. Modified: stable/10/share/mk/bsd.obj.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.obj.mk ============================================================================== --- stable/10/share/mk/bsd.obj.mk Tue Dec 15 01:19:19 2015 (r292239) +++ stable/10/share/mk/bsd.obj.mk Tue Dec 15 01:37:46 2015 (r292240) @@ -46,10 +46,13 @@ ____: CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} .elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != "" CANONICALOBJDIR:=${MAKEOBJDIR} +OBJTOP?= ${MAKEOBJDIR} .else CANONICALOBJDIR:=/usr/obj${.CURDIR} .endif +OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP} + # # Warn of unorthodox object directory. # From owner-svn-src-stable-10@freebsd.org Tue Dec 15 01:43:07 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EBA3A4343D; Tue, 15 Dec 2015 01:43:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 722CF152E; Tue, 15 Dec 2015 01:43:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 6B13E13C0; Tue, 15 Dec 2015 01:43:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 23A5910D53; Tue, 15 Dec 2015 01:43:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id r_rrmJjh0Tqr; Tue, 15 Dec 2015 01:43:04 +0000 (UTC) Subject: Re: svn commit: r292225 - stable/10/usr.bin/bmake DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 4828810D4A To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201512142133.tBELXVJD041194@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <566F7024.3050800@FreeBSD.org> Date: Mon, 14 Dec 2015 17:43:00 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201512142133.tBELXVJD041194@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SVhmskkgiOXgTMp3ptP9J4TQW38pdcXRL" X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2015 01:43:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SVhmskkgiOXgTMp3ptP9J4TQW38pdcXRL Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/14/2015 1:33 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Mon Dec 14 21:33:31 2015 > New Revision: 292225 > URL: https://svnweb.freebsd.org/changeset/base/292225 >=20 > Log: > MFC r266566: > =20 > Add .../share/mk to the default system make path. This will fix the= problem > with broken in-tree builds (which are used far more pervasively tha= n I'd > known outside the tree). However, weird results may now happen if a= t any > point in the tree above you there happens to be a directory that ha= s > subdirectory of share/mk, as unpredictable results will follow. Thi= s was > considered the lessor of the two evils, at least for now. In the fu= ture this > will be removed again when the underlying issues are resolved. > =20 > For MFCing, this is to ensure that when upgrading to head the share= /mk > in-tree is always used. Otherwise several build features will not = work. > This passes a build using head's bmake which has this as the defaul= t > already. > =20 > Relnotes: yes >=20 > Modified: > stable/10/usr.bin/bmake/Makefile > Directory Properties: > stable/10/ (props changed) >=20 > Modified: stable/10/usr.bin/bmake/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/10/usr.bin/bmake/Makefile Mon Dec 14 21:30:28 2015 (r292224)= > +++ stable/10/usr.bin/bmake/Makefile Mon Dec 14 21:33:31 2015 (r292225)= > @@ -167,7 +167,6 @@ accept test: > # override some simple things > BINDIR=3D /usr/bin > MANDIR=3D /usr/share/man/man > -DEFAULT_SYS_PATH=3D /usr/share/mk > =20 > # make sure we get this > CFLAGS+=3D ${COPTS.${.IMPSRC:T}} >=20 It's possible r279247 is needed, but I have not run into a case where it is. For the intent of using in-tree share/mk fully for building head from stable/10, it will already have r279247. A problem might come from building stable/10 on stable/10 without r279247, but everything seems fine to me. --=20 Regards, Bryan Drewery --SVhmskkgiOXgTMp3ptP9J4TQW38pdcXRL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWb3AkAAoJEDXXcbtuRpfPHmEIAKaKpL4QxgHL5g8CMId6E8GJ Iuoprr8vhqoGDlJt6KBDmh8IHIrLimVSsiLOMf89dTaBVLqSt7w5U4Tx0p803iAB gHnqnteHsjxzSnkZWe/QEUqMcMPMh0RdqATrqjMFZbQLFQmNnzkR/cyy5YnFB+9D OZKx3c5Vlu10kQMsvW46VsQhG8zZ1WiQGHt4afKaeJjas2Q7iS5lVjYht0wYvdZK F27g2NWwyc0BOZhHYcwZzBUsk4+aexdkmJuLH4RgMCJp0MGGXubyX53T+yvJdE9c yAEhZQTeuPHWJelxSQgnjqIEnfW2FcLi0H0IjmCexqhcg1PRcuDB118+VQY1EDc= =dSvR -----END PGP SIGNATURE----- --SVhmskkgiOXgTMp3ptP9J4TQW38pdcXRL-- From owner-svn-src-stable-10@freebsd.org Tue Dec 15 05:47:06 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75D6DA446F1; Tue, 15 Dec 2015 05:47:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DFBB1604; Tue, 15 Dec 2015 05:47:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBF5l5U2007095; Tue, 15 Dec 2015 05:47:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBF5l5cB007094; Tue, 15 Dec 2015 05:47:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512150547.tBF5l5cB007094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 15 Dec 2015 05:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292251 - stable/10/tools/regression/mac/mac_portacl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2015 05:47:06 -0000 Author: ngie Date: Tue Dec 15 05:47:05 2015 New Revision: 292251 URL: https://svnweb.freebsd.org/changeset/base/292251 Log: MFC r291982: Skip the MAC portacl tests if MAC_PORTACL support is missing instead of marking them failed Sponsored by: EMC / Isilon Storage Division Modified: stable/10/tools/regression/mac/mac_portacl/misc.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/mac/mac_portacl/misc.sh ============================================================================== --- stable/10/tools/regression/mac/mac_portacl/misc.sh Tue Dec 15 05:37:09 2015 (r292250) +++ stable/10/tools/regression/mac/mac_portacl/misc.sh Tue Dec 15 05:47:05 2015 (r292251) @@ -3,8 +3,7 @@ sysctl security.mac.portacl >/dev/null 2>&1 if [ $? -ne 0 ]; then - echo "1..1" - echo "not ok 1 # MAC_PORTACL is unavailable." + echo "1..0 # SKIP MAC_PORTACL is unavailable." exit 0 fi From owner-svn-src-stable-10@freebsd.org Tue Dec 15 12:58:35 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37785A43619; Tue, 15 Dec 2015 12:58:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id EA2581E52; Tue, 15 Dec 2015 12:58:34 +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 tBFCwYrk032046; Tue, 15 Dec 2015 12:58:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFCwYUl032045; Tue, 15 Dec 2015 12:58:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512151258.tBFCwYUl032045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Dec 2015 12:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292261 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2015 12:58:35 -0000 Author: kib Date: Tue Dec 15 12:58:33 2015 New Revision: 292261 URL: https://svnweb.freebsd.org/changeset/base/292261 Log: MFC r291576: Handle invalid pages found during the sleepable collapse scan, do not free the shadow page swap space. Combine the sleep code. Modified: stable/10/sys/vm/vm_object.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_object.c ============================================================================== --- stable/10/sys/vm/vm_object.c Tue Dec 15 12:52:45 2015 (r292260) +++ stable/10/sys/vm/vm_object.c Tue Dec 15 12:58:33 2015 (r292261) @@ -1424,13 +1424,40 @@ retry: #define OBSC_COLLAPSE_NOWAIT 0x0002 #define OBSC_COLLAPSE_WAIT 0x0004 -static int +static vm_page_t +vm_object_backing_scan_wait(vm_object_t object, vm_page_t p, vm_page_t next, + int op) +{ + vm_object_t backing_object; + + VM_OBJECT_ASSERT_WLOCKED(object); + backing_object = object->backing_object; + VM_OBJECT_ASSERT_WLOCKED(backing_object); + + KASSERT(p == NULL || vm_page_busied(p), ("unbusy page %p", p)); + KASSERT(p == NULL || p->object == object || p->object == backing_object, + ("invalid ownership %p %p %p", p, object, backing_object)); + if ((op & OBSC_COLLAPSE_NOWAIT) != 0) + return (next); + if (p != NULL) + vm_page_lock(p); + VM_OBJECT_WUNLOCK(object); + VM_OBJECT_WUNLOCK(backing_object); + if (p == NULL) + VM_WAIT; + else + vm_page_busy_sleep(p, "vmocol"); + VM_OBJECT_WLOCK(object); + VM_OBJECT_WLOCK(backing_object); + return (TAILQ_FIRST(&backing_object->memq)); +} + +static bool vm_object_backing_scan(vm_object_t object, int op) { - int r = 1; - vm_page_t p; vm_object_t backing_object; - vm_pindex_t backing_offset_index; + vm_page_t next, p, pp; + vm_pindex_t backing_offset_index, new_pindex; VM_OBJECT_ASSERT_WLOCKED(object); VM_OBJECT_ASSERT_WLOCKED(object->backing_object); @@ -1452,7 +1479,7 @@ vm_object_backing_scan(vm_object_t objec * shadow test may succeed! XXX */ if (backing_object->type != OBJT_DEFAULT) { - return (0); + return (false); } } if (op & OBSC_COLLAPSE_WAIT) { @@ -1464,24 +1491,19 @@ vm_object_backing_scan(vm_object_t objec */ p = TAILQ_FIRST(&backing_object->memq); while (p) { - vm_page_t next = TAILQ_NEXT(p, listq); - vm_pindex_t new_pindex = p->pindex - backing_offset_index; - + next = TAILQ_NEXT(p, listq); + new_pindex = p->pindex - backing_offset_index; if (op & OBSC_TEST_ALL_SHADOWED) { - vm_page_t pp; - /* * Ignore pages outside the parent object's range * and outside the parent object's mapping of the * backing object. * - * note that we do not busy the backing object's + * Note that we do not busy the backing object's * page. */ - if ( - p->pindex < backing_offset_index || - new_pindex >= object->size - ) { + if (p->pindex < backing_offset_index || + new_pindex >= object->size) { p = next; continue; } @@ -1497,55 +1519,26 @@ vm_object_backing_scan(vm_object_t objec */ pp = vm_page_lookup(object, new_pindex); - if ( - (pp == NULL || pp->valid == 0) && - !vm_pager_has_page(object, new_pindex, NULL, NULL) - ) { - r = 0; - break; - } + if ((pp == NULL || pp->valid == 0) && + !vm_pager_has_page(object, new_pindex, NULL, NULL)) + return (false); } /* * Check for busy page */ if (op & (OBSC_COLLAPSE_WAIT | OBSC_COLLAPSE_NOWAIT)) { - vm_page_t pp; - - if (op & OBSC_COLLAPSE_NOWAIT) { - if (!p->valid || vm_page_busied(p)) { - p = next; - continue; - } - } else if (op & OBSC_COLLAPSE_WAIT) { - if (vm_page_busied(p)) { - VM_OBJECT_WUNLOCK(object); - vm_page_lock(p); - VM_OBJECT_WUNLOCK(backing_object); - vm_page_busy_sleep(p, "vmocol"); - VM_OBJECT_WLOCK(object); - VM_OBJECT_WLOCK(backing_object); - /* - * If we slept, anything could have - * happened. Since the object is - * marked dead, the backing offset - * should not have changed so we - * just restart our scan. - */ - p = TAILQ_FIRST(&backing_object->memq); - continue; - } + if (vm_page_busied(p)) { + p = vm_object_backing_scan_wait(object, p, + next, op); + continue; } - KASSERT( - p->object == backing_object, - ("vm_object_backing_scan: object mismatch") - ); - - if ( - p->pindex < backing_offset_index || - new_pindex >= object->size - ) { + KASSERT(p->object == backing_object, + ("vm_object_backing_scan: object mismatch")); + + if (p->pindex < backing_offset_index || + new_pindex >= object->size) { if (backing_object->type == OBJT_SWAP) swap_pager_freespace(backing_object, p->pindex, 1); @@ -1567,43 +1560,45 @@ vm_object_backing_scan(vm_object_t objec } pp = vm_page_lookup(object, new_pindex); - if ( - (op & OBSC_COLLAPSE_NOWAIT) != 0 && - (pp != NULL && pp->valid == 0) - ) { - if (backing_object->type == OBJT_SWAP) - swap_pager_freespace(backing_object, - p->pindex, 1); - + if (pp != NULL && vm_page_busied(pp)) { /* - * The page in the parent is not (yet) valid. - * We don't know anything about the state of - * the original page. It might be mapped, - * so we must avoid the next if here. + * The page in the parent is busy and + * possibly not (yet) valid. Until + * its state is finalized by the busy + * bit owner, we can't tell whether it + * shadows the original page. + * Therefore, we must either skip it + * and the original (backing_object) + * page or wait for its state to be + * finalized. * - * This is due to a race in vm_fault() where - * we must unbusy the original (backing_obj) - * page before we can (re)lock the parent. - * Hence we can get here. + * This is due to a race with vm_fault() + * where we must unbusy the original + * (backing_obj) page before we can + * (re)lock the parent. Hence we can + * get here. */ - p = next; + p = vm_object_backing_scan_wait(object, pp, + next, op); continue; } - if ( - pp != NULL || - vm_pager_has_page(object, new_pindex, NULL, NULL) - ) { - if (backing_object->type == OBJT_SWAP) - swap_pager_freespace(backing_object, - p->pindex, 1); + KASSERT(pp == NULL || pp->valid != 0, + ("unbusy invalid page %p", pp)); + + if (pp != NULL || vm_pager_has_page(object, + new_pindex, NULL, NULL)) { /* - * page already exists in parent OR swap exists - * for this location in the parent. Destroy - * the original page from the backing object. - * - * Leave the parent's page alone + * The page already exists in the + * parent OR swap exists for this + * location in the parent. Leave the + * parent's page alone. Destroy the + * original page from the backing + * object. */ + if (backing_object->type == OBJT_SWAP) + swap_pager_freespace(backing_object, + p->pindex, 1); vm_page_lock(p); KASSERT(!pmap_page_is_mapped(p), ("freeing mapped page %p", p)); @@ -1625,16 +1620,8 @@ vm_object_backing_scan(vm_object_t objec * vm_page_rename() will handle dirty and cache. */ if (vm_page_rename(p, object, new_pindex)) { - if (op & OBSC_COLLAPSE_NOWAIT) { - p = next; - continue; - } - VM_OBJECT_WUNLOCK(backing_object); - VM_OBJECT_WUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(object); - VM_OBJECT_WLOCK(backing_object); - p = TAILQ_FIRST(&backing_object->memq); + p = vm_object_backing_scan_wait(object, NULL, + next, op); continue; } @@ -1653,7 +1640,7 @@ vm_object_backing_scan(vm_object_t objec } p = next; } - return (r); + return (true); } @@ -1820,8 +1807,8 @@ vm_object_collapse(vm_object_t object) * there is nothing we can do so we give up. */ if (object->resident_page_count != object->size && - vm_object_backing_scan(object, - OBSC_TEST_ALL_SHADOWED) == 0) { + !vm_object_backing_scan(object, + OBSC_TEST_ALL_SHADOWED)) { VM_OBJECT_WUNLOCK(backing_object); break; } From owner-svn-src-stable-10@freebsd.org Tue Dec 15 17:58:11 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 902C8A48E58; Tue, 15 Dec 2015 17:58:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D3231848; Tue, 15 Dec 2015 17:58:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFHwA4j028560; Tue, 15 Dec 2015 17:58:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFHwAOc028557; Tue, 15 Dec 2015 17:58:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512151758.tBFHwAOc028557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 15 Dec 2015 17:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292278 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2015 17:58:11 -0000 Author: ngie Date: Tue Dec 15 17:58:10 2015 New Revision: 292278 URL: https://svnweb.freebsd.org/changeset/base/292278 Log: MFC r284408,r289151,r289158: r284408: Ensure TESTSDIR is defined before bsd.test.mk is .include'd r289151: Simplify netbsd-tests.test.mk - projects/bmake and subsequent commits provide SRCTOP; there's no need to manually specify it now. - Compute a sane default for OBJTOP based on .OBJDIR and RELDIR. Manually specifying this is probably no longer needed, but it persists just in case (supporting commits will need to be made to move it out of some of the meta .mk files). - Compute a sane default for TESTSRC. Error out if the path cannot be found. Sponsored by: EMC / Isilon Storage Division r289158: Default TESTSDIR to /usr/tests/${RELDIR:H} When run from bin/ls/tests, for example, the value of TESTSDIR would be ${TESTSBASE}/${RELDIR:H} -> /usr/tests/bin/ls/tests/.. -> /usr/tests/bin/ls Document the new behavior in bsd.README. While here, also document TESTSBASE Relnotes: yes Differential Revision: D1022 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/mk/bsd.README stable/10/share/mk/bsd.test.mk stable/10/share/mk/netbsd-tests.test.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.README ============================================================================== --- stable/10/share/mk/bsd.README Tue Dec 15 17:25:00 2015 (r292277) +++ stable/10/share/mk/bsd.README Tue Dec 15 17:58:10 2015 (r292278) @@ -425,10 +425,16 @@ It has seven targets: It sets/uses the following variables, among many others: -TESTDIR Path to the installed tests. Must be a subdirectory of +TESTSBASE Installation prefix for tests. Defaults to /usr/tests + +TESTSDIR Path to the installed tests. Must be a subdirectory of TESTSBASE and the subpath should match the relative location of the tests within the src tree. + The value of TESTSDIR defaults to + ${TESTSBASE}/${RELDIR:H} , e.g. /usr/tests/bin/ls when + included from bin/ls/tests . + KYUAFILE If 'auto' (the default), generate a Kyuafile out of the test programs defined in the Makefile. If 'yes', then a manually-crafted Kyuafile must be supplied with the Modified: stable/10/share/mk/bsd.test.mk ============================================================================== --- stable/10/share/mk/bsd.test.mk Tue Dec 15 17:25:00 2015 (r292277) +++ stable/10/share/mk/bsd.test.mk Tue Dec 15 17:58:10 2015 (r292278) @@ -10,6 +10,9 @@ ____: +# Tests install directory +TESTSDIR?= ${TESTSBASE}/${RELDIR:H} + # List of subdirectories containing tests into which to recurse. This has the # same semantics as SUBDIR at build-time. However, the directories listed here # get registered into the run-time test suite definitions so that the test Modified: stable/10/share/mk/netbsd-tests.test.mk ============================================================================== --- stable/10/share/mk/netbsd-tests.test.mk Tue Dec 15 17:25:00 2015 (r292277) +++ stable/10/share/mk/netbsd-tests.test.mk Tue Dec 15 17:58:10 2015 (r292278) @@ -3,16 +3,12 @@ .if !target(__netbsd_tests.test.mk__) __netbsd_tests.test.mk__: -.if !defined(OBJTOP) -.error "Please define OBJTOP to the absolute path of the top of the object tree" -.endif +OBJTOP?= ${.OBJDIR:S/${RELDIR}//} -.if !defined(SRCTOP) -.error "Please define SRCTOP to the absolute path of the top of the source tree" -.endif +TESTSRC?= ${SRCTOP}/contrib/netbsd-tests/${RELDIR:H} -.if !defined(TESTSRC) -.error "Please define TESTSRC to the absolute path of the test sources, e.g. contrib/netbsd-tests/lib/libc/stdio" +.if !exists(${TESTSRC}/) +.error "Please define TESTSRC to the absolute path of the test sources, e.g. $${SRCTOP}/contrib/netbsd-tests/lib/libc/stdio" .endif .PATH: ${TESTSRC} From owner-svn-src-stable-10@freebsd.org Tue Dec 15 18:01:06 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0202A431C9; Tue, 15 Dec 2015 18:01:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 746371C3E; Tue, 15 Dec 2015 18:01:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFI15CI031187; Tue, 15 Dec 2015 18:01:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFI15Ab031184; Tue, 15 Dec 2015 18:01:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512151801.tBFI15Ab031184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 15 Dec 2015 18:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292280 - in stable/10: tools/build/mk tools/build/options usr.sbin X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2015 18:01:06 -0000 Author: ngie Date: Tue Dec 15 18:01:05 2015 New Revision: 292280 URL: https://svnweb.freebsd.org/changeset/base/292280 Log: MFC r271401: r271401 (by asomers): Conditionalize build of etcupdate(8) on MK_RCS. Since etcupdate calls merge(1), which is part of the RCS package, it must not be installed if WITHOUT_RCS update is set. Otherwise, it will produce confusing errors. CR: https://reviews.freebsd.org/D691 Sponsored by: Spectra Logic Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/tools/build/options/WITHOUT_RCS stable/10/usr.sbin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Dec 15 17:59:13 2015 (r292279) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Dec 15 18:01:05 2015 (r292280) @@ -4081,6 +4081,7 @@ OLD_FILES+=usr/bin/rcsdiff OLD_FILES+=usr/bin/rcsfreeze OLD_FILES+=usr/bin/rcsmerge OLD_FILES+=usr/bin/rlog +OLD_FILES+=usr/sbin/etcupdate OLD_FILES+=usr/share/man/man1/ci.1.gz OLD_FILES+=usr/share/man/man1/co.1.gz OLD_FILES+=usr/share/man/man1/ident.1.gz @@ -4093,6 +4094,7 @@ OLD_FILES+=usr/share/man/man1/rcsintro.1 OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz OLD_FILES+=usr/share/man/man1/rlog.1.gz OLD_FILES+=usr/share/man/man5/rcsfile.5.gz +OLD_FILES+=usr/share/man/man8/etcupdate.8.gz .endif #.if ${MK_RESCUE} == no Modified: stable/10/tools/build/options/WITHOUT_RCS ============================================================================== --- stable/10/tools/build/options/WITHOUT_RCS Tue Dec 15 17:59:13 2015 (r292279) +++ stable/10/tools/build/options/WITHOUT_RCS Tue Dec 15 18:01:05 2015 (r292280) @@ -1,4 +1,6 @@ .\" $FreeBSD$ Set to not build .Xr rcs 1 -and related utilities. +, +.Xr etcupdate 8 +, and related utilities. Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Tue Dec 15 17:59:13 2015 (r292279) +++ stable/10/usr.sbin/Makefile Tue Dec 15 18:01:05 2015 (r292280) @@ -23,7 +23,6 @@ SUBDIR= adduser \ digictl \ diskinfo \ dumpcis \ - etcupdate \ extattr \ extattrctl \ fifolog \ @@ -302,6 +301,10 @@ SUBDIR+= repquota SUBDIR+= rwhod .endif +.if ${MK_RCS} != "no" +SUBDIR+= etcupdate +.endif + .if ${MK_SENDMAIL} != "no" SUBDIR+= editmap SUBDIR+= mailstats From owner-svn-src-stable-10@freebsd.org Tue Dec 15 18:09:05 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92D2FA437C2; Tue, 15 Dec 2015 18:09:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45643138F; Tue, 15 Dec 2015 18:09:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFI94bB033173; Tue, 15 Dec 2015 18:09:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFI94nw033170; Tue, 15 Dec 2015 18:09:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512151809.tBFI94nw033170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 15 Dec 2015 18:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292282 - in stable/10: bin/cat bin/cat/tests etc/mtree X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2015 18:09:05 -0000 Author: ngie Date: Tue Dec 15 18:09:03 2015 New Revision: 292282 URL: https://svnweb.freebsd.org/changeset/base/292282 Log: MFC r276669,r276723: r276669: Integrate bin/cat/tests from NetBSD into atf/kyua Sponsored by: EMC / Isilon Storage Division r276723: Install d_align.{in,out} for the :align test Pointyhat to: me Added: stable/10/bin/cat/tests/ - copied from r276669, head/bin/cat/tests/ Modified: stable/10/bin/cat/Makefile stable/10/bin/cat/tests/Makefile stable/10/etc/mtree/BSD.tests.dist Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/cat/Makefile ============================================================================== --- stable/10/bin/cat/Makefile Tue Dec 15 18:02:56 2015 (r292281) +++ stable/10/bin/cat/Makefile Tue Dec 15 18:09:03 2015 (r292282) @@ -1,6 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= cat +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/bin/cat/tests/Makefile ============================================================================== --- head/bin/cat/tests/Makefile Sun Jan 4 22:37:44 2015 (r276669) +++ stable/10/bin/cat/tests/Makefile Tue Dec 15 18:09:03 2015 (r292282) @@ -8,6 +8,11 @@ TESTSDIR= ${TESTSBASE}/bin/cat NETBSD_ATF_TESTS_SH= cat_test +FILESDIR= ${TESTSDIR} + +FILES= d_align.in +FILES+= d_align.out + .include .include Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Dec 15 18:02:56 2015 (r292281) +++ stable/10/etc/mtree/BSD.tests.dist Tue Dec 15 18:09:03 2015 (r292282) @@ -6,6 +6,8 @@ /set type=dir uname=root gname=wheel mode=0755 . bin + cat + .. chown .. date From owner-svn-src-stable-10@freebsd.org Tue Dec 15 21:02:55 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42033A48C97; Tue, 15 Dec 2015 21:02:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10EB01AAE; Tue, 15 Dec 2015 21:02:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBFL2sF8087469; Tue, 15 Dec 2015 21:02:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBFL2s4g087468; Tue, 15 Dec 2015 21:02:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201512152102.tBFL2s4g087468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 15 Dec 2015 21:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292288 - stable/10/sbin/pfctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2015 21:02:55 -0000 Author: kp Date: Tue Dec 15 21:02:53 2015 New Revision: 292288 URL: https://svnweb.freebsd.org/changeset/base/292288 Log: MFC r290236 pfctl: Fix uninitialised veriable In pfctl_set_debug() we used 'level' without ever initialising it. We correctly parsed the option, but them failed to actually assign the parsed value to 'level' before performing to ioctl() to configure the debug level. PR: 202996 Submitted by: Andrej Kolontai Modified: stable/10/sbin/pfctl/pfctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/pfctl/pfctl.c ============================================================================== --- stable/10/sbin/pfctl/pfctl.c Tue Dec 15 19:57:56 2015 (r292287) +++ stable/10/sbin/pfctl/pfctl.c Tue Dec 15 21:02:53 2015 (r292288) @@ -1845,6 +1845,7 @@ pfctl_set_debug(struct pfctl *pf, char * } pf->debug_set = 1; + level = pf->debug; if ((pf->opts & PF_OPT_NOACTION) == 0) if (ioctl(dev, DIOCSETDEBUG, &level)) From owner-svn-src-stable-10@freebsd.org Wed Dec 16 00:52:37 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0A5CA483C2; Wed, 16 Dec 2015 00:52:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B97CF1A1C; Wed, 16 Dec 2015 00:52:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG0qZVg066256; Wed, 16 Dec 2015 00:52:35 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG0qZjv066253; Wed, 16 Dec 2015 00:52:35 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201512160052.tBG0qZjv066253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 16 Dec 2015 00:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292307 - stable/10/sys/fs/nfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 00:52:37 -0000 Author: rmacklem Date: Wed Dec 16 00:52:35 2015 New Revision: 292307 URL: https://svnweb.freebsd.org/changeset/base/292307 Log: MFC: r291638 Fix the memory leak that occurs when the nfscommon.ko module is unloaded. This leak was introduced by r291527 (r292223 in stable/10). Since the nfscommon.ko module is rarely unloaded, this leak would not have been much of an issue. Modified: stable/10/sys/fs/nfs/nfs_commonport.c stable/10/sys/fs/nfs/nfs_commonsubs.c stable/10/sys/fs/nfs/nfs_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonport.c Wed Dec 16 00:22:58 2015 (r292306) +++ stable/10/sys/fs/nfs/nfs_commonport.c Wed Dec 16 00:52:35 2015 (r292307) @@ -624,6 +624,8 @@ nfscommon_modevent(module_t mod, int typ nfsd_call_nfscommon = NULL; callout_drain(&newnfsd_callout); + /* Clean out the name<-->id cache. */ + nfsrv_cleanusergroup(); /* and get rid of the mutexes */ mtx_destroy(&nfs_nameid_mutex); mtx_destroy(&newnfsd_mtx); Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Wed Dec 16 00:22:58 2015 (r292306) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Wed Dec 16 00:52:35 2015 (r292307) @@ -3539,6 +3539,55 @@ nfsrv_removeuser(struct nfsusrgrp *usrp, } /* + * Free up all the allocations related to the name<-->id cache. + * This function should only be called when the nfsuserd daemon isn't + * running, since it doesn't do any locking. + * This function is meant to be used when the nfscommon module is unloaded. + */ +APPLESTATIC void +nfsrv_cleanusergroup(void) +{ + struct nfsrv_lughash *hp, *hp2; + struct nfsusrgrp *nusrp, *usrp; + int i; + + if (nfsuserhash == NULL) + return; + + for (i = 0; i < nfsrv_lughashsize; i++) { + hp = &nfsuserhash[i]; + TAILQ_FOREACH_SAFE(usrp, &hp->lughead, lug_numhash, nusrp) { + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + hp2 = NFSUSERNAMEHASH(usrp->lug_name, + usrp->lug_namelen); + TAILQ_REMOVE(&hp2->lughead, usrp, lug_namehash); + if (usrp->lug_cred != NULL) + crfree(usrp->lug_cred); + free(usrp, M_NFSUSERGROUP); + } + hp = &nfsgrouphash[i]; + TAILQ_FOREACH_SAFE(usrp, &hp->lughead, lug_numhash, nusrp) { + TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash); + hp2 = NFSGROUPNAMEHASH(usrp->lug_name, + usrp->lug_namelen); + TAILQ_REMOVE(&hp2->lughead, usrp, lug_namehash); + if (usrp->lug_cred != NULL) + crfree(usrp->lug_cred); + free(usrp, M_NFSUSERGROUP); + } + mtx_destroy(&nfsuserhash[i].mtx); + mtx_destroy(&nfsusernamehash[i].mtx); + mtx_destroy(&nfsgroupnamehash[i].mtx); + mtx_destroy(&nfsgrouphash[i].mtx); + } + free(nfsuserhash, M_NFSUSERGROUP); + free(nfsusernamehash, M_NFSUSERGROUP); + free(nfsgrouphash, M_NFSUSERGROUP); + free(nfsgroupnamehash, M_NFSUSERGROUP); + free(nfsrv_dnsname, M_NFSSTRING); +} + +/* * This function scans a byte string and checks for UTF-8 compliance. * It returns 0 if it conforms and NFSERR_INVAL if not. */ Modified: stable/10/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/10/sys/fs/nfs/nfs_var.h Wed Dec 16 00:22:58 2015 (r292306) +++ stable/10/sys/fs/nfs/nfs_var.h Wed Dec 16 00:52:35 2015 (r292307) @@ -283,6 +283,7 @@ void nfsv4_getref(struct nfsv4lock *, in int nfsv4_getref_nonblock(struct nfsv4lock *); int nfsv4_testlock(struct nfsv4lock *); int nfsrv_mtostr(struct nfsrv_descript *, char *, int); +void nfsrv_cleanusergroup(void); int nfsrv_checkutf8(u_int8_t *, int); int newnfs_sndlock(int *); void newnfs_sndunlock(int *); From owner-svn-src-stable-10@freebsd.org Wed Dec 16 00:56:39 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71991A485D8; Wed, 16 Dec 2015 00:56:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45D371CE3; Wed, 16 Dec 2015 00:56:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG0ucNp067116; Wed, 16 Dec 2015 00:56:38 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG0ucQb067115; Wed, 16 Dec 2015 00:56:38 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201512160056.tBG0ucQb067115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 16 Dec 2015 00:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292308 - stable/10/sys/sparc64/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 00:56:39 -0000 Author: marius Date: Wed Dec 16 00:56:38 2015 New Revision: 292308 URL: https://svnweb.freebsd.org/changeset/base/292308 Log: MFC: r257066 (partial) Mark unused parameters of bus_space_subregion(9) as such. Modified: stable/10/sys/sparc64/include/bus.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sparc64/include/bus.h ============================================================================== --- stable/10/sys/sparc64/include/bus.h Wed Dec 16 00:52:35 2015 (r292307) +++ stable/10/sys/sparc64/include/bus.h Wed Dec 16 00:56:38 2015 (r292308) @@ -146,8 +146,8 @@ bus_space_barrier(bus_space_tag_t t, bus } static __inline int -bus_space_subregion(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - bus_size_t s, bus_space_handle_t *hp) +bus_space_subregion(bus_space_tag_t t __unused, bus_space_handle_t h, + bus_size_t o __unused, bus_size_t s __unused, bus_space_handle_t *hp) { *hp = h + o; From owner-svn-src-stable-10@freebsd.org Wed Dec 16 02:43:36 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C0CDA498E0; Wed, 16 Dec 2015 02:43:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09D1F18A3; Wed, 16 Dec 2015 02:43:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG2hZ5G011934; Wed, 16 Dec 2015 02:43:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG2hZ79011933; Wed, 16 Dec 2015 02:43:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512160243.tBG2hZ79011933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 16 Dec 2015 02:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292311 - stable/10/sbin/swapon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 02:43:36 -0000 Author: ngie Date: Wed Dec 16 02:43:34 2015 New Revision: 292311 URL: https://svnweb.freebsd.org/changeset/base/292311 Log: MFC r292005: Call va_end on ap when vsnprintf fails in run_cmd(..) to clean up the variable state Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division Modified: stable/10/sbin/swapon/swapon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/swapon/swapon.c ============================================================================== --- stable/10/sbin/swapon/swapon.c Wed Dec 16 01:05:50 2015 (r292310) +++ stable/10/sbin/swapon/swapon.c Wed Dec 16 02:43:34 2015 (r292311) @@ -640,6 +640,7 @@ run_cmd(int *ofd, const char *cmdline, . rv = vasprintf(&cmd, cmdline, ap); if (rv == -1) { warn("%s", __func__); + va_end(ap); return (rv); } va_end(ap); From owner-svn-src-stable-10@freebsd.org Wed Dec 16 13:56:35 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64B7FA49C7C; Wed, 16 Dec 2015 13:56:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1297C1D66; Wed, 16 Dec 2015 13:56:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG82MuL029026; Wed, 16 Dec 2015 08:02:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG82L06029023; Wed, 16 Dec 2015 08:02:21 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201512160802.tBG82L06029023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 16 Dec 2015 08:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292322 - in stable/10: share/man/man4 sys/dev/arcmsr X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 13:56:35 -0000 Author: delphij Date: Wed Dec 16 08:02:21 2015 New Revision: 292322 URL: https://svnweb.freebsd.org/changeset/base/292322 Log: MFC r259564,259565,291641: Update arcmsr(4) to 1.30.00.00 in order to add support of ARC-1203 SATA RAID controllers. Many thanks to Areca for continuing to support FreeBSD. Modified: stable/10/share/man/man4/arcmsr.4 stable/10/sys/dev/arcmsr/arcmsr.c stable/10/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/arcmsr.4 ============================================================================== --- stable/10/share/man/man4/arcmsr.4 Wed Dec 16 06:21:26 2015 (r292321) +++ stable/10/share/man/man4/arcmsr.4 Wed Dec 16 08:02:21 2015 (r292322) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 27, 2013 +.Dd December 18, 2013 .Dt ARCMSR 4 .Os .Sh NAME @@ -143,6 +143,8 @@ ARC-1681 ARC-1880 .It ARC-1882 +.It +ARC-1883 .El .Sh FILES .Bl -tag -width ".Pa /dev/arcmsr?" -compact Modified: stable/10/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/10/sys/dev/arcmsr/arcmsr.c Wed Dec 16 06:21:26 2015 (r292321) +++ stable/10/sys/dev/arcmsr/arcmsr.c Wed Dec 16 08:02:21 2015 (r292322) @@ -75,6 +75,8 @@ ** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224,1264,1284 ** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4 ** 1.20.00.28 09/13/2013 Ching Huang Removed recursive mutex in arcmsr_abort_dr_ccbs +** 1.20.00.29 12/18/2013 Ching Huang Change simq allocation number, support ARC1883 +** 1.30.00.00 11/30/2015 Ching Huang Added support ARC1203 ****************************************************************************************** */ @@ -125,15 +127,15 @@ __FBSDID("$FreeBSD$"); ************************************************************************** */ #if __FreeBSD_version >= 500005 - #include - #include - #include - #include - #include + #include + #include + #include + #include + #include #else - #include - #include - #include + #include + #include + #include #endif #if !defined(CAM_NEW_TRAN_CODE) && __FreeBSD_version >= 700025 @@ -146,7 +148,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.20.00.28 2013-09-13" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.30.00.00 2015-11-30" #include /* ************************************************************************** @@ -180,8 +182,8 @@ static int arcmsr_iop_message_xfer(struc static int arcmsr_resume(device_t dev); static int arcmsr_suspend(device_t dev); static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb); -static void arcmsr_polling_devmap(void *arg); -static void arcmsr_srb_timeout(void *arg); +static void arcmsr_polling_devmap(void *arg); +static void arcmsr_srb_timeout(void *arg); static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb); #ifdef ARCMSR_DEBUG1 static void arcmsr_dump_data(struct AdapterControlBlock *acb); @@ -219,11 +221,11 @@ static device_method_t arcmsr_methods[]= { 0, 0 } #endif }; - + static driver_t arcmsr_driver={ "arcmsr", arcmsr_methods, sizeof(struct AdapterControlBlock) }; - + static devclass_t arcmsr_devclass; DRIVER_MODULE(arcmsr, pci, arcmsr_driver, arcmsr_devclass, 0, 0); MODULE_DEPEND(arcmsr, pci, 1, 1, 1); @@ -246,38 +248,38 @@ static struct cdevsw arcmsr_cdevsw={ }; #else #define ARCMSR_CDEV_MAJOR 180 - + static struct cdevsw arcmsr_cdevsw = { - arcmsr_open, /* open */ - arcmsr_close, /* close */ - noread, /* read */ - nowrite, /* write */ - arcmsr_ioctl, /* ioctl */ - nopoll, /* poll */ - nommap, /* mmap */ - nostrategy, /* strategy */ - "arcmsr", /* name */ - ARCMSR_CDEV_MAJOR, /* major */ - nodump, /* dump */ - nopsize, /* psize */ - 0 /* flags */ + arcmsr_open, /* open */ + arcmsr_close, /* close */ + noread, /* read */ + nowrite, /* write */ + arcmsr_ioctl, /* ioctl */ + nopoll, /* poll */ + nommap, /* mmap */ + nostrategy, /* strategy */ + "arcmsr", /* name */ + ARCMSR_CDEV_MAJOR, /* major */ + nodump, /* dump */ + nopsize, /* psize */ + 0 /* flags */ }; #endif /* ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 +#if __FreeBSD_version < 500005 static int arcmsr_open(dev_t dev, int flags, int fmt, struct proc *proc) #else - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 static int arcmsr_open(dev_t dev, int flags, int fmt, struct thread *proc) #else static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc) #endif #endif { - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 struct AdapterControlBlock *acb = dev->si_drv1; #else int unit = dev2unit(dev); @@ -292,17 +294,17 @@ static struct cdevsw arcmsr_cdevsw = { ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 +#if __FreeBSD_version < 500005 static int arcmsr_close(dev_t dev, int flags, int fmt, struct proc *proc) #else - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 static int arcmsr_close(dev_t dev, int flags, int fmt, struct thread *proc) #else static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc) #endif #endif { - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 struct AdapterControlBlock *acb = dev->si_drv1; #else int unit = dev2unit(dev); @@ -317,17 +319,17 @@ static struct cdevsw arcmsr_cdevsw = { ************************************************************************** ************************************************************************** */ -#if __FreeBSD_version < 500005 +#if __FreeBSD_version < 500005 static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct proc *proc) #else - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) #else static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) #endif #endif { - #if __FreeBSD_version < 503000 + #if __FreeBSD_version < 503000 struct AdapterControlBlock *acb = dev->si_drv1; #else int unit = dev2unit(dev); @@ -346,7 +348,7 @@ static struct cdevsw arcmsr_cdevsw = { static u_int32_t arcmsr_disable_allintr( struct AdapterControlBlock *acb) { u_int32_t intmask_org = 0; - + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { /* disable all outbound interrupt */ @@ -355,10 +357,11 @@ static u_int32_t arcmsr_disable_allintr( } break; case ACB_ADAPTER_TYPE_B: { + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; /* disable all outbound interrupt */ - intmask_org = CHIP_REG_READ32(HBB_DOORBELL, - 0, iop2drv_doorbell_mask) & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, 0); /* disable all interrupt */ + intmask_org = READ_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask) + & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */ + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask, 0); /* disable all interrupt */ } break; case ACB_ADAPTER_TYPE_C: { @@ -383,7 +386,7 @@ static u_int32_t arcmsr_disable_allintr( static void arcmsr_enable_allintr( struct AdapterControlBlock *acb, u_int32_t intmask_org) { u_int32_t mask; - + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { /* enable outbound Post Queue, outbound doorbell Interrupt */ @@ -393,9 +396,10 @@ static void arcmsr_enable_allintr( struc } break; case ACB_ADAPTER_TYPE_B: { + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; /* enable ARCMSR_IOP2DRV_MESSAGE_CMD_DONE */ mask = (ARCMSR_IOP2DRV_DATA_WRITE_OK|ARCMSR_IOP2DRV_DATA_READ_OK|ARCMSR_IOP2DRV_CDB_DONE|ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); - CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, intmask_org | mask); /*1=interrupt enable, 0=interrupt disable*/ + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask, intmask_org | mask); /*1=interrupt enable, 0=interrupt disable*/ acb->outbound_int_enable = (intmask_org | mask) & 0x0000000f; } break; @@ -424,7 +428,7 @@ static u_int8_t arcmsr_hba_wait_msgint_r { u_int32_t Index; u_int8_t Retries = 0x00; - + do { for(Index=0; Index < 100; Index++) { if(CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { @@ -444,12 +448,13 @@ static u_int8_t arcmsr_hbb_wait_msgint_r { u_int32_t Index; u_int8_t Retries = 0x00; - + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; + do { for(Index=0; Index < 100; Index++) { - if(CHIP_REG_READ32(HBB_DOORBELL, 0, iop2drv_doorbell) & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) { - CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt*/ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT); + if(READ_CHIP_REG32(0, phbbmu->iop2drv_doorbell) & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) { + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt*/ + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT); return TRUE; } UDELAY(10000); @@ -465,7 +470,7 @@ static u_int8_t arcmsr_hbc_wait_msgint_r { u_int32_t Index; u_int8_t Retries = 0x00; - + do { for(Index=0; Index < 100; Index++) { if(CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { @@ -485,7 +490,7 @@ static u_int8_t arcmsr_hbd_wait_msgint_r { u_int32_t Index; u_int8_t Retries = 0x00; - + do { for(Index=0; Index < 100; Index++) { if(CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE) { @@ -504,7 +509,7 @@ static u_int8_t arcmsr_hbd_wait_msgint_r static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb) { int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ - + CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); do { if(arcmsr_hba_wait_msgint_ready(acb)) { @@ -521,9 +526,9 @@ static void arcmsr_flush_hba_cache(struc static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb) { int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ - - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, drv2iop_doorbell, ARCMSR_MESSAGE_FLUSH_CACHE); + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; + + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_FLUSH_CACHE); do { if(arcmsr_hbb_wait_msgint_ready(acb)) { break; @@ -539,7 +544,7 @@ static void arcmsr_flush_hbb_cache(struc static void arcmsr_flush_hbc_cache(struct AdapterControlBlock *acb) { int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ - + CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE); do { @@ -557,7 +562,7 @@ static void arcmsr_flush_hbc_cache(struc static void arcmsr_flush_hbd_cache(struct AdapterControlBlock *acb) { int retry_count = 30; /* enlarge wait flush adapter cache time: 10 minute */ - + CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE); do { if(arcmsr_hbd_wait_msgint_ready(acb)) { @@ -599,7 +604,7 @@ static void arcmsr_flush_adapter_cache(s static int arcmsr_suspend(device_t dev) { struct AdapterControlBlock *acb = device_get_softc(dev); - + /* flush controller */ arcmsr_iop_parking(acb); /* disable all outbound interrupt */ @@ -613,7 +618,7 @@ static int arcmsr_suspend(device_t dev) static int arcmsr_resume(device_t dev) { struct AdapterControlBlock *acb = device_get_softc(dev); - + arcmsr_iop_init(acb); return(0); } @@ -626,7 +631,7 @@ static void arcmsr_async(void *cb_arg, u struct AdapterControlBlock *acb; u_int8_t target_id, target_lun; struct cam_sim *sim; - + sim = (struct cam_sim *) cb_arg; acb =(struct AdapterControlBlock *) cam_sim_softc(sim); switch (code) { @@ -649,7 +654,7 @@ static void arcmsr_async(void *cb_arg, u static void arcmsr_report_sense_info(struct CommandControlBlock *srb) { union ccb *pccb = srb->pccb; - + pccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; pccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; if(pccb->csio.sense_len) { @@ -677,7 +682,8 @@ static void arcmsr_abort_hba_allcmd(stru */ static void arcmsr_abort_hbb_allcmd(struct AdapterControlBlock *acb) { - CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_MESSAGE_ABORT_CMD); + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_ABORT_CMD); if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit); } @@ -738,12 +744,12 @@ static void arcmsr_srb_complete(struct C { struct AdapterControlBlock *acb = srb->acb; union ccb *pccb = srb->pccb; - + if(srb->srb_flags & SRB_FLAG_TIMER_START) callout_stop(&srb->ccb_callout); if((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { bus_dmasync_op_t op; - + if((pccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { op = BUS_DMASYNC_POSTREAD; } else { @@ -772,7 +778,7 @@ static void arcmsr_srb_complete(struct C static void arcmsr_report_srb_state(struct AdapterControlBlock *acb, struct CommandControlBlock *srb, u_int16_t error) { int target, lun; - + target = srb->pccb->ccb_h.target_id; lun = srb->pccb->ccb_h.target_lun; if(error == FALSE) { @@ -823,7 +829,7 @@ static void arcmsr_report_srb_state(stru static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, u_int32_t flag_srb, u_int16_t error) { struct CommandControlBlock *srb; - + /* check if command done with no error*/ switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_C: @@ -859,7 +865,7 @@ static void arcmsr_srb_timeout(void *arg struct AdapterControlBlock *acb; int target, lun; u_int8_t cmd; - + target = srb->pccb->ccb_h.target_id; lun = srb->pccb->ccb_h.target_lun; acb = srb->acb; @@ -875,7 +881,7 @@ static void arcmsr_srb_timeout(void *arg } ARCMSR_LOCK_RELEASE(&acb->isr_lock); #ifdef ARCMSR_DEBUG1 - arcmsr_dump_data(acb); + arcmsr_dump_data(acb); #endif } @@ -888,29 +894,29 @@ static void arcmsr_done4abort_postqueue( int i=0; u_int32_t flag_srb; u_int16_t error; - + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { u_int32_t outbound_intstatus; - + /*clear and abort all outbound posted Q*/ outbound_intstatus = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable; CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intstatus);/*clear interrupt*/ while(((flag_srb=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_queueport)) != 0xFFFFFFFF) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } } break; case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu=(struct HBB_MessageUnit *)acb->pmu; - + /*clear all outbound posted Q*/ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_DOORBELL_INT_CLEAR_PATTERN); /* clear doorbell interrupt */ + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_DOORBELL_INT_CLEAR_PATTERN); /* clear doorbell interrupt */ for(i=0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) { if((flag_srb = phbbmu->done_qbuffer[i]) != 0) { phbbmu->done_qbuffer[i] = 0; - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } phbbmu->post_qbuffer[i] = 0; @@ -920,10 +926,10 @@ static void arcmsr_done4abort_postqueue( } break; case ACB_ADAPTER_TYPE_C: { - + while((CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low); - error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; + error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); } } @@ -943,7 +949,7 @@ static void arcmsr_iop_reset(struct Adap struct CommandControlBlock *srb; u_int32_t intmask_org; u_int32_t i=0; - + if(acb->srboutstandingcount>0) { /* disable all outbound interrupt */ intmask_org = arcmsr_disable_allintr(acb); @@ -984,7 +990,7 @@ static void arcmsr_build_srb(struct Comm union ccb *pccb = srb->pccb; struct ccb_scsiio *pcsio = &pccb->csio; u_int32_t arccdbsize = 0x30; - + memset(arcmsr_cdb, 0, sizeof(struct ARCMSR_CDB)); arcmsr_cdb->Bus = 0; arcmsr_cdb->TargetID = pccb->ccb_h.target_id; @@ -996,7 +1002,7 @@ static void arcmsr_build_srb(struct Comm struct AdapterControlBlock *acb = srb->acb; bus_dmasync_op_t op; u_int32_t length, i, cdb_sgcount = 0; - + if((pccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { op = BUS_DMASYNC_PREREAD; } else { @@ -1018,11 +1024,11 @@ static void arcmsr_build_srb(struct Comm arccdbsize += sizeof(struct SG32ENTRY); } else { u_int32_t sg64s_size = 0, tmplength = length; - + while(1) { u_int64_t span4G, length0; struct SG64ENTRY *pdma_sg = (struct SG64ENTRY *)psge; - + span4G = (u_int64_t)address_lo + tmplength; pdma_sg->addresshigh = address_hi; pdma_sg->address = address_lo; @@ -1055,8 +1061,8 @@ static void arcmsr_build_srb(struct Comm } else { arcmsr_cdb->DataLength = 0; } - srb->arc_cdb_size = arccdbsize; - arcmsr_cdb->msgPages = (arccdbsize/256) + ((arccdbsize % 256) ? 1 : 0); + srb->arc_cdb_size = arccdbsize; + arcmsr_cdb->msgPages = (arccdbsize/256) + ((arccdbsize % 256) ? 1 : 0); } /* ************************************************************************** @@ -1066,7 +1072,7 @@ static void arcmsr_post_srb(struct Adapt { u_int32_t cdb_phyaddr_low = (u_int32_t) srb->cdb_phyaddr_low; struct ARCMSR_CDB *arcmsr_cdb = (struct ARCMSR_CDB *)&srb->arcmsr_cdb; - + bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, (srb->srb_flags & SRB_FLAG_WRITE) ? BUS_DMASYNC_POSTWRITE:BUS_DMASYNC_POSTREAD); atomic_add_int(&acb->srboutstandingcount, 1); srb->srb_state = ARCMSR_SRB_START; @@ -1083,7 +1089,7 @@ static void arcmsr_post_srb(struct Adapt case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; int ending_index, index; - + index = phbbmu->postq_index; ending_index = ((index+1) % ARCMSR_MAX_HBB_POSTQUEUE); phbbmu->post_qbuffer[ending_index] = 0; @@ -1095,26 +1101,26 @@ static void arcmsr_post_srb(struct Adapt index++; index %= ARCMSR_MAX_HBB_POSTQUEUE; /*if last index number set it to 0 */ phbbmu->postq_index = index; - CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_CDB_POSTED); + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_CDB_POSTED); } break; - case ACB_ADAPTER_TYPE_C: { - u_int32_t ccb_post_stamp, arc_cdb_size, cdb_phyaddr_hi32; + case ACB_ADAPTER_TYPE_C: { + u_int32_t ccb_post_stamp, arc_cdb_size, cdb_phyaddr_hi32; - arc_cdb_size = (srb->arc_cdb_size > 0x300) ? 0x300 : srb->arc_cdb_size; - ccb_post_stamp = (cdb_phyaddr_low | ((arc_cdb_size-1) >> 6) | 1); + arc_cdb_size = (srb->arc_cdb_size > 0x300) ? 0x300 : srb->arc_cdb_size; + ccb_post_stamp = (cdb_phyaddr_low | ((arc_cdb_size-1) >> 6) | 1); cdb_phyaddr_hi32 = acb->srb_phyaddr.B.phyadd_high; - if(cdb_phyaddr_hi32) - { - CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_high, cdb_phyaddr_hi32); - CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); - } - else - { - CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); - } - } - break; + if(cdb_phyaddr_hi32) + { + CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_high, cdb_phyaddr_hi32); + CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); + } + else + { + CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); + } + } + break; case ACB_ADAPTER_TYPE_D: { struct HBD_MessageUnit0 *phbdmu = (struct HBD_MessageUnit0 *)acb->pmu; u_int16_t index_stripped; @@ -1152,29 +1158,29 @@ static void arcmsr_post_srb(struct Adapt static struct QBUFFER *arcmsr_get_iop_rqbuffer( struct AdapterControlBlock *acb) { struct QBUFFER *qbuffer=NULL; - + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { struct HBA_MessageUnit *phbamu = (struct HBA_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbamu->message_rbuffer; } break; case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbbmu->hbb_rwbuffer->message_rbuffer; } break; case ACB_ADAPTER_TYPE_C: { struct HBC_MessageUnit *phbcmu = (struct HBC_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbcmu->message_rbuffer; } break; case ACB_ADAPTER_TYPE_D: { struct HBD_MessageUnit0 *phbdmu = (struct HBD_MessageUnit0 *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbdmu->phbdmu->message_rbuffer; } break; @@ -1188,29 +1194,29 @@ static struct QBUFFER *arcmsr_get_iop_rq static struct QBUFFER *arcmsr_get_iop_wqbuffer( struct AdapterControlBlock *acb) { struct QBUFFER *qbuffer = NULL; - + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { struct HBA_MessageUnit *phbamu = (struct HBA_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbamu->message_wbuffer; } break; case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbbmu->hbb_rwbuffer->message_wbuffer; } break; case ACB_ADAPTER_TYPE_C: { struct HBC_MessageUnit *phbcmu = (struct HBC_MessageUnit *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbcmu->message_wbuffer; } break; case ACB_ADAPTER_TYPE_D: { struct HBD_MessageUnit0 *phbdmu = (struct HBD_MessageUnit0 *)acb->pmu; - + qbuffer = (struct QBUFFER *)&phbdmu->phbdmu->message_wbuffer; } break; @@ -1230,8 +1236,9 @@ static void arcmsr_iop_message_read(stru } break; case ACB_ADAPTER_TYPE_B: { + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; /* let IOP know data has been read */ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK); + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK); } break; case ACB_ADAPTER_TYPE_C: { @@ -1262,11 +1269,12 @@ static void arcmsr_iop_message_wrote(str } break; case ACB_ADAPTER_TYPE_B: { + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; /* ** push inbound doorbell tell iop, driver data write ok ** and wait reply on next hwinterrupt for next Qbuffer post */ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_WRITE_OK); + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_WRITE_OK); } break; case ACB_ADAPTER_TYPE_C: { @@ -1295,7 +1303,7 @@ static void arcmsr_stop_hba_bgrb(struct { acb->acb_flags &= ~ACB_F_MSG_START_BGRB; CHIP_REG_WRITE32(HBA_MessageUnit, - 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_STOP_BGRB); + 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_STOP_BGRB); if(!arcmsr_hba_wait_msgint_ready(acb)) { printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); @@ -1307,9 +1315,9 @@ static void arcmsr_stop_hba_bgrb(struct */ static void arcmsr_stop_hbb_bgrb(struct AdapterControlBlock *acb) { + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; acb->acb_flags &= ~ACB_F_MSG_START_BGRB; - CHIP_REG_WRITE32(HBB_DOORBELL, - 0, drv2iop_doorbell, ARCMSR_MESSAGE_STOP_BGRB); + WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_STOP_BGRB); if(!arcmsr_hbb_wait_msgint_ready(acb)) { printf( "arcmsr%d: wait 'stop adapter background rebulid' timeout \n" , acb->pci_unit); @@ -1387,7 +1395,7 @@ static void arcmsr_poll(struct cam_sim * ************************************************************************** */ static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struct AdapterControlBlock *acb, - struct QBUFFER *prbuffer) { + struct QBUFFER *prbuffer) { u_int8_t *pQbuffer; u_int8_t *buf1 = 0; @@ -1432,13 +1440,13 @@ static u_int32_t arcmsr_Read_iop_rqbuffe ************************************************************************** */ static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, - struct QBUFFER *prbuffer) { + struct QBUFFER *prbuffer) { u_int8_t *pQbuffer; u_int8_t *iop_data; u_int32_t iop_len; - if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { return(arcmsr_Read_iop_rqbuffer_data_D(acb, prbuffer)); } iop_data = (u_int8_t *)prbuffer->data; @@ -1464,12 +1472,12 @@ static void arcmsr_iop2drv_data_wrote_ha { struct QBUFFER *prbuffer; int my_empty_len; - + /*check this iop data if overflow my rqbuffer*/ ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock); prbuffer = arcmsr_get_iop_rqbuffer(acb); my_empty_len = (acb->rqbuf_lastindex - acb->rqbuf_firstindex - 1) & - (ARCMSR_MAX_QBUFFER-1); + (ARCMSR_MAX_QBUFFER-1); if(my_empty_len >= prbuffer->data_len) { if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; @@ -1489,7 +1497,7 @@ static void arcmsr_Write_data_2iop_wqbuf u_int8_t *buf1 = 0; u_int32_t *iop_data, *buf2 = 0; u_int32_t allxfer_len = 0, data_len; - + if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) { buf1 = malloc(128, M_DEVBUF, M_NOWAIT | M_ZERO); buf2 = (u_int32_t *)buf1; @@ -1532,8 +1540,8 @@ static void arcmsr_Write_data_2iop_wqbuf struct QBUFFER *pwbuffer; u_int8_t *iop_data; int32_t allxfer_len=0; - - if(acb->adapter_type == ACB_ADAPTER_TYPE_D) { + + if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { arcmsr_Write_data_2iop_wqbuffer_D(acb); return; } @@ -1585,8 +1593,8 @@ static void arcmsr_rescanLun_cb(struct c /* if (ccb->ccb_h.status != CAM_REQ_CMP) printf("arcmsr_rescanLun_cb: Rescan Target=%x, lun=%x," - "failure status=%x\n", ccb->ccb_h.target_id, - ccb->ccb_h.target_lun, ccb->ccb_h.status); + "failure status=%x\n", ccb->ccb_h.target_id, + ccb->ccb_h.target_lun, ccb->ccb_h.status); else printf("arcmsr_rescanLun_cb: Rescan lun successfully!\n"); */ @@ -1600,7 +1608,7 @@ static void arcmsr_rescan_lun(struct Ada union ccb *ccb; if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL) - return; + return; if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP) { xpt_free_ccb(ccb); @@ -1618,9 +1626,9 @@ static void arcmsr_rescan_lun(struct Ada static void arcmsr_abort_dr_ccbs(struct AdapterControlBlock *acb, int target, int lun) { - struct CommandControlBlock *srb; + struct CommandControlBlock *srb; u_int32_t intmask_org; - int i; + int i; /* disable all outbound interrupts */ intmask_org = arcmsr_disable_allintr(acb); @@ -1629,13 +1637,13 @@ static void arcmsr_abort_dr_ccbs(struct srb = acb->psrb_pool[i]; if (srb->srb_state == ARCMSR_SRB_START) { - if((target == srb->pccb->ccb_h.target_id) && (lun == srb->pccb->ccb_h.target_lun)) - { - srb->srb_state = ARCMSR_SRB_ABORTED; + if((target == srb->pccb->ccb_h.target_id) && (lun == srb->pccb->ccb_h.target_lun)) + { + srb->srb_state = ARCMSR_SRB_ABORTED; srb->pccb->ccb_h.status |= CAM_REQ_ABORTED; - arcmsr_srb_complete(srb, 1); + arcmsr_srb_complete(srb, 1); printf("arcmsr%d: abort scsi id %d lun %d srb=%p \n", acb->pci_unit, target, lun, srb); - } + } } } /* enable outbound Post Queue, outbound doorbell Interrupt */ @@ -1648,87 +1656,87 @@ static void arcmsr_abort_dr_ccbs(struct static void arcmsr_dr_handle(struct AdapterControlBlock *acb) { u_int32_t devicemap; u_int32_t target, lun; - u_int32_t deviceMapCurrent[4]={0}; - u_int8_t *pDevMap; + u_int32_t deviceMapCurrent[4]={0}; + u_int8_t *pDevMap; switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: - devicemap = offsetof(struct HBA_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); - for (target = 0; target < 4; target++) - { - deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); - devicemap += 4; - } - break; + devicemap = offsetof(struct HBA_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target = 0; target < 4; target++) + { + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; + } + break; case ACB_ADAPTER_TYPE_B: - devicemap = offsetof(struct HBB_RWBUFFER, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); - for (target = 0; target < 4; target++) - { - deviceMapCurrent[target]=bus_space_read_4(acb->btag[1], acb->bhandle[1], devicemap); - devicemap += 4; - } - break; + devicemap = offsetof(struct HBB_RWBUFFER, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target = 0; target < 4; target++) + { + deviceMapCurrent[target]=bus_space_read_4(acb->btag[1], acb->bhandle[1], devicemap); + devicemap += 4; + } + break; case ACB_ADAPTER_TYPE_C: - devicemap = offsetof(struct HBC_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); - for (target = 0; target < 4; target++) - { - deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); - devicemap += 4; - } - break; + devicemap = offsetof(struct HBC_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target = 0; target < 4; target++) + { + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; + } + break; case ACB_ADAPTER_TYPE_D: - devicemap = offsetof(struct HBD_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); - for (target = 0; target < 4; target++) - { - deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); - devicemap += 4; - } - break; - } - - if(acb->acb_flags & ACB_F_BUS_HANG_ON) + devicemap = offsetof(struct HBD_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]); + for (target = 0; target < 4; target++) { - acb->acb_flags &= ~ACB_F_BUS_HANG_ON; + deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap); + devicemap += 4; } - /* - ** adapter posted CONFIG message - ** copy the new map, note if there are differences with the current map - */ - pDevMap = (u_int8_t *)&deviceMapCurrent[0]; - for (target = 0; target < ARCMSR_MAX_TARGETID - 1; target++) + break; + } + + if(acb->acb_flags & ACB_F_BUS_HANG_ON) + { + acb->acb_flags &= ~ACB_F_BUS_HANG_ON; + } + /* + ** adapter posted CONFIG message + ** copy the new map, note if there are differences with the current map + */ + pDevMap = (u_int8_t *)&deviceMapCurrent[0]; + for (target = 0; target < ARCMSR_MAX_TARGETID - 1; target++) + { + if (*pDevMap != acb->device_map[target]) { - if (*pDevMap != acb->device_map[target]) - { - u_int8_t difference, bit_check; + u_int8_t difference, bit_check; - difference = *pDevMap ^ acb->device_map[target]; - for(lun=0; lun < ARCMSR_MAX_TARGETLUN; lun++) - { - bit_check = (1 << lun); /*check bit from 0....31*/ - if(difference & bit_check) - { - if(acb->device_map[target] & bit_check) - {/* unit departed */ - printf("arcmsr_dr_handle: Target=%x, lun=%x, GONE!!!\n",target,lun); - arcmsr_abort_dr_ccbs(acb, target, lun); - arcmsr_rescan_lun(acb, target, lun); - acb->devstate[target][lun] = ARECA_RAID_GONE; - } - else - {/* unit arrived */ - printf("arcmsr_dr_handle: Target=%x, lun=%x, Plug-IN!!!\n",target,lun); - arcmsr_rescan_lun(acb, target, lun); - acb->devstate[target][lun] = ARECA_RAID_GOOD; - } - } - } -/* printf("arcmsr_dr_handle: acb->device_map[%x]=0x%x, deviceMapCurrent[%x]=%x\n",target,acb->device_map[target],target,*pDevMap); */ - acb->device_map[target] = *pDevMap; + difference = *pDevMap ^ acb->device_map[target]; + for(lun=0; lun < ARCMSR_MAX_TARGETLUN; lun++) + { + bit_check = (1 << lun); /*check bit from 0....31*/ + if(difference & bit_check) + { + if(acb->device_map[target] & bit_check) + {/* unit departed */ + printf("arcmsr_dr_handle: Target=%x, lun=%x, GONE!!!\n",target,lun); + arcmsr_abort_dr_ccbs(acb, target, lun); + arcmsr_rescan_lun(acb, target, lun); + acb->devstate[target][lun] = ARECA_RAID_GONE; + } + else + {/* unit arrived */ + printf("arcmsr_dr_handle: Target=%x, lun=%x, Plug-IN!!!\n",target,lun); + arcmsr_rescan_lun(acb, target, lun); + acb->devstate[target][lun] = ARECA_RAID_GOOD; + } + } } - pDevMap++; +/* printf("arcmsr_dr_handle: acb->device_map[%x]=0x%x, deviceMapCurrent[%x]=%x\n",target,acb->device_map[target],target,*pDevMap); */ + acb->device_map[target] = *pDevMap; } + pDevMap++; + } } /* ************************************************************************** @@ -1748,9 +1756,10 @@ static void arcmsr_hba_message_isr(struc */ static void arcmsr_hbb_message_isr(struct AdapterControlBlock *acb) { u_int32_t outbound_message; + struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; /* clear interrupts */ - CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN); + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN); outbound_message = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[0]); if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG) arcmsr_dr_handle( acb ); @@ -1785,8 +1794,8 @@ static void arcmsr_hbd_message_isr(struc */ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) { - u_int32_t outbound_doorbell; - + u_int32_t doorbell_status; + /* ******************************************************************* ** Maybe here we need to check wrqbuffer_lock is lock or not @@ -1794,14 +1803,12 @@ static void arcmsr_hba_doorbell_isr(stru ** check if there are any mail need to pack from firmware ******************************************************************* */ - outbound_doorbell = CHIP_REG_READ32(HBA_MessageUnit, - 0, outbound_doorbell); - CHIP_REG_WRITE32(HBA_MessageUnit, - 0, outbound_doorbell, outbound_doorbell); /* clear doorbell interrupt */ - if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK) { + doorbell_status = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_doorbell); + CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_doorbell, doorbell_status); /* clear doorbell interrupt */ + if(doorbell_status & ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK) { arcmsr_iop2drv_data_wrote_handle(acb); } - if(outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { + if(doorbell_status & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { arcmsr_iop2drv_data_read_handle(acb); } } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Wed Dec 16 14:22:01 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CD76A44302; Wed, 16 Dec 2015 14:22:01 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C2C91F38; Wed, 16 Dec 2015 14:22:01 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGEM0Ms053345; Wed, 16 Dec 2015 14:22:00 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGEM013053344; Wed, 16 Dec 2015 14:22:00 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512161422.tBGEM013053344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 16 Dec 2015 14:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292335 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 14:22:01 -0000 Author: brueffer Date: Wed Dec 16 14:22:00 2015 New Revision: 292335 URL: https://svnweb.freebsd.org/changeset/base/292335 Log: MFH: r291766 ARC-1203 is supported since the latest driver update. Modified: stable/10/share/man/man4/arcmsr.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/arcmsr.4 ============================================================================== --- stable/10/share/man/man4/arcmsr.4 Wed Dec 16 10:55:19 2015 (r292334) +++ stable/10/share/man/man4/arcmsr.4 Wed Dec 16 14:22:00 2015 (r292335) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2013 +.Dd December 4, 2015 .Dt ARCMSR 4 .Os .Sh NAME @@ -94,6 +94,8 @@ ARC-1200 .It ARC-1201 .It +ARC-1203 +.It ARC-1210 .It ARC-1212 From owner-svn-src-stable-10@freebsd.org Wed Dec 16 16:40:47 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68830A49EED; Wed, 16 Dec 2015 16:40:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FF291FE5; Wed, 16 Dec 2015 16:40:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGGekrF095530; Wed, 16 Dec 2015 16:40:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGGekD6095528; Wed, 16 Dec 2015 16:40:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161640.tBGGekD6095528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 16:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292339 - in stable/10: . lib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 16:40:47 -0000 Author: emaste Date: Wed Dec 16 16:40:45 2015 New Revision: 292339 URL: https://svnweb.freebsd.org/changeset/base/292339 Log: MFC r282821: Remove redundant csu subdir logic The appropriate subdirectories are handled by lib/csu/Makefile. There's no need to duplicate this logic in Makefile.inc1 and lib/Makefile. Sponsored by: The FreeBSD Foundation Modified: stable/10/Makefile.inc1 stable/10/lib/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Wed Dec 16 16:19:18 2015 (r292338) +++ stable/10/Makefile.inc1 Wed Dec 16 16:40:45 2015 (r292339) @@ -1617,13 +1617,7 @@ _prereq_libs= gnu/lib/libssp/libssp_nons # all shared libraries for ELF. # _startup_libs= gnu/lib/csu -.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) -_startup_libs+= lib/csu/${MACHINE_ARCH}-elf -.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) -_startup_libs+= lib/csu/${MACHINE_ARCH} -.else -_startup_libs+= lib/csu/${MACHINE_CPUARCH} -.endif +_startup_libs+= lib/csu _startup_libs+= gnu/lib/libgcc _startup_libs+= lib/libcompiler_rt _startup_libs+= lib/libc Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Wed Dec 16 16:19:18 2015 (r292338) +++ stable/10/lib/Makefile Wed Dec 16 16:40:45 2015 (r292339) @@ -8,7 +8,7 @@ # and the main list to avoid needing a SUBDIR_DEPEND line on every library # naming just these few items. -SUBDIR_ORDERED= ${_csu} \ +SUBDIR_ORDERED= csu \ .WAIT \ libc \ libc_nonshared \ @@ -142,16 +142,6 @@ SUBDIR_DEPEND_libtacplus= libmd SUBDIR_DEPEND_libulog= libmd SUBDIR_DEPEND_libunbound= ${_libldns} -.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) -_csu=csu/${MACHINE_ARCH}-elf -.elif exists(${.CURDIR}/csu/${MACHINE_ARCH}) -_csu=csu/${MACHINE_ARCH} -.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile) -_csu=csu/${MACHINE_CPUARCH} -.else -_csu=csu -.endif - # NB: keep these sorted by MK_* knobs .if ${MK_ATM} != "no" From owner-svn-src-stable-10@freebsd.org Wed Dec 16 16:42:26 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46785A480C5; Wed, 16 Dec 2015 16:42:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDC381388; Wed, 16 Dec 2015 16:42:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGGgP6i098193; Wed, 16 Dec 2015 16:42:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGGgOaX098191; Wed, 16 Dec 2015 16:42:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161642.tBGGgOaX098191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 16:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292340 - stable/10/contrib/binutils/gas/config X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 16:42:26 -0000 Author: emaste Date: Wed Dec 16 16:42:24 2015 New Revision: 292340 URL: https://svnweb.freebsd.org/changeset/base/292340 Log: MFC r256859: Don't force 64-bit DWARF2 on MIPS 64-bit debug data is only necessary for objects with greater than 4GB of debug data, and is not used on other 64-bit FreeBSD targets. Modified: stable/10/contrib/binutils/gas/config/tc-mips.c stable/10/contrib/binutils/gas/config/tc-mips.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/gas/config/tc-mips.c ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-mips.c Wed Dec 16 16:40:45 2015 (r292339) +++ stable/10/contrib/binutils/gas/config/tc-mips.c Wed Dec 16 16:42:24 2015 (r292340) @@ -15420,21 +15420,6 @@ MIPS options:\n\ -mno-octeon-useun generate MIPS unaligned load/store instructions\n")); } -enum dwarf2_format -mips_dwarf2_format (void) -{ - if (HAVE_64BIT_SYMBOLS) - { -#ifdef TE_IRIX - return dwarf2_format_64bit_irix; -#else - return dwarf2_format_64bit; -#endif - } - else - return dwarf2_format_32bit; -} - int mips_dwarf2_addr_size (void) { Modified: stable/10/contrib/binutils/gas/config/tc-mips.h ============================================================================== --- stable/10/contrib/binutils/gas/config/tc-mips.h Wed Dec 16 16:40:45 2015 (r292339) +++ stable/10/contrib/binutils/gas/config/tc-mips.h Wed Dec 16 16:42:24 2015 (r292340) @@ -155,10 +155,6 @@ extern void mips_emit_delays (void); extern void mips_enable_auto_align (void); #define md_elf_section_change_hook() mips_enable_auto_align() -enum dwarf2_format; -extern enum dwarf2_format mips_dwarf2_format (void); -#define DWARF2_FORMAT() mips_dwarf2_format () - extern int mips_dwarf2_addr_size (void); #define DWARF2_ADDR_SIZE(bfd) mips_dwarf2_addr_size () From owner-svn-src-stable-10@freebsd.org Wed Dec 16 16:44:58 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2162DA48499; Wed, 16 Dec 2015 16:44:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6B97164B; Wed, 16 Dec 2015 16:44:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGGiu0a098350; Wed, 16 Dec 2015 16:44:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGGiuf5098346; Wed, 16 Dec 2015 16:44:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161644.tBGGiuf5098346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 16:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292341 - stable/10/usr.bin/mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 16:44:58 -0000 Author: emaste Date: Wed Dec 16 16:44:56 2015 New Revision: 292341 URL: https://svnweb.freebsd.org/changeset/base/292341 Log: MFC r289349: mkimg: support fat16b partitions (MBR type 06h) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/mkimg/ebr.c stable/10/usr.bin/mkimg/mbr.c stable/10/usr.bin/mkimg/scheme.c stable/10/usr.bin/mkimg/scheme.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/ebr.c ============================================================================== --- stable/10/usr.bin/mkimg/ebr.c Wed Dec 16 16:42:24 2015 (r292340) +++ stable/10/usr.bin/mkimg/ebr.c Wed Dec 16 16:44:56 2015 (r292341) @@ -39,11 +39,15 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef DOSPTYP_FAT16B +#define DOSPTYP_FAT16B 0x06 +#endif #ifndef DOSPTYP_FAT32 #define DOSPTYP_FAT32 0x0b #endif static struct mkimg_alias ebr_aliases[] = { + { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16B) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, { ALIAS_NONE, 0 } Modified: stable/10/usr.bin/mkimg/mbr.c ============================================================================== --- stable/10/usr.bin/mkimg/mbr.c Wed Dec 16 16:42:24 2015 (r292340) +++ stable/10/usr.bin/mkimg/mbr.c Wed Dec 16 16:44:56 2015 (r292341) @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef DOSPTYP_FAT16B +#define DOSPTYP_FAT16B 0x06 +#endif #ifndef DOSPTYP_FAT32 #define DOSPTYP_FAT32 0x0b #endif @@ -49,6 +52,7 @@ __FBSDID("$FreeBSD$"); static struct mkimg_alias mbr_aliases[] = { { ALIAS_EBR, ALIAS_INT2TYPE(DOSPTYP_EXT) }, { ALIAS_EFI, ALIAS_INT2TYPE(DOSPTYP_EFI) }, + { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16B) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, { ALIAS_NTFS, ALIAS_INT2TYPE(DOSPTYP_NTFS) }, Modified: stable/10/usr.bin/mkimg/scheme.c ============================================================================== --- stable/10/usr.bin/mkimg/scheme.c Wed Dec 16 16:42:24 2015 (r292340) +++ stable/10/usr.bin/mkimg/scheme.c Wed Dec 16 16:44:56 2015 (r292341) @@ -50,6 +50,7 @@ static struct { } scheme_alias[] = { { "ebr", ALIAS_EBR }, { "efi", ALIAS_EFI }, + { "fat16b", ALIAS_FAT16B }, { "fat32", ALIAS_FAT32 }, { "freebsd", ALIAS_FREEBSD }, { "freebsd-boot", ALIAS_FREEBSD_BOOT }, Modified: stable/10/usr.bin/mkimg/scheme.h ============================================================================== --- stable/10/usr.bin/mkimg/scheme.h Wed Dec 16 16:42:24 2015 (r292340) +++ stable/10/usr.bin/mkimg/scheme.h Wed Dec 16 16:44:56 2015 (r292341) @@ -36,6 +36,7 @@ enum alias { /* start */ ALIAS_EBR, ALIAS_EFI, + ALIAS_FAT16B, ALIAS_FAT32, ALIAS_FREEBSD, ALIAS_FREEBSD_BOOT, From owner-svn-src-stable-10@freebsd.org Wed Dec 16 16:46:09 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5BE2A48573; Wed, 16 Dec 2015 16:46:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7320F1888; Wed, 16 Dec 2015 16:46:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGGk8r6098452; Wed, 16 Dec 2015 16:46:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGGk81R098451; Wed, 16 Dec 2015 16:46:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161646.tBGGk81R098451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 16:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292342 - stable/10/sys/boot/efi/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 16:46:09 -0000 Author: emaste Date: Wed Dec 16 16:46:08 2015 New Revision: 292342 URL: https://svnweb.freebsd.org/changeset/base/292342 Log: MFC r274439: Add the FDT table GUID. This is used to pass the device tree blob from UEFI to the loader in a similar way to the ACPI tables. This will be used on arm64 but is not specific to the architecture. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/boot/efi/include/efiapi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/include/efiapi.h ============================================================================== --- stable/10/sys/boot/efi/include/efiapi.h Wed Dec 16 16:44:56 2015 (r292341) +++ stable/10/sys/boot/efi/include/efiapi.h Wed Dec 16 16:46:08 2015 (r292342) @@ -846,6 +846,8 @@ typedef struct { #define SAL_SYSTEM_TABLE_GUID \ { 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define FDT_TABLE_GUID \ + { 0xb1b621d5, 0xf19c, 0x41a5, 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } typedef struct _EFI_CONFIGURATION_TABLE { EFI_GUID VendorGuid; From owner-svn-src-stable-10@freebsd.org Wed Dec 16 16:49:01 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3535BA48764; Wed, 16 Dec 2015 16:49:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 107AA1AA2; Wed, 16 Dec 2015 16:49:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGGn0Sw098600; Wed, 16 Dec 2015 16:49:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGGn0l9098598; Wed, 16 Dec 2015 16:49:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512161649.tBGGn0l9098598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Dec 2015 16:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292343 - in stable/10/sys/boot: amd64/efi efi/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 16:49:01 -0000 Author: emaste Date: Wed Dec 16 16:48:59 2015 New Revision: 292343 URL: https://svnweb.freebsd.org/changeset/base/292343 Log: MFC r278234: EFI: print more information about EFI Tables. This adds the GUIDs for DXE, HOB, Memory Type Information and Debug Image Info. Modified: stable/10/sys/boot/amd64/efi/main.c stable/10/sys/boot/efi/include/efiapi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/amd64/efi/main.c ============================================================================== --- stable/10/sys/boot/amd64/efi/main.c Wed Dec 16 16:46:08 2015 (r292342) +++ stable/10/sys/boot/amd64/efi/main.c Wed Dec 16 16:48:59 2015 (r292343) @@ -54,6 +54,10 @@ EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; EFI_GUID mps = MPS_TABLE_GUID; EFI_GUID netid = EFI_SIMPLE_NETWORK_PROTOCOL; EFI_GUID smbios = SMBIOS_TABLE_GUID; +EFI_GUID dxe = DXE_SERVICES_TABLE_GUID; +EFI_GUID hoblist = HOB_LIST_TABLE_GUID; +EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID; +EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; EFI_STATUS main(int argc, CHAR16 *argv[]) @@ -274,6 +278,14 @@ command_configuration(int argc, char *ar printf("ACPI 2.0 Table"); else if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) printf("SMBIOS Table"); + else if (!memcmp(guid, &dxe, sizeof(EFI_GUID))) + printf("DXE Table"); + else if (!memcmp(guid, &hoblist, sizeof(EFI_GUID))) + printf("HOB List Table"); + else if (!memcmp(guid, &memtype, sizeof(EFI_GUID))) + printf("Memory Type Information Table"); + else if (!memcmp(guid, &debugimg, sizeof(EFI_GUID))) + printf("Debug Image Info Table"); else printf("Unknown Table (%s)", guid_to_string(guid)); printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); @@ -329,7 +341,7 @@ command_mode(int argc, char *argv[]) } if (i != 0) - printf("Choose the mode with \"col \"\n"); + printf("Choose the mode with \"col \"\n"); return (CMD_OK); } Modified: stable/10/sys/boot/efi/include/efiapi.h ============================================================================== --- stable/10/sys/boot/efi/include/efiapi.h Wed Dec 16 16:46:08 2015 (r292342) +++ stable/10/sys/boot/efi/include/efiapi.h Wed Dec 16 16:48:59 2015 (r292343) @@ -88,7 +88,7 @@ EFI_STATUS IN VOID *Buffer ); -typedef +typedef EFI_STATUS (EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) ( IN UINTN MemoryMapSize, @@ -103,7 +103,7 @@ EFI_STATUS #define EFI_INTERNAL_PTR 0x00000004 // Pointer to internal runtime data -typedef +typedef EFI_STATUS (EFIAPI *EFI_CONVERT_POINTER) ( IN UINTN DebugDisposition, @@ -168,7 +168,7 @@ EFI_STATUS IN EFI_EVENT Event ); -typedef +typedef EFI_STATUS (EFIAPI *EFI_WAIT_FOR_EVENT) ( IN UINTN NumberOfEvents, @@ -194,8 +194,8 @@ EFI_STATUS #define TPL_APPLICATION 4 #define TPL_CALLBACK 8 -#define TPL_NOTIFY 16 -#define TPL_HIGH_LEVEL 31 +#define TPL_NOTIFY 16 +#define TPL_HIGH_LEVEL 31 typedef EFI_TPL @@ -324,14 +324,14 @@ EFI_STATUS // Image Entry prototype -typedef +typedef EFI_STATUS (EFIAPI *EFI_IMAGE_ENTRY_POINT) ( IN EFI_HANDLE ImageHandle, IN struct _EFI_SYSTEM_TABLE *SystemTable ); -typedef +typedef EFI_STATUS (EFIAPI *EFI_IMAGE_LOAD) ( IN BOOLEAN BootPolicy, @@ -342,7 +342,7 @@ EFI_STATUS OUT EFI_HANDLE *ImageHandle ); -typedef +typedef EFI_STATUS (EFIAPI *EFI_IMAGE_START) ( IN EFI_HANDLE ImageHandle, @@ -359,7 +359,7 @@ EFI_STATUS IN CHAR16 *ExitData OPTIONAL ); -typedef +typedef EFI_STATUS (EFIAPI *EFI_IMAGE_UNLOAD) ( IN EFI_HANDLE ImageHandle @@ -495,7 +495,7 @@ EFI_STATUS ); typedef -EFI_STATUS +EFI_STATUS (EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) ( IN EFI_GUID *Protocol, IN EFI_EVENT Event, @@ -539,7 +539,7 @@ EFI_STATUS ); typedef -EFI_STATUS +EFI_STATUS (EFIAPI *EFI_CONNECT_CONTROLLER) ( IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE *DriverImageHandle OPTIONAL, @@ -548,19 +548,19 @@ EFI_STATUS ); typedef -EFI_STATUS +EFI_STATUS (EFIAPI *EFI_DISCONNECT_CONTROLLER)( IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE DriverImageHandle, OPTIONAL IN EFI_HANDLE ChildHandle OPTIONAL - ); + ); -#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 -#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 -#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004 -#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008 -#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 -#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020 +#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 +#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 +#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004 +#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008 +#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 +#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020 typedef EFI_STATUS @@ -808,7 +808,7 @@ typedef struct { // EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle; EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer; - EFI_LOCATE_PROTOCOL LocateProtocol; + EFI_LOCATE_PROTOCOL LocateProtocol; EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces; EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces; @@ -849,6 +849,18 @@ typedef struct { #define FDT_TABLE_GUID \ { 0xb1b621d5, 0xf19c, 0x41a5, 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } +#define DXE_SERVICES_TABLE_GUID \ + { 0x5ad34ba, 0x6f02, 0x4214, 0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9 } + +#define HOB_LIST_TABLE_GUID \ + { 0x7739f24c, 0x93d7, 0x11d4, 0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + +#define MEMORY_TYPE_INFORMATION_TABLE_GUID \ + { 0x4c19049f, 0x4137, 0x4dd3, 0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa } + +#define DEBUG_IMAGE_INFO_TABLE_GUID \ + { 0x49152e77, 0x1ada, 0x4764, 0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b } + typedef struct _EFI_CONFIGURATION_TABLE { EFI_GUID VendorGuid; VOID *VendorTable; From owner-svn-src-stable-10@freebsd.org Wed Dec 16 19:01:16 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3894A48083; Wed, 16 Dec 2015 19:01:16 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 814EC1A05; Wed, 16 Dec 2015 19:01:16 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBGJ1Fmo036898; Wed, 16 Dec 2015 19:01:15 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBGJ1FQr036890; Wed, 16 Dec 2015 19:01:15 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201512161901.tBGJ1FQr036890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Wed, 16 Dec 2015 19:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292348 - in stable/10: share/man/man4 sys/cam sys/cam/ata sys/cam/scsi sys/dev/md sys/geom sys/ia64/include sys/kern sys/pc98/include sys/sys usr.sbin usr.sbin/camdd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 19:01:16 -0000 Author: ken Date: Wed Dec 16 19:01:14 2015 New Revision: 292348 URL: https://svnweb.freebsd.org/changeset/base/292348 Log: MFC r291716, r291724, r291741, r291742 In addition to those revisions, add this change to a file that is not in head: sys/ia64/include/bus.h: Guard kernel-only parts of the ia64 machine/bus.h header with #ifdef _KERNEL. This allows userland programs to include to get the definition of bus_addr_t and bus_size_t. ------------------------------------------------------------------------ r291716 | ken | 2015-12-03 15:54:55 -0500 (Thu, 03 Dec 2015) | 257 lines Add asynchronous command support to the pass(4) driver, and the new camdd(8) utility. CCBs may be queued to the driver via the new CAMIOQUEUE ioctl, and completed CCBs may be retrieved via the CAMIOGET ioctl. User processes can use poll(2) or kevent(2) to get notification when I/O has completed. While the existing CAMIOCOMMAND blocking ioctl interface only supports user virtual data pointers in a CCB (generally only one per CCB), the new CAMIOQUEUE ioctl supports user virtual and physical address pointers, as well as user virtual and physical scatter/gather lists. This allows user applications to have more flexibility in their data handling operations. Kernel memory for data transferred via the queued interface is allocated from the zone allocator in MAXPHYS sized chunks, and user data is copied in and out. This is likely faster than the vmapbuf()/vunmapbuf() method used by the CAMIOCOMMAND ioctl in configurations with many processors (there are more TLB shootdowns caused by the mapping/unmapping operation) but may not be as fast as running with unmapped I/O. The new memory handling model for user requests also allows applications to send CCBs with request sizes that are larger than MAXPHYS. The pass(4) driver now limits queued requests to the I/O size listed by the SIM driver in the maxio field in the Path Inquiry (XPT_PATH_INQ) CCB. There are some things things would be good to add: 1. Come up with a way to do unmapped I/O on multiple buffers. Currently the unmapped I/O interface operates on a struct bio, which includes only one address and length. It would be nice to be able to send an unmapped scatter/gather list down to busdma. This would allow eliminating the copy we currently do for data. 2. Add an ioctl to list currently outstanding CCBs in the various queues. 3. Add an ioctl to cancel a request, or use the XPT_ABORT CCB to do that. 4. Test physical address support. Virtual pointers and scatter gather lists have been tested, but I have not yet tested physical addresses or scatter/gather lists. 5. Investigate multiple queue support. At the moment there is one queue of commands per pass(4) device. If multiple processes open the device, they will submit I/O into the same queue and get events for the same completions. This is probably the right model for most applications, but it is something that could be changed later on. Also, add a new utility, camdd(8) that uses the asynchronous pass(4) driver interface. This utility is intended to be a basic data transfer/copy utility, a simple benchmark utility, and an example of how to use the asynchronous pass(4) interface. It can copy data to and from pass(4) devices using any target queue depth, starting offset and blocksize for the input and ouptut devices. It currently only supports SCSI devices, but could be easily extended to support ATA devices. It can also copy data to and from regular files, block devices, tape devices, pipes, stdin, and stdout. It does not support queueing multiple commands to any of those targets, since it uses the standard read(2)/write(2)/writev(2)/readv(2) system calls. The I/O is done by two threads, one for the reader and one for the writer. The reader thread sends completed read requests to the writer thread in strictly sequential order, even if they complete out of order. That could be modified later on for random I/O patterns or slightly out of order I/O. camdd(8) uses kqueue(2)/kevent(2) to get I/O completion events from the pass(4) driver and also to send request notifications internally. For pass(4) devcies, camdd(8) uses a single buffer (CAM_DATA_VADDR) per CAM CCB on the reading side, and a scatter/gather list (CAM_DATA_SG) on the writing side. In addition to testing both interfaces, this makes any potential reblocking of I/O easier. No data is copied between the reader and the writer, but rather the reader's buffers are split into multiple I/O requests or combined into a single I/O request depending on the input and output blocksize. For the file I/O path, camdd(8) also uses a single buffer (read(2), write(2), pread(2) or pwrite(2)) on reads, and a scatter/gather list (readv(2), writev(2), preadv(2), pwritev(2)) on writes. Things that would be nice to do for camdd(8) eventually: 1. Add support for I/O pattern generation. Patterns like all zeros, all ones, LBA-based patterns, random patterns, etc. Right Now you can always use /dev/zero, /dev/random, etc. 2. Add support for a "sink" mode, so we do only reads with no writes. Right now, you can use /dev/null. 3. Add support for automatic queue depth probing, so that we can figure out the right queue depth on the input and output side for maximum throughput. At the moment it defaults to 6. 4. Add support for SATA device passthrough I/O. 5. Add support for random LBAs and/or lengths on the input and output sides. 6. Track average per-I/O latency and busy time. The busy time and latency could also feed in to the automatic queue depth determination. sys/cam/scsi/scsi_pass.h: Define two new ioctls, CAMIOQUEUE and CAMIOGET, that queue and fetch asynchronous CAM CCBs respectively. Although these ioctls do not have a declared argument, they both take a union ccb pointer. If we declare a size here, the ioctl code in sys/kern/sys_generic.c will malloc and free a buffer for either the CCB or the CCB pointer (depending on how it is declared). Since we have to keep a copy of the CCB (which is fairly large) anyway, having the ioctl malloc and free a CCB for each call is wasteful. sys/cam/scsi/scsi_pass.c: Add asynchronous CCB support. Add two new ioctls, CAMIOQUEUE and CAMIOGET. CAMIOQUEUE adds a CCB to the incoming queue. The CCB is executed immediately (and moved to the active queue) if it is an immediate CCB, but otherwise it will be executed in passstart() when a CCB is available from the transport layer. When CCBs are completed (because they are immediate or passdone() if they are queued), they are put on the done queue. If we get the final close on the device before all pending I/O is complete, all active I/O is moved to the abandoned queue and we increment the peripheral reference count so that the peripheral driver instance doesn't go away before all pending I/O is done. The new passcreatezone() function is called on the first call to the CAMIOQUEUE ioctl on a given device to allocate the UMA zones for I/O requests and S/G list buffers. This may be good to move off to a taskqueue at some point. The new passmemsetup() function allocates memory and scatter/gather lists to hold the user's data, and copies in any data that needs to be written. For virtual pointers (CAM_DATA_VADDR), the kernel buffer is malloced from the new pass(4) driver malloc bucket. For virtual scatter/gather lists (CAM_DATA_SG), buffers are allocated from a new per-pass(9) UMA zone in MAXPHYS-sized chunks. Physical pointers are passed in unchanged. We have support for up to 16 scatter/gather segments (for the user and kernel S/G lists) in the default struct pass_io_req, so requests with longer S/G lists require an extra kernel malloc. The new passcopysglist() function copies a user scatter/gather list to a kernel scatter/gather list. The number of elements in each list may be different, but (obviously) the amount of data stored has to be identical. The new passmemdone() function copies data out for the CAM_DATA_VADDR and CAM_DATA_SG cases. The new passiocleanup() function restores data pointers in user CCBs and frees memory. Add new functions to support kqueue(2)/kevent(2): passreadfilt() tells kevent whether or not the done queue is empty. passkqfilter() adds a knote to our list. passreadfiltdetach() removes a knote from our list. Add a new function, passpoll(), for poll(2)/select(2) to use. Add devstat(9) support for the queued CCB path. sys/cam/ata/ata_da.c: Add support for the BIO_VLIST bio type. sys/cam/cam_ccb.h: Add a new enumeration for the xflags field in the CCB header. (This doesn't change the CCB header, just adds an enumeration to use.) sys/cam/cam_xpt.c: Add a new function, xpt_setup_ccb_flags(), that allows specifying CCB flags. sys/cam/cam_xpt.h: Add a prototype for xpt_setup_ccb_flags(). sys/cam/scsi/scsi_da.c: Add support for BIO_VLIST. sys/dev/md/md.c: Add BIO_VLIST support to md(4). sys/geom/geom_disk.c: Add BIO_VLIST support to the GEOM disk class. Re-factor the I/O size limiting code in g_disk_start() a bit. sys/kern/subr_bus_dma.c: Change _bus_dmamap_load_vlist() to take a starting offset and length. Add a new function, _bus_dmamap_load_pages(), that will load a list of physical pages starting at an offset. Update _bus_dmamap_load_bio() to allow loading BIO_VLIST bios. Allow unmapped I/O to start at an offset. sys/kern/subr_uio.c: Add two new functions, physcopyin_vlist() and physcopyout_vlist(). sys/pc98/include/bus.h: Guard kernel-only parts of the pc98 machine/bus.h header with #ifdef _KERNEL. This allows userland programs to include to get the definition of bus_addr_t and bus_size_t. sys/sys/bio.h: Add a new bio flag, BIO_VLIST. sys/sys/uio.h: Add prototypes for physcopyin_vlist() and physcopyout_vlist(). share/man/man4/pass.4: Document the CAMIOQUEUE and CAMIOGET ioctls. usr.sbin/Makefile: Add camdd. usr.sbin/camdd/Makefile: Add a makefile for camdd(8). usr.sbin/camdd/camdd.8: Man page for camdd(8). usr.sbin/camdd/camdd.c: The new camdd(8) utility. Sponsored by: Spectra Logic ------------------------------------------------------------------------ r291724 | ken | 2015-12-03 17:07:01 -0500 (Thu, 03 Dec 2015) | 6 lines Fix typos in the camdd(8) usage() function output caused by an error in my diff filter script. Sponsored by: Spectra Logic ------------------------------------------------------------------------ r291741 | ken | 2015-12-03 22:38:35 -0500 (Thu, 03 Dec 2015) | 10 lines Fix g_disk_vlist_limit() to work properly with deletes. Add a new bp argument to g_disk_maxsegs(), and add a new function, g_disk_maxsize() tha will properly determine the maximum I/O size for a delete or non-delete bio. Submitted by: will Sponsored by: Spectra Logic ------------------------------------------------------------------------ ------------------------------------------------------------------------ r291742 | ken | 2015-12-03 22:44:12 -0500 (Thu, 03 Dec 2015) | 5 lines Fix a style issue in g_disk_limit(). Noticed by: bdrewery ------------------------------------------------------------------------ Sponsored by: Spectra Logic Added: stable/10/usr.sbin/camdd/ - copied from r291716, head/usr.sbin/camdd/ Modified: stable/10/share/man/man4/pass.4 stable/10/sys/cam/ata/ata_da.c stable/10/sys/cam/cam_ccb.h stable/10/sys/cam/cam_xpt.c stable/10/sys/cam/cam_xpt.h stable/10/sys/cam/scsi/scsi_da.c stable/10/sys/cam/scsi/scsi_pass.c stable/10/sys/cam/scsi/scsi_pass.h stable/10/sys/dev/md/md.c stable/10/sys/geom/geom_disk.c stable/10/sys/geom/geom_io.c stable/10/sys/ia64/include/bus.h stable/10/sys/kern/subr_bus_dma.c stable/10/sys/kern/subr_uio.c stable/10/sys/pc98/include/bus.h stable/10/sys/sys/bio.h stable/10/sys/sys/uio.h stable/10/usr.sbin/Makefile stable/10/usr.sbin/camdd/camdd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/pass.4 ============================================================================== --- stable/10/share/man/man4/pass.4 Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/share/man/man4/pass.4 Wed Dec 16 19:01:14 2015 (r292348) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 1998 +.Dd March 17, 2015 .Dt PASS 4 .Os .Sh NAME @@ -53,9 +53,13 @@ The .Nm driver attaches to every .Tn SCSI +and +.Tn ATA device found in the system. Since it attaches to every device, it provides a generic means of accessing .Tn SCSI +and +.Tn ATA devices, and allows the user to access devices which have no "standard" peripheral driver associated with them. .Sh KERNEL CONFIGURATION @@ -65,10 +69,12 @@ device in the kernel; .Nm devices are automatically allocated as .Tn SCSI +and +.Tn ATA devices are found. .Sh IOCTLS -.Bl -tag -width 012345678901234 -.It CAMIOCOMMAND +.Bl -tag -width 5n +.It CAMIOCOMMAND union ccb * This ioctl takes most kinds of CAM CCBs and passes them through to the CAM transport layer for action. Note that some CCB types are not allowed @@ -79,7 +85,7 @@ Some examples of xpt-only CCBs are XPT_S XPT_DEV_MATCH, XPT_RESET_BUS, XPT_SCAN_LUN, XPT_ENG_INQ, and XPT_ENG_EXEC. These CCB types have various attributes that make it illogical or impossible to service them through the passthrough interface. -.It CAMGETPASSTHRU +.It CAMGETPASSTHRU union ccb * This ioctl takes an XPT_GDEVLIST CCB, and returns the passthrough device corresponding to the device in question. Although this ioctl is available through the @@ -90,6 +96,109 @@ ioctl. It is probably more useful to issue this ioctl through the .Xr xpt 4 device. +.It CAMIOQUEUE union ccb * +Queue a CCB to the +.Xr pass 4 +driver to be executed asynchronously. +The caller may use +.Xr select 2 , +.Xr poll 2 +or +.Xr kevent 2 +to receive notification when the CCB has completed. +.Pp +This ioctl takes most CAM CCBs, but some CCB types are not allowed through +the pass device, and must be sent through the +.Xr xpt 4 +device instead. +Some examples of xpt-only CCBs are XPT_SCAN_BUS, +XPT_DEV_MATCH, XPT_RESET_BUS, XPT_SCAN_LUN, XPT_ENG_INQ, and XPT_ENG_EXEC. +These CCB types have various attributes that make it illogical or +impossible to service them through the passthrough interface. +.Pp +Although the +.Dv CAMIOQUEUE +ioctl is not defined to take an argument, it does require a +pointer to a union ccb. +It is not defined to take an argument to avoid an extra malloc and copy +inside the generic +.Xr ioctl 2 +handler. +.pp +The completed CCB will be returned via the +.Dv CAMIOGET +ioctl. +An error will only be returned from the +.Dv CAMIOQUEUE +ioctl if there is an error allocating memory for the request or copying +memory from userland. +All other errors will be reported as standard CAM CCB status errors. +Since the CCB is not copied back to the user process from the pass driver +in the +.Dv CAMIOQUEUE +ioctl, the user's passed-in CCB will not be modfied. +This is the case even with immediate CCBs. +Instead, the completed CCB must be retrieved via the +.Dv CAMIOGET +ioctl and the status examined. +.Pp +Multiple CCBs may be queued via the +.Dv CAMIOQUEUE +ioctl at any given time, and they may complete in a different order than +the order that they were submitted. +The caller must take steps to identify CCBs that are queued and completed. +The +.Dv periph_priv +structure inside struct ccb_hdr is available for userland use with the +.Dv CAMIOQUEUE +and +.Dv CAMIOGET +ioctls, and will be preserved across calls. +Also, the periph_links linked list pointers inside struct ccb_hdr are +available for userland use with the +.Dv CAMIOQUEUE +and +.Dv CAMIOGET +ioctls and will be preserved across calls. +.It CAMIOGET union ccb * +Retrieve completed CAM CCBs queued via the +.Dv CAMIOQUEUE +ioctl. +An error will only be returned from the +.Dv CAMIOGET +ioctl if the +.Xr pass 4 +driver fails to copy data to the user process or if there are no completed +CCBs available to retrieve. +If no CCBs are available to retrieve, +errno will be set to +.Dv ENOENT . +.Pp +All other errors will be reported as standard CAM CCB status errors. +.Pp +Although the +.Dv CAMIOGET +ioctl is not defined to take an argument, it does require a +pointer to a union ccb. +It is not defined to take an argument to avoid an extra malloc and copy +inside the generic +.Xr ioctl 2 +handler. +.Pp +The pass driver will report via +.Xr select 2 , +.Xr poll 2 +or +.Xr kevent 2 +when a CCB has completed. +One CCB may be retrieved per +.Dv CAMIOGET +call. +CCBs may be returned in an order different than the order they were +submitted. +So the caller should use the +.Dv periph_priv +area inside the CCB header to store pointers to identifying information. .El .Sh FILES .Bl -tag -width /dev/passn -compact @@ -103,18 +212,21 @@ CAM subsystem. .Sh DIAGNOSTICS None. .Sh SEE ALSO +.Xr kqueue 2 , +.Xr poll 2 , +.Xr select 2 , .Xr cam 3 , .Xr cam 4 , .Xr cam_cdbparse 3 , +.Xr cd 4 , +.Xr ctl 4 , +.Xr da 4 , +.Xr sa 4 , .Xr xpt 4 , -.Xr camcontrol 8 +.Xr camcontrol 8 , +.Xr camdd 8 .Sh HISTORY The CAM passthrough driver first appeared in .Fx 3.0 . .Sh AUTHORS .An Kenneth Merry Aq ken@FreeBSD.org -.Sh BUGS -It might be nice to have a way to asynchronously send CCBs through the -passthrough driver. -This would probably require some sort of read/write -interface or an asynchronous ioctl interface. Modified: stable/10/sys/cam/ata/ata_da.c ============================================================================== --- stable/10/sys/cam/ata/ata_da.c Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/ata/ata_da.c Wed Dec 16 19:01:14 2015 (r292348) @@ -1573,12 +1573,26 @@ adastart(struct cam_periph *periph, unio } switch (bp->bio_cmd) { case BIO_WRITE: - softc->flags |= ADA_FLAG_DIRTY; - /* FALLTHROUGH */ case BIO_READ: { uint64_t lba = bp->bio_pblkno; uint16_t count = bp->bio_bcount / softc->params.secsize; + void *data_ptr; + int rw_op; + + if (bp->bio_cmd == BIO_WRITE) { + softc->flags |= ADA_FLAG_DIRTY; + rw_op = CAM_DIR_OUT; + } else { + rw_op = CAM_DIR_IN; + } + + data_ptr = bp->bio_data; + if ((bp->bio_flags & (BIO_UNMAPPED|BIO_VLIST)) != 0) { + rw_op |= CAM_DATA_BIO; + data_ptr = bp; + } + #ifdef ADA_TEST_FAILURE int fail = 0; @@ -1623,12 +1637,9 @@ adastart(struct cam_periph *periph, unio cam_fill_ataio(ataio, ada_retry_count, adadone, - (bp->bio_cmd == BIO_READ ? CAM_DIR_IN : - CAM_DIR_OUT) | ((bp->bio_flags & BIO_UNMAPPED) - != 0 ? CAM_DATA_BIO : 0), + rw_op, tag_code, - ((bp->bio_flags & BIO_UNMAPPED) != 0) ? (void *)bp : - bp->bio_data, + data_ptr, bp->bio_bcount, ada_default_timeout*1000); Modified: stable/10/sys/cam/cam_ccb.h ============================================================================== --- stable/10/sys/cam/cam_ccb.h Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/cam_ccb.h Wed Dec 16 19:01:14 2015 (r292348) @@ -111,6 +111,9 @@ typedef enum { typedef enum { CAM_EXTLUN_VALID = 0x00000001,/* 64bit lun field is valid */ + CAM_USER_DATA_ADDR = 0x00000002,/* Userspace data pointers */ + CAM_SG_FORMAT_IOVEC = 0x00000004,/* iovec instead of busdma S/G*/ + CAM_UNMAPPED_BUF = 0x00000008 /* use unmapped I/O */ } ccb_xflags; /* XPT Opcodes for xpt_action */ Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/cam_xpt.c Wed Dec 16 19:01:14 2015 (r292348) @@ -3337,7 +3337,8 @@ xpt_merge_ccb(union ccb *master_ccb, uni } void -xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority) +xpt_setup_ccb_flags(struct ccb_hdr *ccb_h, struct cam_path *path, + u_int32_t priority, u_int32_t flags) { CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_setup_ccb\n")); @@ -3355,10 +3356,16 @@ xpt_setup_ccb(struct ccb_hdr *ccb_h, str ccb_h->target_lun = CAM_TARGET_WILDCARD; } ccb_h->pinfo.index = CAM_UNQUEUED_INDEX; - ccb_h->flags = 0; + ccb_h->flags = flags; ccb_h->xflags = 0; } +void +xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority) +{ + xpt_setup_ccb_flags(ccb_h, path, priority, /*flags*/ 0); +} + /* Path manipulation functions */ cam_status xpt_create_path(struct cam_path **new_path_ptr, struct cam_periph *perph, Modified: stable/10/sys/cam/cam_xpt.h ============================================================================== --- stable/10/sys/cam/cam_xpt.h Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/cam_xpt.h Wed Dec 16 19:01:14 2015 (r292348) @@ -70,6 +70,10 @@ void xpt_action_default(union ccb *new union ccb *xpt_alloc_ccb(void); union ccb *xpt_alloc_ccb_nowait(void); void xpt_free_ccb(union ccb *free_ccb); +void xpt_setup_ccb_flags(struct ccb_hdr *ccb_h, + struct cam_path *path, + u_int32_t priority, + u_int32_t flags); void xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority); Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/scsi/scsi_da.c Wed Dec 16 19:01:14 2015 (r292348) @@ -2332,29 +2332,40 @@ skipstate: switch (bp->bio_cmd) { case BIO_WRITE: - softc->flags |= DA_FLAG_DIRTY; - /* FALLTHROUGH */ case BIO_READ: + { + void *data_ptr; + int rw_op; + + if (bp->bio_cmd == BIO_WRITE) { + softc->flags |= DA_FLAG_DIRTY; + rw_op = SCSI_RW_WRITE; + } else { + rw_op = SCSI_RW_READ; + } + + data_ptr = bp->bio_data; + if ((bp->bio_flags & (BIO_UNMAPPED|BIO_VLIST)) != 0) { + rw_op |= SCSI_RW_BIO; + data_ptr = bp; + } + scsi_read_write(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone, /*tag_action*/tag_code, - /*read_op*/(bp->bio_cmd == BIO_READ ? - SCSI_RW_READ : SCSI_RW_WRITE) | - ((bp->bio_flags & BIO_UNMAPPED) != 0 ? - SCSI_RW_BIO : 0), + rw_op, /*byte2*/0, softc->minimum_cmd_size, /*lba*/bp->bio_pblkno, /*block_count*/bp->bio_bcount / softc->params.secsize, - /*data_ptr*/ (bp->bio_flags & - BIO_UNMAPPED) != 0 ? (void *)bp : - bp->bio_data, + data_ptr, /*dxfer_len*/ bp->bio_bcount, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); break; + } case BIO_FLUSH: /* * BIO_FLUSH doesn't currently communicate Modified: stable/10/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_pass.c Wed Dec 16 18:43:52 2015 (r292347) +++ stable/10/sys/cam/scsi/scsi_pass.c Wed Dec 16 19:01:14 2015 (r292348) @@ -28,27 +28,39 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" + #include #include #include +#include #include #include -#include -#include -#include -#include +#include #include +#include +#include +#include #include +#include +#include +#include #include +#include +#include +#include + +#include #include #include #include #include +#include #include #include -#include #include +#include #include #include @@ -57,7 +69,11 @@ typedef enum { PASS_FLAG_OPEN = 0x01, PASS_FLAG_LOCKED = 0x02, PASS_FLAG_INVALID = 0x04, - PASS_FLAG_INITIAL_PHYSPATH = 0x08 + PASS_FLAG_INITIAL_PHYSPATH = 0x08, + PASS_FLAG_ZONE_INPROG = 0x10, + PASS_FLAG_ZONE_VALID = 0x20, + PASS_FLAG_UNMAPPED_CAPABLE = 0x40, + PASS_FLAG_ABANDONED_REF_SET = 0x80 } pass_flags; typedef enum { @@ -65,38 +81,104 @@ typedef enum { } pass_state; typedef enum { - PASS_CCB_BUFFER_IO + PASS_CCB_BUFFER_IO, + PASS_CCB_QUEUED_IO } pass_ccb_types; #define ccb_type ppriv_field0 -#define ccb_bp ppriv_ptr1 +#define ccb_ioreq ppriv_ptr1 -struct pass_softc { - pass_state state; - pass_flags flags; - u_int8_t pd_type; - union ccb saved_ccb; - int open_count; - u_int maxio; - struct devstat *device_stats; - struct cdev *dev; - struct cdev *alias_dev; - struct task add_physpath_task; +/* + * The maximum number of memory segments we preallocate. + */ +#define PASS_MAX_SEGS 16 + +typedef enum { + PASS_IO_NONE = 0x00, + PASS_IO_USER_SEG_MALLOC = 0x01, + PASS_IO_KERN_SEG_MALLOC = 0x02, + PASS_IO_ABANDONED = 0x04 +} pass_io_flags; + +struct pass_io_req { + union ccb ccb; + union ccb *alloced_ccb; + union ccb *user_ccb_ptr; + camq_entry user_periph_links; + ccb_ppriv_area user_periph_priv; + struct cam_periph_map_info mapinfo; + pass_io_flags flags; + ccb_flags data_flags; + int num_user_segs; + bus_dma_segment_t user_segs[PASS_MAX_SEGS]; + int num_kern_segs; + bus_dma_segment_t kern_segs[PASS_MAX_SEGS]; + bus_dma_segment_t *user_segptr; + bus_dma_segment_t *kern_segptr; + int num_bufs; + uint32_t dirs[CAM_PERIPH_MAXMAPS]; + uint32_t lengths[CAM_PERIPH_MAXMAPS]; + uint8_t *user_bufs[CAM_PERIPH_MAXMAPS]; + uint8_t *kern_bufs[CAM_PERIPH_MAXMAPS]; + struct bintime start_time; + TAILQ_ENTRY(pass_io_req) links; }; +struct pass_softc { + pass_state state; + pass_flags flags; + u_int8_t pd_type; + union ccb saved_ccb; + int open_count; + u_int maxio; + struct devstat *device_stats; + struct cdev *dev; + struct cdev *alias_dev; + struct task add_physpath_task; + struct task shutdown_kqueue_task; + struct selinfo read_select; + TAILQ_HEAD(, pass_io_req) incoming_queue; + TAILQ_HEAD(, pass_io_req) active_queue; + TAILQ_HEAD(, pass_io_req) abandoned_queue; + TAILQ_HEAD(, pass_io_req) done_queue; + struct cam_periph *periph; + char zone_name[12]; + char io_zone_name[12]; + uma_zone_t pass_zone; + uma_zone_t pass_io_zone; + size_t io_zone_size; +}; static d_open_t passopen; static d_close_t passclose; static d_ioctl_t passioctl; static d_ioctl_t passdoioctl; +static d_poll_t passpoll; +static d_kqfilter_t passkqfilter; +static void passreadfiltdetach(struct knote *kn); +static int passreadfilt(struct knote *kn, long hint); static periph_init_t passinit; static periph_ctor_t passregister; static periph_oninv_t passoninvalidate; static periph_dtor_t passcleanup; -static void pass_add_physpath(void *context, int pending); +static periph_start_t passstart; +static void pass_shutdown_kqueue(void *context, int pending); +static void pass_add_physpath(void *context, int pending); static void passasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg); +static void passdone(struct cam_periph *periph, + union ccb *done_ccb); +static int passcreatezone(struct cam_periph *periph); +static void passiocleanup(struct pass_softc *softc, + struct pass_io_req *io_req); +static int passcopysglist(struct cam_periph *periph, + struct pass_io_req *io_req, + ccb_flags direction); +static int passmemsetup(struct cam_periph *periph, + struct pass_io_req *io_req); +static int passmemdone(struct cam_periph *periph, + struct pass_io_req *io_req); static int passerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); static int passsendccb(struct cam_periph *periph, union ccb *ccb, @@ -116,9 +198,19 @@ static struct cdevsw pass_cdevsw = { .d_open = passopen, .d_close = passclose, .d_ioctl = passioctl, + .d_poll = passpoll, + .d_kqfilter = passkqfilter, .d_name = "pass", }; +static struct filterops passread_filtops = { + .f_isfd = 1, + .f_detach = passreadfiltdetach, + .f_event = passreadfilt +}; + +static MALLOC_DEFINE(M_SCSIPASS, "scsi_pass", "scsi passthrough buffers"); + static void passinit(void) { @@ -138,6 +230,60 @@ passinit(void) } static void +passrejectios(struct cam_periph *periph) +{ + struct pass_io_req *io_req, *io_req2; + struct pass_softc *softc; + + softc = (struct pass_softc *)periph->softc; + + /* + * The user can no longer get status for I/O on the done queue, so + * clean up all outstanding I/O on the done queue. + */ + TAILQ_FOREACH_SAFE(io_req, &softc->done_queue, links, io_req2) { + TAILQ_REMOVE(&softc->done_queue, io_req, links); + passiocleanup(softc, io_req); + uma_zfree(softc->pass_zone, io_req); + } + + /* + * The underlying device is gone, so we can't issue these I/Os. + * The devfs node has been shut down, so we can't return status to + * the user. Free any I/O left on the incoming queue. + */ + TAILQ_FOREACH_SAFE(io_req, &softc->incoming_queue, links, io_req2) { + TAILQ_REMOVE(&softc->incoming_queue, io_req, links); + passiocleanup(softc, io_req); + uma_zfree(softc->pass_zone, io_req); + } + + /* + * Normally we would put I/Os on the abandoned queue and acquire a + * reference when we saw the final close. But, the device went + * away and devfs may have moved everything off to deadfs by the + * time the I/O done callback is called; as a result, we won't see + * any more closes. So, if we have any active I/Os, we need to put + * them on the abandoned queue. When the abandoned queue is empty, + * we'll release the remaining reference (see below) to the peripheral. + */ + TAILQ_FOREACH_SAFE(io_req, &softc->active_queue, links, io_req2) { + TAILQ_REMOVE(&softc->active_queue, io_req, links); + io_req->flags |= PASS_IO_ABANDONED; + TAILQ_INSERT_TAIL(&softc->abandoned_queue, io_req, links); + } + + /* + * If we put any I/O on the abandoned queue, acquire a reference. + */ + if ((!TAILQ_EMPTY(&softc->abandoned_queue)) + && ((softc->flags & PASS_FLAG_ABANDONED_REF_SET) == 0)) { + cam_periph_doacquire(periph); + softc->flags |= PASS_FLAG_ABANDONED_REF_SET; + } +} + +static void passdevgonecb(void *arg) { struct cam_periph *periph; @@ -165,17 +311,26 @@ passdevgonecb(void *arg) /* * Release the reference held for the device node, it is gone now. + * Accordingly, inform all queued I/Os of their fate. */ cam_periph_release_locked(periph); + passrejectios(periph); /* - * We reference the lock directly here, instead of using + * We reference the SIM lock directly here, instead of using * cam_periph_unlock(). The reason is that the final call to * cam_periph_release_locked() above could result in the periph * getting freed. If that is the case, dereferencing the periph * with a cam_periph_unlock() call would cause a page fault. */ mtx_unlock(mtx); + + /* + * We have to remove our kqueue context from a thread because it + * may sleep. It would be nice if we could get a callback from + * kqueue when it is done cleaning up resources. + */ + taskqueue_enqueue(taskqueue_thread, &softc->shutdown_kqueue_task); } static void @@ -197,12 +352,6 @@ passoninvalidate(struct cam_periph *peri * when it has cleaned up its state. */ destroy_dev_sched_cb(softc->dev, passdevgonecb, periph); - - /* - * XXX Return all queued I/O with ENXIO. - * XXX Handle any transactions queued to the card - * with XPT_ABORT_CCB. - */ } static void @@ -212,9 +361,40 @@ passcleanup(struct cam_periph *periph) softc = (struct pass_softc *)periph->softc; + cam_periph_assert(periph, MA_OWNED); + KASSERT(TAILQ_EMPTY(&softc->active_queue), + ("%s called when there are commands on the active queue!\n", + __func__)); + KASSERT(TAILQ_EMPTY(&softc->abandoned_queue), + ("%s called when there are commands on the abandoned queue!\n", + __func__)); + KASSERT(TAILQ_EMPTY(&softc->incoming_queue), + ("%s called when there are commands on the incoming queue!\n", + __func__)); + KASSERT(TAILQ_EMPTY(&softc->done_queue), + ("%s called when there are commands on the done queue!\n", + __func__)); + devstat_remove_entry(softc->device_stats); cam_periph_unlock(periph); + + /* + * We call taskqueue_drain() for the physpath task to make sure it + * is complete. We drop the lock because this can potentially + * sleep. XXX KDM that is bad. Need a way to get a callback when + * a taskqueue is drained. + * + * Note that we don't drain the kqueue shutdown task queue. This + * is because we hold a reference on the periph for kqueue, and + * release that reference from the kqueue shutdown task queue. So + * we cannot come into this routine unless we've released that + * reference. Also, because that could be the last reference, we + * could be called from the cam_periph_release() call in + * pass_shutdown_kqueue(). In that case, the taskqueue_drain() + * would deadlock. It would be preferable if we had a way to + * get a callback when a taskqueue is done. + */ taskqueue_drain(taskqueue_thread, &softc->add_physpath_task); cam_periph_lock(periph); @@ -223,10 +403,29 @@ passcleanup(struct cam_periph *periph) } static void +pass_shutdown_kqueue(void *context, int pending) +{ + struct cam_periph *periph; + struct pass_softc *softc; + + periph = context; + softc = periph->softc; + + knlist_clear(&softc->read_select.si_note, /*is_locked*/ 0); + knlist_destroy(&softc->read_select.si_note); + + /* + * Release the reference we held for kqueue. + */ + cam_periph_release(periph); +} + +static void pass_add_physpath(void *context, int pending) { struct cam_periph *periph; struct pass_softc *softc; + struct mtx *mtx; char *physpath; /* @@ -236,34 +435,38 @@ pass_add_physpath(void *context, int pen periph = context; softc = periph->softc; physpath = malloc(MAXPATHLEN, M_DEVBUF, M_WAITOK); - cam_periph_lock(periph); - if (periph->flags & CAM_PERIPH_INVALID) { - cam_periph_unlock(periph); + mtx = cam_periph_mtx(periph); + mtx_lock(mtx); + + if (periph->flags & CAM_PERIPH_INVALID) goto out; - } + if (xpt_getattr(physpath, MAXPATHLEN, "GEOM::physpath", periph->path) == 0 && strlen(physpath) != 0) { - cam_periph_unlock(periph); + mtx_unlock(mtx); make_dev_physpath_alias(MAKEDEV_WAITOK, &softc->alias_dev, softc->dev, softc->alias_dev, physpath); - cam_periph_lock(periph); + mtx_lock(mtx); } +out: /* * Now that we've made our alias, we no longer have to have a * reference to the device. */ - if ((softc->flags & PASS_FLAG_INITIAL_PHYSPATH) == 0) { + if ((softc->flags & PASS_FLAG_INITIAL_PHYSPATH) == 0) softc->flags |= PASS_FLAG_INITIAL_PHYSPATH; - cam_periph_unlock(periph); - dev_rel(softc->dev); - } - else - cam_periph_unlock(periph); -out: + /* + * We always acquire a reference to the periph before queueing this + * task queue function, so it won't go away before we run. + */ + while (pending-- > 0) + cam_periph_release_locked(periph); + mtx_unlock(mtx); + free(physpath, M_DEVBUF); } @@ -291,7 +494,7 @@ passasync(void *callback_arg, u_int32_t * process. */ status = cam_periph_alloc(passregister, passoninvalidate, - passcleanup, NULL, "pass", + passcleanup, passstart, "pass", CAM_PERIPH_BIO, path, passasync, AC_FOUND_DEVICE, cgd); @@ -315,8 +518,19 @@ passasync(void *callback_arg, u_int32_t buftype = (uintptr_t)arg; if (buftype == CDAI_TYPE_PHYS_PATH) { struct pass_softc *softc; + cam_status status; softc = (struct pass_softc *)periph->softc; + /* + * Acquire a reference to the periph before we + * start the taskqueue, so that we don't run into + * a situation where the periph goes away before + * the task queue has a chance to run. + */ + status = cam_periph_acquire(periph); + if (status != CAM_REQ_CMP) + break; + taskqueue_enqueue(taskqueue_thread, &softc->add_physpath_task); } @@ -361,6 +575,17 @@ passregister(struct cam_periph *periph, softc->pd_type = T_DIRECT; periph->softc = softc; + softc->periph = periph; + TAILQ_INIT(&softc->incoming_queue); + TAILQ_INIT(&softc->active_queue); + TAILQ_INIT(&softc->abandoned_queue); + TAILQ_INIT(&softc->done_queue); + snprintf(softc->zone_name, sizeof(softc->zone_name), "%s%d", + periph->periph_name, periph->unit_number); + snprintf(softc->io_zone_name, sizeof(softc->io_zone_name), "%s%dIO", + periph->periph_name, periph->unit_number); + softc->io_zone_size = MAXPHYS; + knlist_init_mtx(&softc->read_select.si_note, cam_periph_mtx(periph)); bzero(&cpi, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); @@ -374,6 +599,9 @@ passregister(struct cam_periph *periph, else softc->maxio = cpi.maxio; /* real value */ + if (cpi.hba_misc & PIM_UNMAPPED) + softc->flags |= PASS_FLAG_UNMAPPED_CAPABLE; + /* * We pass in 0 for a blocksize, since we don't * know what the blocksize of this device is, if @@ -391,6 +619,23 @@ passregister(struct cam_periph *periph, DEVSTAT_PRIORITY_PASS); /* + * Initialize the taskqueue handler for shutting down kqueue. + */ + TASK_INIT(&softc->shutdown_kqueue_task, /*priority*/ 0, + pass_shutdown_kqueue, periph); + + /* + * Acquire a reference to the periph that we can release once we've + * cleaned up the kqueue. + */ + if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + xpt_print(periph->path, "%s: lost periph during " + "registration!\n", __func__); + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } + + /* * Acquire a reference to the periph before we create the devfs * instance for it. We'll release this reference once the devfs * instance has been freed. @@ -408,12 +653,15 @@ passregister(struct cam_periph *periph, periph->periph_name, periph->unit_number); /* - * Now that we have made the devfs instance, hold a reference to it - * until the task queue has run to setup the physical path alias. - * That way devfs won't get rid of the device before we add our - * alias. + * Hold a reference to the periph before we create the physical + * path alias so it can't go away. */ - dev_ref(softc->dev); + if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + xpt_print(periph->path, "%s: lost periph during " + "registration!\n", __func__); + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } cam_periph_lock(periph); softc->dev->si_drv1 = periph; @@ -514,6 +762,55 @@ passclose(struct cdev *dev, int flag, in softc = periph->softc; softc->open_count--; + if (softc->open_count == 0) { + struct pass_io_req *io_req, *io_req2; + int need_unlock; + + need_unlock = 0; + + TAILQ_FOREACH_SAFE(io_req, &softc->done_queue, links, io_req2) { + TAILQ_REMOVE(&softc->done_queue, io_req, links); + passiocleanup(softc, io_req); + uma_zfree(softc->pass_zone, io_req); + } + + TAILQ_FOREACH_SAFE(io_req, &softc->incoming_queue, links, + io_req2) { + TAILQ_REMOVE(&softc->incoming_queue, io_req, links); + passiocleanup(softc, io_req); + uma_zfree(softc->pass_zone, io_req); + } + + /* + * If there are any active I/Os, we need to forcibly acquire a + * reference to the peripheral so that we don't go away + * before they complete. We'll release the reference when + * the abandoned queue is empty. + */ + io_req = TAILQ_FIRST(&softc->active_queue); + if ((io_req != NULL) + && (softc->flags & PASS_FLAG_ABANDONED_REF_SET) == 0) { + cam_periph_doacquire(periph); + softc->flags |= PASS_FLAG_ABANDONED_REF_SET; + } + + /* + * Since the I/O in the active queue is not under our + * control, just set a flag so that we can clean it up when + * it completes and put it on the abandoned queue. This + * will prevent our sending spurious completions in the + * event that the device is opened again before these I/Os + * complete. + */ + TAILQ_FOREACH_SAFE(io_req, &softc->active_queue, links, + io_req2) { + TAILQ_REMOVE(&softc->active_queue, io_req, links); + io_req->flags |= PASS_IO_ABANDONED; + TAILQ_INSERT_TAIL(&softc->abandoned_queue, io_req, + links); + } + } + cam_periph_release_locked(periph); /* @@ -533,123 +830,1338 @@ passclose(struct cdev *dev, int flag, in return (0); } -static int -passioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) -{ - int error; - - if ((error = passdoioctl(dev, cmd, addr, flag, td)) == ENOTTY) { - error = cam_compat_ioctl(dev, cmd, addr, flag, td, passdoioctl); - } - return (error); -} -static int -passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) +static void +passstart(struct cam_periph *periph, union ccb *start_ccb) { - struct cam_periph *periph; - struct pass_softc *softc; - int error; - uint32_t priority; - - periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return(ENXIO); + struct pass_softc *softc; - cam_periph_lock(periph); softc = (struct pass_softc *)periph->softc; - error = 0; - - switch (cmd) { - - case CAMIOCOMMAND: - { - union ccb *inccb; - union ccb *ccb; - int ccb_malloced; - - inccb = (union ccb *)addr; + switch (softc->state) { + case PASS_STATE_NORMAL: { + struct pass_io_req *io_req; /* - * Some CCB types, like scan bus and scan lun can only go - * through the transport layer device. + * Check for any queued I/O requests that require an + * allocated slot. */ - if (inccb->ccb_h.func_code & XPT_FC_XPT_ONLY) { - xpt_print(periph->path, "CCB function code %#x is " - "restricted to the XPT device\n", - inccb->ccb_h.func_code); - error = ENODEV; + io_req = TAILQ_FIRST(&softc->incoming_queue); + if (io_req == NULL) { + xpt_release_ccb(start_ccb); break; } + TAILQ_REMOVE(&softc->incoming_queue, io_req, links); + TAILQ_INSERT_TAIL(&softc->active_queue, io_req, links); + /* + * Merge the user's CCB into the allocated CCB. + */ + xpt_merge_ccb(start_ccb, &io_req->ccb); + start_ccb->ccb_h.ccb_type = PASS_CCB_QUEUED_IO; + start_ccb->ccb_h.ccb_ioreq = io_req; + start_ccb->ccb_h.cbfcnp = passdone; + io_req->alloced_ccb = start_ccb; + binuptime(&io_req->start_time); + devstat_start_transaction(softc->device_stats, + &io_req->start_time); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Thu Dec 17 06:31:57 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E907A4A587; Thu, 17 Dec 2015 06:31:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2FF41AFB; Thu, 17 Dec 2015 06:31:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBH6VtmG041290; Thu, 17 Dec 2015 06:31:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBH6VtQS041289; Thu, 17 Dec 2015 06:31:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512170631.tBH6VtQS041289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 17 Dec 2015 06:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292395 - stable/10/sbin/geom/class/multipath X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 06:31:57 -0000 Author: ngie Date: Thu Dec 17 06:31:55 2015 New Revision: 292395 URL: https://svnweb.freebsd.org/changeset/base/292395 Log: MFC r292048: Don't leak rsector/sector in mp_label(..) Use calloc instead of malloc + memset(.., 0, ..) when allocating sector Differential Revision: https://reviews.freebsd.org/D4450 Reported by: cppcheck Reviewed by: mav Sponsored by: EMC / Isilon Storage Division Modified: stable/10/sbin/geom/class/multipath/geom_multipath.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- stable/10/sbin/geom/class/multipath/geom_multipath.c Thu Dec 17 02:02:09 2015 (r292394) +++ stable/10/sbin/geom/class/multipath/geom_multipath.c Thu Dec 17 06:31:55 2015 (r292395) @@ -221,17 +221,15 @@ mp_label(struct gctl_req *req) /* * Allocate a sector to write as metadata. */ - sector = malloc(secsize); + sector = calloc(1, secsize); if (sector == NULL) { gctl_error(req, "unable to allocate metadata buffer"); return; } - memset(sector, 0, secsize); rsector = malloc(secsize); if (rsector == NULL) { - free(sector); gctl_error(req, "unable to allocate metadata buffer"); - return; + goto done; } /* @@ -246,7 +244,7 @@ mp_label(struct gctl_req *req) error = g_metadata_store(name, sector, secsize); if (error != 0) { gctl_error(req, "cannot store metadata on %s: %s.", name, strerror(error)); - return; + goto done; } /* @@ -274,6 +272,9 @@ mp_label(struct gctl_req *req) name2, name); } } +done: + free(rsector); + free(sector); } From owner-svn-src-stable-10@freebsd.org Thu Dec 17 16:08:29 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91667A4945D; Thu, 17 Dec 2015 16:08:29 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FC8718CE; Thu, 17 Dec 2015 16:08:29 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBHG8S76006672; Thu, 17 Dec 2015 16:08:28 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBHG8Sbh006671; Thu, 17 Dec 2015 16:08:28 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512171608.tBHG8Sbh006671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Thu, 17 Dec 2015 16:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292403 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2015 16:08:29 -0000 Author: ume Date: Thu Dec 17 16:08:28 2015 New Revision: 292403 URL: https://svnweb.freebsd.org/changeset/base/292403 Log: MFC r292059: The calls to RES_SET_H_ERRNO() macro on error paths wind up dereferencing an uninitialized res. PR: 202142 Submitted by: Sean Boudreau Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Thu Dec 17 14:41:30 2015 (r292402) +++ stable/10/lib/libc/net/getaddrinfo.c Thu Dec 17 16:08:28 2015 (r292403) @@ -2207,6 +2207,8 @@ _dns_getaddrinfo(void *rv, void *cb_data memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; + res = __res_state(); + buf = malloc(sizeof(*buf)); if (!buf) { RES_SET_H_ERRNO(res, NETDB_INTERNAL); @@ -2253,7 +2255,6 @@ _dns_getaddrinfo(void *rv, void *cb_data return NS_UNAVAIL; } - res = __res_state(); if ((res->options & RES_INIT) == 0 && res_ninit(res) == -1) { RES_SET_H_ERRNO(res, NETDB_INTERNAL); free(buf); From owner-svn-src-stable-10@freebsd.org Fri Dec 18 00:33:05 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5FE2A4A88B; Fri, 18 Dec 2015 00:33:05 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6855127E; Fri, 18 Dec 2015 00:33:05 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI0X40f061519; Fri, 18 Dec 2015 00:33:04 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI0X4NM061518; Fri, 18 Dec 2015 00:33:04 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201512180033.tBI0X4NM061518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Fri, 18 Dec 2015 00:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292416 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 00:33:06 -0000 Author: jamie Date: Fri Dec 18 00:33:04 2015 New Revision: 292416 URL: https://svnweb.freebsd.org/changeset/base/292416 Log: MFC r292277: Fix jail name checking that disallowed anything that starts with '0'. The intention was to just limit leading zeroes on numeric names. That check is now improved to also catch the leading spaces and '+' that strtoul can pass through. PR: 204897 Modified: stable/10/sys/kern/kern_jail.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_jail.c ============================================================================== --- stable/10/sys/kern/kern_jail.c Fri Dec 18 00:33:03 2015 (r292415) +++ stable/10/sys/kern/kern_jail.c Fri Dec 18 00:33:04 2015 (r292416) @@ -1585,11 +1585,14 @@ kern_jail_set(struct thread *td, struct #endif onamelen = namelen = 0; if (name != NULL) { - /* Give a default name of the jid. */ + /* Give a default name of the jid. Also allow the name to be + * explicitly the jid - but not any other number, and only in + * normal form (no leading zero/etc). + */ if (name[0] == '\0') snprintf(name = numbuf, sizeof(numbuf), "%d", jid); - else if (*namelc == '0' || (strtoul(namelc, &p, 10) != jid && - *p == '\0')) { + else if ((strtoul(namelc, &p, 10) != jid || + namelc[0] < '1' || namelc[0] > '9') && *p == '\0') { error = EINVAL; vfs_opterror(opts, "name cannot be numeric (unless it is the jid)"); From owner-svn-src-stable-10@freebsd.org Fri Dec 18 00:40:21 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59743A4AD24; Fri, 18 Dec 2015 00:40:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6A71782; Fri, 18 Dec 2015 00:40:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI0eK86061820; Fri, 18 Dec 2015 00:40:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI0eJ1r061818; Fri, 18 Dec 2015 00:40:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512180040.tBI0eJ1r061818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 18 Dec 2015 00:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292417 - in stable: 10/share/man/man4 10/sys/kern 9/share/man/man4 9/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 00:40:21 -0000 Author: jhb Date: Fri Dec 18 00:40:19 2015 New Revision: 292417 URL: https://svnweb.freebsd.org/changeset/base/292417 Log: MFC 290429: When dumping an rman in DDB, include the RID of each resource. Modified: stable/10/share/man/man4/ddb.4 stable/10/sys/kern/subr_rman.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/man/man4/ddb.4 stable/9/sys/kern/subr_rman.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) Modified: stable/10/share/man/man4/ddb.4 ============================================================================== --- stable/10/share/man/man4/ddb.4 Fri Dec 18 00:33:04 2015 (r292416) +++ stable/10/share/man/man4/ddb.4 Fri Dec 18 00:40:19 2015 (r292417) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2014 +.Dd November 5, 2015 .Dt DDB 4 .Os .Sh NAME @@ -572,8 +572,8 @@ The same as "show pcpu", but for every C .Pp .It Ic show Cm allrman Show information related with resource management, including -interrupt request lines, DMA request lines, I/O ports and I/O memory -addresses. +interrupt request lines, DMA request lines, I/O ports, I/O memory +addresses, and Resource IDs. .\" .Pp .It Ic show Cm apic Modified: stable/10/sys/kern/subr_rman.c ============================================================================== --- stable/10/sys/kern/subr_rman.c Fri Dec 18 00:33:04 2015 (r292416) +++ stable/10/sys/kern/subr_rman.c Fri Dec 18 00:40:19 2015 (r292417) @@ -1052,7 +1052,8 @@ dump_rman(struct rman *rm) devname = "nomatch"; } else devname = NULL; - db_printf(" 0x%lx-0x%lx ", r->r_start, r->r_end); + db_printf(" 0x%lx-0x%lx (RID=%d) ", + r->r_start, r->r_end, r->r_rid); if (devname != NULL) db_printf("(%s)\n", devname); else From owner-svn-src-stable-10@freebsd.org Fri Dec 18 01:03:35 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E322EA4BA50; Fri, 18 Dec 2015 01:03:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5787156E; Fri, 18 Dec 2015 01:03:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI13YlH070414; Fri, 18 Dec 2015 01:03:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI13YjH070413; Fri, 18 Dec 2015 01:03:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512180103.tBI13YjH070413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 18 Dec 2015 01:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292418 - in stable: 10/share/man/man9 9/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 01:03:36 -0000 Author: jhb Date: Fri Dec 18 01:03:34 2015 New Revision: 292418 URL: https://svnweb.freebsd.org/changeset/base/292418 Log: MFC 292038: Fix a copy and paste bug when this page was first written by copying from BUS_BIND_INTR.9. Modified: stable/10/share/man/man9/BUS_DESCRIBE_INTR.9 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/man/man9/BUS_DESCRIBE_INTR.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/10/share/man/man9/BUS_DESCRIBE_INTR.9 ============================================================================== --- stable/10/share/man/man9/BUS_DESCRIBE_INTR.9 Fri Dec 18 00:40:19 2015 (r292417) +++ stable/10/share/man/man9/BUS_DESCRIBE_INTR.9 Fri Dec 18 01:03:34 2015 (r292418) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2009 +.Dd December 9, 2015 .Dt BUS_DESCRIBE_INTR 9 .Os .Sh NAME @@ -38,7 +38,7 @@ .In sys/param.h .In sys/bus.h .Ft int -.Fo BUS_BIND_INTR +.Fo BUS_DESCRIBE_INTR .Fa "device_t dev" "device_t child" "struct resource *irq" "void *cookie" .Fa "const char *descr" .Fc From owner-svn-src-stable-10@freebsd.org Fri Dec 18 01:44:05 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3484CA4B2AE; Fri, 18 Dec 2015 01:44:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE7081380; Fri, 18 Dec 2015 01:44:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI1i33w082397; Fri, 18 Dec 2015 01:44:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI1i3ev082396; Fri, 18 Dec 2015 01:44:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512180144.tBI1i3ev082396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Dec 2015 01:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292421 - stable/10/usr.sbin/crunch/crunchide X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 01:44:05 -0000 Author: emaste Date: Fri Dec 18 01:44:03 2015 New Revision: 292421 URL: https://svnweb.freebsd.org/changeset/base/292421 Log: Sync crunchide(1) arch support with HEAD MFC r276764, r281781, r282291, r292106 Add support to crunchide for handling AArch64 (arm64) ELF files. Remove local EM_* ELF definitions provided by system ELF headers Restore local EM_AARCH64 constant for bootstrapping Add RISC-V to supported machine types Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 18 01:32:43 2015 (r292420) +++ stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 18 01:44:03 2015 (r292421) @@ -175,37 +175,20 @@ ELFNAMEEND(check)(int fd, const char *fn switch (xe16toh(eh.e_machine)) { case EM_386: break; case EM_ALPHA: break; -#ifndef EM_ARM -#define EM_ARM 40 +#ifndef EM_AARCH64 +#define EM_AARCH64 183 #endif + case EM_AARCH64: break; case EM_ARM: break; -#ifndef EM_MIPS -#define EM_MIPS 8 -#endif -#ifndef EM_MIPS_RS4_BE /* same as EM_MIPS_RS3_LE */ -#define EM_MIPS_RS4_BE 10 -#endif case EM_MIPS: break; case /* EM_MIPS_RS3_LE */ EM_MIPS_RS4_BE: break; -#ifndef EM_IA_64 -#define EM_IA_64 50 -#endif - case EM_IA_64: break; -#ifndef EM_PPC -#define EM_PPC 20 -#endif case EM_PPC: break; -#ifndef EM_PPC64 -#define EM_PPC64 21 -#endif case EM_PPC64: break; -#ifndef EM_SPARCV9 -#define EM_SPARCV9 43 +#ifndef EM_RISCV +#define EM_RISCV 243 #endif + case EM_RISCV: break; case EM_SPARCV9: break; -#ifndef EM_X86_64 -#define EM_X86_64 62 -#endif case EM_X86_64: break; /* ELFDEFNNAME(MACHDEP_ID_CASES) */ From owner-svn-src-stable-10@freebsd.org Fri Dec 18 02:34:03 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58BACA4AE62; Fri, 18 Dec 2015 02:34:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D7001300; Fri, 18 Dec 2015 02:34:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI2Y2FQ097166; Fri, 18 Dec 2015 02:34:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI2Y1Bl097163; Fri, 18 Dec 2015 02:34:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512180234.tBI2Y1Bl097163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Dec 2015 02:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292422 - stable/10/usr.sbin/crunch/crunchide X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 02:34:03 -0000 Author: emaste Date: Fri Dec 18 02:34:01 2015 New Revision: 292422 URL: https://svnweb.freebsd.org/changeset/base/292422 Log: MFC r281655: crunchide: remove unused a.out and non-functional ECOFF support Sponsored by: The FreeBSD Foundation Deleted: stable/10/usr.sbin/crunch/crunchide/exec_aout.c Modified: stable/10/usr.sbin/crunch/crunchide/Makefile stable/10/usr.sbin/crunch/crunchide/crunchide.c stable/10/usr.sbin/crunch/crunchide/extern.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/crunch/crunchide/Makefile ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/Makefile Fri Dec 18 01:44:03 2015 (r292421) +++ stable/10/usr.sbin/crunch/crunchide/Makefile Fri Dec 18 02:34:01 2015 (r292422) @@ -5,11 +5,6 @@ SRCS= crunchide.c TARGET_ARCH?= ${MACHINE_ARCH} -.if ${TARGET_ARCH} == i386 && ${MACHINE_ARCH} == i386 -CFLAGS+=-DNLIST_AOUT -SRCS+= exec_aout.c -.endif - .if ${TARGET_ARCH} == ia64 || ${TARGET_ARCH} == powerpc64 || \ ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH} == amd64 || \ ${TARGET_ARCH:Mmips64*} Modified: stable/10/usr.sbin/crunch/crunchide/crunchide.c ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/crunchide.c Fri Dec 18 01:44:03 2015 (r292421) +++ stable/10/usr.sbin/crunch/crunchide/crunchide.c Fri Dec 18 02:34:01 2015 (r292422) @@ -212,12 +212,6 @@ struct { int (*check)(int, const char *); /* 1 if match, zero if not */ int (*hide)(int, const char *); /* non-zero if error */ } exec_formats[] = { -#ifdef NLIST_AOUT - { "a.out", check_aout, hide_aout, }, -#endif -#ifdef NLIST_ECOFF - { "ECOFF", check_elf64, hide_elf64, }, -#endif #ifdef NLIST_ELF32 { "ELF32", check_elf32, hide_elf32, }, #endif Modified: stable/10/usr.sbin/crunch/crunchide/extern.h ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/extern.h Fri Dec 18 01:44:03 2015 (r292421) +++ stable/10/usr.sbin/crunch/crunchide/extern.h Fri Dec 18 02:34:01 2015 (r292422) @@ -31,14 +31,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef NLIST_AOUT -int check_aout(int, const char *); -int hide_aout(int, const char *); -#endif -#ifdef NLIST_ECOFF -int check_ecoff(int, const char *); -int hide_ecoff(int, const char *); -#endif #ifdef NLIST_ELF32 int check_elf32(int, const char *); int hide_elf32(int, const char *); From owner-svn-src-stable-10@freebsd.org Fri Dec 18 03:06:40 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A1E5A4BEF1; Fri, 18 Dec 2015 03:06:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FD531950; Fri, 18 Dec 2015 03:06:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI36dvh006699; Fri, 18 Dec 2015 03:06:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI36d84006697; Fri, 18 Dec 2015 03:06:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512180306.tBI36d84006697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Dec 2015 03:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292423 - stable/10/usr.sbin/crunch/crunchide X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 03:06:40 -0000 Author: emaste Date: Fri Dec 18 03:06:39 2015 New Revision: 292423 URL: https://svnweb.freebsd.org/changeset/base/292423 Log: MFC r281674: crunchide: always include both 32- and 64-bit ELF support This avoids the need to build a target-specific crunchide for cross- builds. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/crunch/crunchide/Makefile stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/crunch/crunchide/Makefile ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/Makefile Fri Dec 18 02:34:01 2015 (r292422) +++ stable/10/usr.sbin/crunch/crunchide/Makefile Fri Dec 18 03:06:39 2015 (r292423) @@ -1,19 +1,9 @@ # $FreeBSD$ PROG= crunchide -SRCS= crunchide.c +SRCS= crunchide.c exec_elf32.c exec_elf64.c -TARGET_ARCH?= ${MACHINE_ARCH} - -.if ${TARGET_ARCH} == ia64 || ${TARGET_ARCH} == powerpc64 || \ - ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH} == amd64 || \ - ${TARGET_ARCH:Mmips64*} -CFLAGS+=-DNLIST_ELF64 -SRCS+= exec_elf64.c +CFLAGS+=-DNLIST_ELF32 -DNLIST_ELF64 exec_elf64.o: exec_elf32.c -.else -CFLAGS+=-DNLIST_ELF32 -SRCS+= exec_elf32.c -.endif .include Modified: stable/10/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 18 02:34:01 2015 (r292422) +++ stable/10/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 18 03:06:39 2015 (r292423) @@ -79,6 +79,9 @@ __FBSDID("$FreeBSD$"); #define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y)))) #define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE)) #define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x))) +#ifndef ELFCLASS +#define ELFCLASS CONCAT(ELFCLASS,ELFSIZE) +#endif #define xe16toh(x) ((data == ELFDATA2MSB) ? be16toh(x) : le16toh(x)) #define xe32toh(x) ((data == ELFDATA2MSB) ? be32toh(x) : le32toh(x)) @@ -167,7 +170,7 @@ ELFNAMEEND(check)(int fd, const char *fn if (read(fd, &eh, sizeof eh) != sizeof eh) return 0; - if (IS_ELF(eh) == 0) + if (IS_ELF(eh) == 0 || eh.e_ident[EI_CLASS] != ELFCLASS) return 0; data = eh.e_ident[EI_DATA]; From owner-svn-src-stable-10@freebsd.org Fri Dec 18 06:58:46 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1634A4A062; Fri, 18 Dec 2015 06:58:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD0E21F08; Fri, 18 Dec 2015 06:58:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBI6wiqD074760; Fri, 18 Dec 2015 06:58:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBI6wiU1074754; Fri, 18 Dec 2015 06:58:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512180658.tBI6wiU1074754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 18 Dec 2015 06:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292430 - stable/10/lib/libc/resolv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 06:58:46 -0000 Author: ngie Date: Fri Dec 18 06:58:44 2015 New Revision: 292430 URL: https://svnweb.freebsd.org/changeset/base/292430 Log: MFC r292250: Allow users override `DEBUG` on the command line via DEBUG_FLAGS="-DDEBUG" with lib/libc/resolv by conditionalizing its definition Reviewed by: ume, vangyzen Differential Revision: https://reviews.freebsd.org/D4519 Modified: stable/10/lib/libc/resolv/res_init.c stable/10/lib/libc/resolv/res_mkquery.c stable/10/lib/libc/resolv/res_mkupdate.c stable/10/lib/libc/resolv/res_query.c stable/10/lib/libc/resolv/res_send.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/resolv/res_init.c ============================================================================== --- stable/10/lib/libc/resolv/res_init.c Fri Dec 18 06:13:18 2015 (r292429) +++ stable/10/lib/libc/resolv/res_init.c Fri Dec 18 06:58:44 2015 (r292430) @@ -115,7 +115,9 @@ __FBSDID("$FreeBSD$"); /*% Options. Should all be left alone. */ #define RESOLVSORT -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #ifdef SOLARIS2 #include Modified: stable/10/lib/libc/resolv/res_mkquery.c ============================================================================== --- stable/10/lib/libc/resolv/res_mkquery.c Fri Dec 18 06:13:18 2015 (r292429) +++ stable/10/lib/libc/resolv/res_mkquery.c Fri Dec 18 06:58:44 2015 (r292430) @@ -83,7 +83,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif extern const char *_res_opcodes[]; Modified: stable/10/lib/libc/resolv/res_mkupdate.c ============================================================================== --- stable/10/lib/libc/resolv/res_mkupdate.c Fri Dec 18 06:13:18 2015 (r292429) +++ stable/10/lib/libc/resolv/res_mkupdate.c Fri Dec 18 06:58:44 2015 (r292430) @@ -54,7 +54,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #define MAXPORT 1024 static int getnum_str(u_char **, u_char *); Modified: stable/10/lib/libc/resolv/res_query.c ============================================================================== --- stable/10/lib/libc/resolv/res_query.c Fri Dec 18 06:13:18 2015 (r292429) +++ stable/10/lib/libc/resolv/res_query.c Fri Dec 18 06:58:44 2015 (r292430) @@ -88,7 +88,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #if PACKETSZ > 1024 #define MAXPACKET PACKETSZ Modified: stable/10/lib/libc/resolv/res_send.c ============================================================================== --- stable/10/lib/libc/resolv/res_send.c Fri Dec 18 06:13:18 2015 (r292429) +++ stable/10/lib/libc/resolv/res_send.c Fri Dec 18 06:58:44 2015 (r292430) @@ -119,7 +119,9 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #include "res_debug.h" #include "res_private.h" From owner-svn-src-stable-10@freebsd.org Fri Dec 18 14:52:13 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF8FDA4B521; Fri, 18 Dec 2015 14:52:13 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 778071CE1; Fri, 18 Dec 2015 14:52:13 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIEqCXn014952; Fri, 18 Dec 2015 14:52:12 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIEqC5N014951; Fri, 18 Dec 2015 14:52:12 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201512181452.tBIEqC5N014951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 18 Dec 2015 14:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292438 - stable/10/sys/dev/hyperv/utilities X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 14:52:13 -0000 Author: royger Date: Fri Dec 18 14:52:12 2015 New Revision: 292438 URL: https://svnweb.freebsd.org/changeset/base/292438 Log: MFC r292258: hyperv/kvp: wake up the daemon if it's sleeping due to poll() Submitted by: Dexuan Cui Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_kvp.c Fri Dec 18 14:35:27 2015 (r292437) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Fri Dec 18 14:52:12 2015 (r292438) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -114,6 +115,8 @@ static struct cdev *hv_kvp_dev; static struct hv_kvp_msg *hv_kvp_dev_buf; struct proc *daemon_task; +static struct selinfo hv_kvp_selinfo; + /* * Global state to track and synchronize multiple * KVP transaction requests from the host. @@ -628,6 +631,9 @@ hv_kvp_send_msg_to_daemon(void) /* Send the msg to user via function deamon_read - setting sema */ sema_post(&kvp_globals.dev_sema); + + /* We should wake up the daemon, in case it's doing poll() */ + selwakeup(&hv_kvp_selinfo); } @@ -940,7 +946,7 @@ hv_kvp_dev_daemon_write(struct cdev *dev * for daemon to read. */ static int -hv_kvp_dev_daemon_poll(struct cdev *dev __unused, int events, struct thread *td __unused) +hv_kvp_dev_daemon_poll(struct cdev *dev __unused, int events, struct thread *td) { int revents = 0; @@ -953,6 +959,9 @@ hv_kvp_dev_daemon_poll(struct cdev *dev */ if (kvp_globals.daemon_busy == true) revents = POLLIN; + else + selrecord(td, &hv_kvp_selinfo); + mtx_unlock(&kvp_globals.pending_mutex); return (revents); From owner-svn-src-stable-10@freebsd.org Fri Dec 18 14:56:50 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76754A4B7D1; Fri, 18 Dec 2015 14:56:50 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43B4211B2; Fri, 18 Dec 2015 14:56:50 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIEuniH015546; Fri, 18 Dec 2015 14:56:49 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIEun02015545; Fri, 18 Dec 2015 14:56:49 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201512181456.tBIEun02015545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 18 Dec 2015 14:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292439 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 14:56:50 -0000 Author: royger Date: Fri Dec 18 14:56:49 2015 New Revision: 292439 URL: https://svnweb.freebsd.org/changeset/base/292439 Log: MFC r291156: Ignore the inbound checksum flags when doing packet forwarding in netvsc driver. Sponsored by: Microsoft OSTC PR: 203630 Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Dec 18 14:52:12 2015 (r292438) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Dec 18 14:56:49 2015 (r292439) @@ -128,6 +128,15 @@ __FBSDID("$FreeBSD$"); #define HV_NV_SC_PTR_OFFSET_IN_BUF 0 #define HV_NV_PACKET_OFFSET_IN_BUF 16 +/* + * A unified flag for all outbound check sum flags is useful, + * and it helps avoiding unnecessary check sum calculation in + * network forwarding scenario. + */ +#define HV_CSUM_FOR_OUTBOUND \ + (CSUM_IP|CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP|CSUM_IP_TSO| \ + CSUM_IP_ISCSI|CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP| \ + CSUM_IP6_TSO|CSUM_IP6_ISCSI) /* * Data types @@ -570,7 +579,8 @@ hn_start_locked(struct ifnet *ifp) packet->vlan_tci & 0xfff; } - if (0 == m_head->m_pkthdr.csum_flags) { + /* Only check the flags for outbound and ignore the ones for inbound */ + if (0 == (m_head->m_pkthdr.csum_flags & HV_CSUM_FOR_OUTBOUND)) { goto pre_send; } From owner-svn-src-stable-10@freebsd.org Fri Dec 18 19:15:26 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CB6CA4B1B6; Fri, 18 Dec 2015 19:15:26 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 4325A178A; Fri, 18 Dec 2015 19:15:26 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 5AB8E56489; Fri, 18 Dec 2015 13:15:25 -0600 (CST) From: Eric van Gyzen Subject: Re: svn commit: r290014 - in stable/10: lib/libthr/arch/amd64 lib/libthr/arch/i386 libexec/rtld-elf/amd64 libexec/rtld-elf/i386 share/mk References: <201510261621.t9QGLuL2028872@repo.freebsd.org> <71109998-711D-4ECA-9B44-5A7B1F8705F3@FreeBSD.org> X-Enigmail-Draft-Status: N1110 To: David Chisnall Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Message-ID: <56745B49.6050903@FreeBSD.org> Date: Fri, 18 Dec 2015 13:15:21 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <71109998-711D-4ECA-9B44-5A7B1F8705F3@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 19:15:26 -0000 David, I apologize for the slow reply. Your message went to my "stable" box, which I read less often. On 11/14/2015 12:30, David Chisnall wrote: > On 26 Oct 2015, at 16:21, Eric van Gyzen > wrote: >> >> One counter-argument to this change is that most applications >> already use SIMD, and the number of applications and amount of SIMD >> usage are only increasing. > > Note that SSE and SIMD are not the same thing. The x86-64 ABI uses > SSE registers for floating point arguments, so even a purely scalar > application that uses floating point will end up faulting in the SSE > state. I'm aware. Using the term "SIMD" was an admittedly weak attempt to be platform agnostic. > I believe that the no-sse option for clang is ABI-preserving, so will > not actually disable all SSE unless you also specify -msoft-float. I'm afraid that's not the case: $ cat square.c double square(double x) { return (x*x); } $ clang -mno-sse -c square.c fatal error: error in backend: SSE register return with SSE disabled clang: error: clang frontend command failed with exit code 70 (use -v to see invocation) FreeBSD clang version 3.7.0 (tags/RELEASE_370/final 246257) 20150906 Target: x86_64-unknown-freebsd11.0 [snip] Shall I file the bug report, as it suggests? > I don’t think that libthr uses floating point anywhere, but libc does > and you only need to call one function that takes a floating point > argument in between context switches to lose this gain on x86-64. > With this change, we’re making the compiler emit less efficient code, > on the assumption that nothing will touch the fpu in the quantum > before the next context switch. I’d really like to see the set of > applications that you benchmarked the change with on x86-64 to reach > the conclusion that this is a net win overall. > > Or, to put it another way: How many applications are multithreaded > but don’t use any floating point code? If I showed you the applications that I care about the most, I would risk losing my job. When we updated from FreeBSD 9 to 10, we measured a significant loss in performance. This was due to multiple factors, one of which was that clang started using SSE widely. We were not yet using that version of clang for our own code, so most of the performance loss was due to the usage of SSE in libthr. Using -mno-sse restored the lost performance. It's possible that we lost performance due to SSE in other libraries; I haven't pursued this. These applications only use floating-point in some rare corners of management code, not in any performance-sensitive paths. They also don't use libc very much. On a recent head, I used this script https://people.freebsd.org/~vangyzen/thr_sse/thr_sse_file_line.sh to generate this list https://people.freebsd.org/~vangyzen/thr_sse/thr_sse_file_line.txt of line numbers in libthr that use SSE. I manually reviewed those to write this list: https://people.freebsd.org/~vangyzen/thr_sse/thr_sse_uses.txt The vast majority of these simply aren't interesting, because they would not be called in a performance-sensitive code path, or the code that uses SSE pales in comparison to the weight of the surrounding code. The only one that I find truly interesting is mutex_unlock_common(), which uses SSE to NULL two pointers in the "fast path", which is rather lightweight. So, I wrote this nanobenchmark https://people.freebsd.org/~vangyzen/thr_sse/movups/ to measure the effect of using SSE in such a way. I ran it on five machines and got these results: https://people.freebsd.org/~vangyzen/thr_sse/movups/summary.txt As you can see, most of them show no significant difference. One machine, however, showed a 16.7% improvement with SSE. I find this fascinating, and I honestly can't explain it. As always, I welcome feedback. I then wrote this /slightly/ more realistic microbenchmark https://people.freebsd.org/~vangyzen/thr_sse/mutex_bench/ which uses pthread_mutex_unlock and therefore mutex_unlock_common. I ran it on /that/ machine. I got these results: https://people.freebsd.org/~vangyzen/thr_sse/mutex_bench/summary.txt When libthr was compiled without SSE, the throughput was improved by 7.25%. Performance of a real-world application improved 3-5%. I honestly don't like the change any more than you do. I committed it just because it helped us measurably, it might help others, and I doubt it hurts anybody. If that last point is disproven, I'll be happy to revert it. Now, I look forward to a lively discussion. :) Eric From owner-svn-src-stable-10@freebsd.org Fri Dec 18 19:58:36 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17CF8A4AF0A; Fri, 18 Dec 2015 19:58:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDAE91602; Fri, 18 Dec 2015 19:58:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBIJwZQh005825; Fri, 18 Dec 2015 19:58:35 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBIJwZ6X005824; Fri, 18 Dec 2015 19:58:35 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512181958.tBIJwZ6X005824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 18 Dec 2015 19:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292450 - stable/10/etc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 19:58:36 -0000 Author: jilles Date: Fri Dec 18 19:58:34 2015 New Revision: 292450 URL: https://svnweb.freebsd.org/changeset/base/292450 Log: MFC r291770: rc.subr: Check for running daemons before a custom start_cmd is executed. Currently rc scripts implementing their own start_cmd do not enjoy the benefits of rc.subr's own check for rc_pid. This leads to around a third of ports with such a start_cmd not to check for the process at all and two thirds of ports to re-implement this check (sometimes wrongly). This patch moves the check for rc_pid to before ${rc_arg}_cmd is executed. Submitted by: Dirk Engling Reviewed by: feld Relnotes: yes Modified: stable/10/etc/rc.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.subr ============================================================================== --- stable/10/etc/rc.subr Fri Dec 18 19:29:58 2015 (r292449) +++ stable/10/etc/rc.subr Fri Dec 18 19:58:34 2015 (r292450) @@ -974,6 +974,14 @@ run_rc_command() fi fi + if [ $rc_arg = "start" -a -z "$rc_fast" -a -n "$rc_pid" ]; then + if [ -z "$rc_quiet" ]; then + echo 1>&2 "${name} already running? " \ + "(pid=$rc_pid)." + fi + return 1 + fi + # if there's a custom ${XXX_cmd}, # run that instead of the default # @@ -1002,14 +1010,6 @@ run_rc_command() ;; start) - if [ -z "$rc_fast" -a -n "$rc_pid" ]; then - if [ -z "$rc_quiet" ]; then - echo 1>&2 "${name} already running? " \ - "(pid=$rc_pid)." - fi - return 1 - fi - if [ ! -x "${_chroot}${_chroot:+/}${command}" ]; then warn "run_rc_command: cannot run $command" return 1 From owner-svn-src-stable-10@freebsd.org Sat Dec 19 01:21:30 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D843A4B471; Sat, 19 Dec 2015 01:21:30 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E24751D71; Sat, 19 Dec 2015 01:21:29 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJ1LTE6001410; Sat, 19 Dec 2015 01:21:29 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJ1LTn8001409; Sat, 19 Dec 2015 01:21:29 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512190121.tBJ1LTn8001409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sat, 19 Dec 2015 01:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292456 - stable/10/lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2015 01:21:30 -0000 Author: ume Date: Sat Dec 19 01:21:28 2015 New Revision: 292456 URL: https://svnweb.freebsd.org/changeset/base/292456 Log: MFC r292129: RFC 3493 requires ignoring the loopback address for AI_ADDRCONFIG. Since it breaks certain jail setup, we ignore just 127.0.0.1 instead of whole loopback address range. PR: 192014 Reviewed by: hrs Modified: stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Fri Dec 18 23:05:36 2015 (r292455) +++ stable/10/lib/libc/net/getaddrinfo.c Sat Dec 19 01:21:28 2015 (r292456) @@ -1562,7 +1562,7 @@ addrconfig(struct addrinfo *pai) if (seen_inet) continue; sin = (struct sockaddr_in *)(ifa->ifa_addr); - if (IN_LOOPBACK(htonl(sin->sin_addr.s_addr))) + if (htonl(sin->sin_addr.s_addr) == INADDR_LOOPBACK) continue; seen_inet = 1; break; From owner-svn-src-stable-10@freebsd.org Sat Dec 19 02:35:33 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A47AA4C7B8; Sat, 19 Dec 2015 02:35:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1DE11BC; Sat, 19 Dec 2015 02:35:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJ2ZW6G022985; Sat, 19 Dec 2015 02:35:32 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJ2ZWmC022984; Sat, 19 Dec 2015 02:35:32 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201512190235.tBJ2ZWmC022984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 19 Dec 2015 02:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292461 - stable/10/lib/libc/resolv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2015 02:35:33 -0000 Author: vangyzen Date: Sat Dec 19 02:35:32 2015 New Revision: 292461 URL: https://svnweb.freebsd.org/changeset/base/292461 Log: MFC r289837 resolver: abuse _res a little less In the past, _res was a global variable. Now, it's multiple function calls. Several functions in the resolver use _res multiple times and therefore call the function(s) far more than necessary. Fix those callers to store the result of _res in a local variable. Add __noinline to the definition of res_init() to avoid the code bloat that these changes would have otherwise incurred. Thanks to jilles for noticing this. Sponsored by: Dell Inc. Modified: stable/10/lib/libc/resolv/res_data.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/resolv/res_data.c ============================================================================== --- stable/10/lib/libc/resolv/res_data.c Sat Dec 19 02:16:38 2015 (r292460) +++ stable/10/lib/libc/resolv/res_data.c Sat Dec 19 02:35:32 2015 (r292461) @@ -77,9 +77,10 @@ const char *_res_sectioncodes[] = { int res_ourserver_p(const res_state, const struct sockaddr_in *); -int +__noinline int res_init(void) { extern int __res_vinit(res_state, int); + res_state statp = &_res; /* * These three fields used to be statically initialized. This made @@ -100,14 +101,14 @@ res_init(void) { * set in RES_DEFAULT). Our solution is to declare such applications * "broken". They could fool us by setting RES_INIT but none do (yet). */ - if (!_res.retrans) - _res.retrans = RES_TIMEOUT; - if (!_res.retry) - _res.retry = RES_DFLRETRY; - if (!(_res.options & RES_INIT)) - _res.options = RES_DEFAULT; + if (!statp->retrans) + statp->retrans = RES_TIMEOUT; + if (!statp->retry) + statp->retry = RES_DFLRETRY; + if (!(statp->options & RES_INIT)) + statp->options = RES_DEFAULT; - return (__res_vinit(&_res, 1)); + return (__res_vinit(statp, 1)); } void @@ -122,10 +123,11 @@ fp_query(const u_char *msg, FILE *file) void fp_nquery(const u_char *msg, int len, FILE *file) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) return; - res_pquery(&_res, msg, len, file); + res_pquery(statp, msg, len, file); } int @@ -138,23 +140,25 @@ res_mkquery(int op, /*!< opcode of que u_char *buf, /*!< buffer to put query */ int buflen) /*!< size of buffer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nmkquery(&_res, op, dname, class, type, + return (res_nmkquery(statp, op, dname, class, type, data, datalen, newrr_in, buf, buflen)); } int res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nmkupdate(&_res, rrecp_in, buf, buflen)); + return (res_nmkupdate(statp, rrecp_in, buf, buflen)); } int @@ -163,11 +167,12 @@ res_query(const char *name, /*!< domain u_char *answer, /*!< buffer to put answer */ int anslen) /*!< size of answer buffer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nquery(&_res, name, class, type, answer, anslen)); + return (res_nquery(statp, name, class, type, answer, anslen)); } #ifndef _LIBC @@ -189,12 +194,13 @@ res_isourserver(const struct sockaddr_in int res_send(const u_char *buf, int buflen, u_char *ans, int anssiz) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { /* errno should have been set by res_init() in this case. */ return (-1); } - return (res_nsend(&_res, buf, buflen, ans, anssiz)); + return (res_nsend(statp, buf, buflen, ans, anssiz)); } #ifndef _LIBC @@ -202,12 +208,13 @@ int res_sendsigned(const u_char *buf, int buflen, ns_tsig_key *key, u_char *ans, int anssiz) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { /* errno should have been set by res_init() in this case. */ return (-1); } - return (res_nsendsigned(&_res, buf, buflen, key, ans, anssiz)); + return (res_nsendsigned(statp, buf, buflen, key, ans, anssiz)); } #endif @@ -218,12 +225,13 @@ res_close(void) { int res_update(ns_updrec *rrecp_in) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nupdate(&_res, rrecp_in, NULL)); + return (res_nupdate(statp, rrecp_in, NULL)); } int @@ -232,12 +240,13 @@ res_search(const char *name, /*!< domain u_char *answer, /*!< buffer to put answer */ int anslen) /*!< size of answer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nsearch(&_res, name, class, type, answer, anslen)); + return (res_nsearch(statp, name, class, type, answer, anslen)); } int @@ -247,24 +256,26 @@ res_querydomain(const char *name, u_char *answer, /*!< buffer to put answer */ int anslen) /*!< size of answer */ { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nquerydomain(&_res, name, domain, + return (res_nquerydomain(statp, name, domain, class, type, answer, anslen)); } u_int res_randomid(void) { - if ((_res.options & RES_INIT) == 0U && res_init() == -1) { - RES_SET_H_ERRNO(&_res, NETDB_INTERNAL); + res_state statp = &_res; + if ((statp->options & RES_INIT) == 0U && res_init() == -1) { + RES_SET_H_ERRNO(statp, NETDB_INTERNAL); return (-1); } - return (res_nrandomid(&_res)); + return (res_nrandomid(statp)); } int @@ -284,13 +295,15 @@ hostalias(const char *name) { int local_hostname_length(const char *hostname) { int len_host, len_domain; + res_state statp; - if (!*_res.defdname) + statp = &_res; + if (!*statp->defdname) res_init(); len_host = strlen(hostname); - len_domain = strlen(_res.defdname); + len_domain = strlen(statp->defdname); if (len_host > len_domain && - !strcasecmp(hostname + len_host - len_domain, _res.defdname) && + !strcasecmp(hostname + len_host - len_domain, statp->defdname) && hostname[len_host - len_domain - 1] == '.') return (len_host - len_domain - 1); return (0); From owner-svn-src-stable-10@freebsd.org Sat Dec 19 02:41:33 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D619A4CAA9; Sat, 19 Dec 2015 02:41:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AC7514E5; Sat, 19 Dec 2015 02:41:33 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBJ2fWrZ025207; Sat, 19 Dec 2015 02:41:32 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBJ2fW2d025203; Sat, 19 Dec 2015 02:41:32 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201512190241.tBJ2fW2d025203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 19 Dec 2015 02:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292462 - in stable/10: lib/libc/resolv share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2015 02:41:33 -0000 Author: vangyzen Date: Sat Dec 19 02:41:31 2015 New Revision: 292462 URL: https://svnweb.freebsd.org/changeset/base/292462 Log: MFC r289315, r292216 resolver: automatically reload /etc/resolv.conf On each resolver query, use stat(2) to see if the modification time of /etc/resolv.conf has changed. If so, reload the file and reinitialize the resolver library. However, only call stat(2) if at least two seconds have passed since the last call to stat(2), since calling it on every query could kill performance. This new behavior is enabled by default. Add a "reload-period" option to disable it or change the period of the test. Document this behavior and option in resolv.conf(5). Polish the man page just enough to appease igor. Relnotes: yes Sponsored by: Dell Inc. Modified: stable/10/lib/libc/resolv/res_init.c stable/10/lib/libc/resolv/res_private.h stable/10/lib/libc/resolv/res_state.c stable/10/share/man/man5/resolver.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/resolv/res_init.c ============================================================================== --- stable/10/lib/libc/resolv/res_init.c Sat Dec 19 02:35:32 2015 (r292461) +++ stable/10/lib/libc/resolv/res_init.c Sat Dec 19 02:41:31 2015 (r292462) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -238,6 +239,7 @@ __res_vinit(res_state statp, int preinit statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr; strcpy(statp->_u._ext.ext->nsuffix, "ip6.arpa"); strcpy(statp->_u._ext.ext->nsuffix2, "ip6.int"); + statp->_u._ext.ext->reload_period = 2; } else { /* * Historically res_init() rarely, if at all, failed. @@ -323,6 +325,18 @@ __res_vinit(res_state statp, int preinit nserv = 0; if ((fp = fopen(_PATH_RESCONF, "re")) != NULL) { + struct stat sb; + struct timespec now; + + if (statp->_u._ext.ext != NULL) { + if (_fstat(fileno(fp), &sb) == 0) { + statp->_u._ext.ext->conf_mtim = sb.st_mtim; + if (clock_gettime(CLOCK_MONOTONIC_FAST, &now) == 0) { + statp->_u._ext.ext->conf_stat = now.tv_sec; + } + } + } + /* read the config file */ while (fgets(buf, sizeof(buf), fp) != NULL) { /* skip comments */ @@ -583,9 +597,7 @@ res_setoptions(res_state statp, const ch { const char *cp = options; int i; -#ifndef _LIBC struct __res_state_ext *ext = statp->_u._ext.ext; -#endif #ifdef DEBUG if (statp->options & RES_DEBUG) @@ -668,6 +680,12 @@ res_setoptions(res_state statp, const ch } else if (!strncmp(cp, "no-check-names", sizeof("no-check-names") - 1)) { statp->options |= RES_NOCHECKNAME; + } else if (!strncmp(cp, "reload-period:", + sizeof("reload-period:") - 1)) { + if (ext != NULL) { + ext->reload_period = (u_short) + atoi(cp + sizeof("reload-period:") - 1); + } } #ifdef RES_USE_EDNS0 else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) { Modified: stable/10/lib/libc/resolv/res_private.h ============================================================================== --- stable/10/lib/libc/resolv/res_private.h Sat Dec 19 02:35:32 2015 (r292461) +++ stable/10/lib/libc/resolv/res_private.h Sat Dec 19 02:41:31 2015 (r292462) @@ -1,3 +1,5 @@ +/* $FreeBSD$ */ + #ifndef res_private_h #define res_private_h @@ -12,6 +14,9 @@ struct __res_state_ext { } sort_list[MAXRESOLVSORT]; char nsuffix[64]; char nsuffix2[64]; + struct timespec conf_mtim; /* mod time of loaded resolv.conf */ + time_t conf_stat; /* time of last stat(resolv.conf) */ + u_short reload_period; /* seconds between stat(resolv.conf) */ }; extern int Modified: stable/10/lib/libc/resolv/res_state.c ============================================================================== --- stable/10/lib/libc/resolv/res_state.c Sat Dec 19 02:35:32 2015 (r292461) +++ stable/10/lib/libc/resolv/res_state.c Sat Dec 19 02:41:31 2015 (r292462) @@ -26,6 +26,8 @@ */ #include +#include +#include #include #include #include @@ -35,6 +37,8 @@ #include "reentrant.h" #include "un-namespace.h" +#include "res_private.h" + #undef _res struct __res_state _res; @@ -59,13 +63,44 @@ res_keycreate(void) res_thr_keycreated = thr_keycreate(&res_key, free_res) == 0; } +static res_state +res_check_reload(res_state statp) +{ + struct timespec now; + struct stat sb; + struct __res_state_ext *ext; + + if ((statp->options & RES_INIT) == 0) { + return (statp); + } + + ext = statp->_u._ext.ext; + if (ext == NULL || ext->reload_period == 0) { + return (statp); + } + + if (clock_gettime(CLOCK_MONOTONIC_FAST, &now) != 0 || + (now.tv_sec - ext->conf_stat) < ext->reload_period) { + return (statp); + } + + ext->conf_stat = now.tv_sec; + if (stat(_PATH_RESCONF, &sb) == 0 && + (sb.st_mtim.tv_sec != ext->conf_mtim.tv_sec || + sb.st_mtim.tv_nsec != ext->conf_mtim.tv_nsec)) { + statp->options &= ~RES_INIT; + } + + return (statp); +} + res_state __res_state(void) { res_state statp; if (thr_main() != 0) - return (&_res); + return res_check_reload(&_res); if (thr_once(&res_init_once, res_keycreate) != 0 || !res_thr_keycreated) @@ -73,7 +108,7 @@ __res_state(void) statp = thr_getspecific(res_key); if (statp != NULL) - return (statp); + return res_check_reload(statp); statp = calloc(1, sizeof(*statp)); if (statp == NULL) return (&_res); Modified: stable/10/share/man/man5/resolver.5 ============================================================================== --- stable/10/share/man/man5/resolver.5 Sat Dec 19 02:35:32 2015 (r292461) +++ stable/10/share/man/man5/resolver.5 Sat Dec 19 02:41:31 2015 (r292462) @@ -32,7 +32,7 @@ .\" @(#)resolver.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 25, 2013 +.Dd October 12, 2015 .Dt RESOLVER 5 .Os .Sh NAME @@ -179,6 +179,19 @@ the resolver from obeying the standard and .Sy search rules with the given name. +.It Sy reload-period: Ns Ar n +The resolver checks the modification time of +.Pa /etc/resolv.conf +every +.Ar n +seconds. +If +.Pa /etc/resolv.conf +has changed, it is automatically reloaded. +The default for +.Ar n +is two seconds. +Setting it to zero disables the file check. .El .Pp Options may also be specified as a space or tab separated list using the @@ -195,8 +208,7 @@ If more than one instance of these keywo the last instance will override. .Pp The keyword and value must appear on a single line, and the keyword -(e.g.\& -.Sy nameserver ) +.Pq for example, Sy nameserver must start the line. The value follows the keyword, separated by white space. .Sh FILES